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: Ralf Wildenhues
Subject: Re: libltdl/Makefile.in DIST_COMMON issue
Date: Sun, 2 Oct 2005 15:50:23 +0200
User-agent: Mutt/1.5.9i

Hi Gary,

* Gary V. Vaughan wrote on Thu, Sep 29, 2005 at 06:41:07PM CEST:
> Ralf Wildenhues wrote:
> >* Ralf Wildenhues wrote on Wed, Sep 28, 2005 at 06:05:48PM CEST:
> >
> >>libtool/libltdl/Makefile.in created by automake-1.9 contains
*snip*
> >>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.

> >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?

Well, your LT_CONFIG_LTDL_DIR patch needs in first (I tested with your
next-to-last version of it).  Also there are bugs in your new test :)
See inline for an update.

> 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.

Nono, this can wait.

> 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.

Somewhat attacked with my recent testsuite update patch.  The rest isn't
urgent, though.  We can still break things again later.  :->

Cheers,
Ralf

*snip*
| 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[[])

See other review :)

| +LT_CONFIG_LTDL_DIR([ltdl])
| +AC_CONFIG_AUX_DIR([ltdl/config])
| +AC_CONFIG_MACRO_DIR([ltdl/m4])
| +AM_INIT_AUTOMAKE([foreign])

I need AC_PROG_CC and AM_PROG_CC_C_O here
(the former not strictly necessary since it's AC_REQUIREd).

| +LT_INIT
| +LT_WITH_LTDL
| +AC_CONFIG_FILES([Makefile])
| +AC_OUTPUT
| +]])
| +
| +AT_DATA([Makefile.am],
| +[[ACLOCAL_AMFLAGS = -I ltdl/m4

Adding `SUBDIRS = ltdl .' helps.

| +
| +bin_PROGRAMS = main
| +main_SOURCES   = main.c
| +main_CPPFLAGS  = $(INCLTDL)

How 'bout LTDLINCL?

| +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

The --force is very unfortunate here.  When libtoolize is fixed to
update time stamps on the installed macro files, it'll force an aclocal
rerun after configure..  the other, and real bug however was that
_lt_pkgdatadir is not passed to libtoolize here -- fixed in the Autotest
update patch together with..

| +test -f Makefile   || ./configure                   || exit 1
| +${MAKE-make}
| +
| +AT_CHECK([${MAKE-make} distcheck], 0, [ignore])

 .. a replacement of this whole block with

 touch config.h.in
 LT_AT_LIBTOOLIZE([--ltdl=ltdl --install])
 LT_AT_AUTORECONF([--verbose --install])
 LT_AT_CONFIGURE
 LT_AT_MAKE
 LT_AT_MAKE([distcheck])

| +
| +AT_CLEANUP
*snip*

So, with this in place, we arrive at the following problem:

The toplevel Makefile wants to distribute ltdl/config/compile,
the ltdl/Makefile doesn't.  Since it's a subproject, its distdir target
just goes and erases its config/ subdir before populating it.  Hrmpf.
We can't get the `distdir' target to work on the `ltdl' subdir before
`.' ..

Do you know a way around this?  If not, it seems to me like a strong
argument _against_ ever suggesting AC_CONFIG_AUX_DIR([ltdl/config]) to
users in this setting.

By the way, this is not the problem I tried to solve --
libltdl/Makefile.in has no trace of mdate-sh or the like.

Cheers,
Ralf




reply via email to

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