libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libltdl/Makefile.in DIST_COMMON issue


From: Gary V. Vaughan
Subject: Re: libltdl/Makefile.in DIST_COMMON issue
Date: Thu, 29 Sep 2005 17:41:07 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20050305)

Ralf Wildenhues wrote:
Me again.

How do!

* Ralf Wildenhues wrote on Wed, Sep 28, 2005 at 06:05:48PM CEST:

Ugly issue.  :-/

libtool/libltdl/Makefile.in created by automake-1.9 contains

DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \
       $(am__ltdlinclude_HEADERS_DIST) $(srcdir)/Makefile.am \
       $(srcdir)/Makefile.in $(srcdir)/config-h.in \
       $(top_srcdir)/configure COPYING.LIB argz.c config/compile \
       config/config.guess config/config.sub config/depcomp \
       config/install-sh config/ltmain.sh config/mdate-sh \
       config/missing config/texinfo.tex lt__dirent.c lt__strl.c

but the subtree created by `libtoolize --ltdl' lacks
 config/mdate-sh config/texinfo.tex
(and we surely don't want to change that).  So a `make dist' in the
client package will fail.

Scratch my last patch, it doesn't solve the problem.  autoreconf and
automatic rebuilding rules due to changed configure-dependencies will
not use the rule, so result in a broken Makefile.in anyway.

Next idea: use of a stamp file.  I don't actually know whether this
is good in all cases.  The idea I had before was to do the fixup during
`make install', but that is quite tricky, too, if you don't want to mess
with permissions nor write below $top_builddir.

OK to apply this one?

Not sure.  Here is a version including a test case.  It still isn't
working correctly for me... but maybe that is due to an unfixed bug
in my patch stack?

If the test works for you (maybe you can see a bug in it that is
breaking it on my machine?), then please commit along with the test.

Cheers,
        Gary.

P.S. A lot of this new test seems to be shared with other tests.  We
     should factor out the common stuff so that we only have to fix
     bugs once.  I'll put it on my TODO list.
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
 Makefile.am           |   15 +++++-
 tests/libltdl-dist.at |  111 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/testsuite.at    |    2 
 3 files changed, 126 insertions(+), 2 deletions(-)

Index: ChangeLog
from  Ralf Wildenhues  <address@hidden>,
        Gary V. Vaughan  <address@hidden>
        * Makefile.am (libltdl/stamp-mk): New rule to fix
        libltdl/Makefile.in to not distribute the auxiliary files that
        are not used by libltdl, so that packages that use
        `libtoolize --ltdl' can `make dist' successfully.
        (EXTRA_DIST): Distribute stamp-mk.
        (all-local): Depend on it.
        (TESTSUITE_AT): Add libltdl-dist.at.
        * tests/libltdl-dist.at: New test to prevent regressions.
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -216,8 +216,18 @@ $(srcdir)/libltdl/Makefile.am: Makefile.
 $(srcdir)/libltdl/Makefile.in: $(srcdir)/libltdl/Makefile.am
        cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile
 
+$(srcdir)/libltdl/stamp-mk: $(srcdir)/libltdl/Makefile.in
+       cd $(srcdir)/libltdl && \
+       sed -e 's,config/mdate-sh,,' -e 's,config/texinfo.tex,,' \
+           -e 's,config/mkinstalldirs,,' \
+         < Makefile.in > Makefile.inT && \
+       mv -f Makefile.inT Makefile.in
+       echo stamp > $@
+
+EXTRA_DIST += libltdl/stamp-mk
+
 # We want the libltdl files to be up to date as much as possible.
-all-local: $(srcdir)/libltdl/Makefile.in
+all-local: $(srcdir)/libltdl/stamp-mk
 
 
 ## -------- ##
@@ -414,7 +424,7 @@ install-data-local: libltdl/Makefile.in
          f=`echo "$$p" | sed 's|^.*/||'`; \
          echo " $(INSTALL_DATA) '$$f' '$(DESTDIR)$(aclocaldir)/$$f'"; \
          $(INSTALL_DATA) "$$f" "$(DESTDIR)$(aclocaldir)/$$f"; \
