libtool
[Top][All Lists]
Advanced

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

Re: [PATCH] Don't install .la files when --no-la-files is used


From: Roumen Petrov
Subject: Re: [PATCH] Don't install .la files when --no-la-files is used
Date: Sat, 08 Nov 2008 23:32:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.17) Gecko/20080925 SeaMonkey/1.1.12

Russ Allbery wrote:
Roumen Petrov <address@hidden> writes:

It was old build bug when building readline library on some linux-es. In
my memory is suse 7.1 but I'm sure that only this particular version was
affected.

Many other linux verdors build readline without dependent libraries and
this allow application to be linked against different curses compatible
libraries.

libreadline is linked against libncurses on Debian.
Which version ?
This is an 7(5?) years old linux bug.


But surely it's obvious that this isn't an interesting argument and has
nothing to do with my point?  It may be that my specific example doesn't
apply on the system that you're looking at right now, but I'm sure that
you can find dozens or hundreds of others without even trying.  Any shared
library that is linked with other shared libraries and is built with
libtool can present this problem.

[SNIP]

The sample is attached.
save attached files:
- pkg1_bootstrap.sh as pkg1/bootstrap.sh
- pkg2_bootstrap.sh as pkg2/bootstrap.sh
- app_bootstrap.sh as app/bootstrap.sh

Adjust prefixes to libtool, automake, autoconf paths..

Details:
- library foo1 for pkg1 export function foo1
- library foo2 for pkg2 export function foo2 and use function foo1
- application use functions foo1 and foo2 and and to link with libraries that export them.

Where is libtool bug ?


Roumen
#! /bin/sh

set -e
testPREFIX=/tmp/test/lt/pkg-deplibs-minlibs

libtoolPREFIX=/usr/local/libtool/1.5.26
#libtoolPREFIX=/usr/local/libtool/2.2.2
automakePREFIX=/usr/local/automake/1.10.1
autoconfPREFIX=/usr/local/autoconf/2.61

PATH=${libtoolPREFIX}/bin:$PATH
PATH=${automakePREFIX}/bin:$PATH
PATH=${autoconfPREFIX}/bin:$PATH
export PATH


cat > foo.c <<EOF
#include <stdio.h>

extern void foo1(long n) {
  fprintf(stderr, "foo1(%ld)\n", n);
}
EOF
cat > Makefile.am <<EOF
lib_LTLIBRARIES = libfoo1.la
libfoo1_la_SOURCES = foo.c
libfoo1_la_LDFLAGS = -avoid-version
EOF

test -d build-aux || mkdir build-aux
cat > configure.ac <<EOF
AC_INIT([test1], [0.0])
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(build-aux)

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE

AC_PROG_CC
AC_PROG_LIBTOOL

AC_OUTPUT([Makefile])
EOF


libtoolize --force --copy --automake
aclocal -I ${libtoolPREFIX}/share/aclocal
automake --foreign --add-missing --copy
autoconf


( set -e
  D=build-linux
  test -d $D || mkdir $D
  cd $D

  ../configure --prefix=${testPREFIX}
  make
  make install
)
#! /bin/sh

set -e
testPREFIX=/tmp/test/lt/pkg-deplibs-minlibs

libtoolPREFIX=/usr/local/libtool/1.5.26
#libtoolPREFIX=/usr/local/libtool/2.2.2
automakePREFIX=/usr/local/automake/1.10.1
autoconfPREFIX=/usr/local/autoconf/2.61

PATH=${libtoolPREFIX}/bin:$PATH
PATH=${automakePREFIX}/bin:$PATH
PATH=${autoconfPREFIX}/bin:$PATH
export PATH


cat > foo.c <<EOF
#include <stdio.h>
extern void foo1(long n);

extern void foo2(long n) {
  foo1(n);
  fprintf(stderr, "foo2(%ld)\n", n);
}
EOF
cat > Makefile.am <<EOF
lib_LTLIBRARIES = libfoo2.la
libfoo2_la_SOURCES = foo.c
libfoo2_la_LDFLAGS = -avoid-version
#libfoo2_la_LIBADD = -L${testPREFIX}/lib -lfoo1
EOF

test -d build-aux || mkdir build-aux
cat > configure.ac <<EOF
AC_INIT([test2], [0.0])
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(build-aux)

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE

AC_PROG_CC
AC_PROG_LIBTOOL

AC_OUTPUT([Makefile])
EOF


libtoolize --force --copy --automake
aclocal -I ${libtoolPREFIX}/share/aclocal
automake --foreign --add-missing --copy
autoconf


( set -e
  D=build-linux
  test -d $D || mkdir $D
  cd $D

  ../configure --prefix=${testPREFIX}
  make
  make install
)
#! /bin/sh

set -e
testPREFIX=/tmp/test/lt/pkg-deplibs-minlibs

libtoolPREFIX=/usr/local/libtool/1.5.26
#libtoolPREFIX=/usr/local/libtool/2.2.2
automakePREFIX=/usr/local/automake/1.10.1
autoconfPREFIX=/usr/local/autoconf/2.61

PATH=${libtoolPREFIX}/bin:$PATH
PATH=${automakePREFIX}/bin:$PATH
PATH=${autoconfPREFIX}/bin:$PATH
export PATH


test -d build-aux || mkdir build-aux
cat > foo.c <<EOF
#include <stdio.h>
extern void foo1(long n);
extern void foo2(long n);

int main() {
  foo1(11);
  foo2(22);
  fprintf(stderr, "main()\n");
  return(0);
}
EOF
cat > Makefile.am <<EOF
bin_PROGRAMS = foo
foo_SOURCES = foo.c
foo_LDADD = -L${testPREFIX}/lib -lfoo2 -lfoo1
EOF
cat > configure.ac <<EOF
AC_INIT([test], [0.0])
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(build-aux)

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE

AC_PROG_CC
AC_PROG_LIBTOOL

AC_OUTPUT([Makefile])
EOF


libtoolize --force --copy --automake
aclocal -I ${libtoolPREFIX}/share/aclocal
automake --foreign --add-missing --copy
autoconf


( set -e
  D=build-linux
  test -d $D || mkdir $D
  cd $D

  ../configure --prefix=${testPREFIX}
  make
)

reply via email to

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