-       done; \
+       done
 ## install the helper scripts
        $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
        $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/config
@@ -469,6 +479,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/am-subdir.at \
                  tests/duplicate_members.at \
                  tests/inherited_flags.at \
+                 tests/libltdl-dist.at \
                  tests/libtoolize.at \
                  tests/old-m4-iface.at \
                  tests/standalone.at \
Index: tests/libltdl-dist.at
===================================================================
--- /dev/null
+++ tests/libltdl-dist.at
@@ -0,0 +1,111 @@
+# Hand crafted tests for GNU Libtool.                         -*- Autotest -*-
+# Copyright 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+AT_BANNER([make dist in trees with an ltdl subdirectory.])
+
+AT_SETUP([libltdl redistribution])
+
+AT_DATA([configure.ac],
+[[AC_INIT([ltdldist-demo], []]AT_PACKAGE_VERSION[[], 
[]]AT_PACKAGE_BUGREPORT[[])
+LT_CONFIG_LTDL_DIR([ltdl])
+AC_CONFIG_AUX_DIR([ltdl/config])
+AC_CONFIG_MACRO_DIR([ltdl/m4])
+AM_INIT_AUTOMAKE([foreign])
+LT_INIT
+LT_WITH_LTDL
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I ltdl/m4
+
+bin_PROGRAMS = main
+main_SOURCES   = main.c
+main_CPPFLAGS  = $(INCLTDL)
+main_LDADD     = -dlopen module.la $(LIBLTDL)
+
+lib_LTLIBRARIES   = module.la
+module_la_LDFLAGS = -module -avoid-version -no-undefined
+
+$(LIBLTDL):
+       cd ltdl && $(MAKE) libltdlc.la
+]])
+
+AT_DATA([main.c],
+[[#include <stdio.h>
+#include "ltdl.h"
+
+int main (int argc, char **argv)
+{
+  lt_dlhandle module;
+  const char *(*foo) (const char *) = 0;
+  int status = 1;
+
+  LTDL_SET_PRELOADED_SYMBOLS();
+  if (lt_dlinit() != 0) {
+    fprintf (stderr, "error during initialisation: %s\n", lt_dlerror());
+    return 1;
+  }
+
+  module = lt_dlopen("module.la");
+  if (!module) {
+    fprintf (stderr, "error dlopening module.la: %s\n", lt_dlerror());
+    goto finish;
+  }
+
+  foo = (const char *(*)(const char *)) lt_dlsym (module, "foo");
+  if (!foo) {
+    fprintf (stderr, "error fetching func: %s\n", lt_dlerror());
+    goto finish;
+  }
+
+  printf ("%s\n", (*foo) ("foo bar"));
+  status = 0;
+
+finish:
+  if (lt_dlexit() != 0) {
+    fprintf (stderr, "error during finalisation: %s\n", lt_dlerror());
+    status = 1;
+  }
+
+  return status;
+}
+]])
+
+AT_DATA([module.c],
+[[const char *
+foo (const char *str)
+{
+  while (*str++ != ' ')
+    ;
+  return str;
+}
+]])
+
+# Workaround a bug in current ltdl.m4
+test -f config.h.in || touch config.h.in
+
+test -f ltmain.sh  || LT_AT_LIBTOOLIZE([--ltdl --install])
+test -f configure  || $AUTORECONF --force --install || exit 1
+test -f Makefile   || ./configure                   || exit 1
+${MAKE-make}
+
+AT_CHECK([${MAKE-make} distcheck], 0, [ignore])
+
+AT_CLEANUP
Index: tests/testsuite.at
===================================================================
--- tests/testsuite.at.orig
+++ tests/testsuite.at
@@ -110,3 +110,5 @@ m4_include([template.at])
 m4_include([early-libtool.at])
 # stress test
 m4_include([stresstest.at])
+# Distributing libltdl
+m4_include([libltdl-dist.at])

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]