GNU bug report logs - #41819
[libtool-2.4.6] --enable-shared=PKG does not work if LT_INIT is called before AM_INIT_AUTOMAKE

Previous Next

Package: libtool;

Reported by: Van de Bugger <van.de.bugger <at> gmail.com>

Date: Thu, 11 Jun 2020 23:27:01 UTC

Severity: normal

Done: Bruno Haible <bruno <at> clisp.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Van de Bugger <van.de.bugger <at> gmail.com>
Subject: bug#41819: closed (Re: bug#41819: [libtool-2.4.6] --enable-shared=PKG
 does not work if LT_INIT is called before AM_INIT_AUTOMAKE)
Date: Wed, 22 Jul 2020 15:05:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#41819: [libtool-2.4.6] --enable-shared=PKG does not work if LT_INIT is called before AM_INIT_AUTOMAKE

which was filed against the libtool package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 41819 <at> debbugs.gnu.org.

-- 
41819: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41819
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Bruno Haible <bruno <at> clisp.org>
To: van.de.bugger <at> gmail.com
Cc: 41819-done <at> debbugs.gnu.org, bug-libtool <at> gnu.org
Subject: Re: bug#41819: [libtool-2.4.6] --enable-shared=PKG does not work if
 LT_INIT is called before AM_INIT_AUTOMAKE
Date: Wed, 22 Jul 2020 17:04:01 +0200
> libtool manual says nothing about relative order of LT_INIT
> and AM_INIT_AUTOMAKE, while it is not obvious for newbies.

But the automake manual says it [1]:

  "add an ‘AM_INIT_AUTOMAKE’ call just after ‘AC_INIT’"

> Could you
> please note in libtool manual that LT_INIT must be called  *after*
> AM_INIT_AUTOMAKE?

Most macros need to be invoked after, not before, AC_INIT and AM_INIT_AUTOMAKE.
This is not specific to libtool macros.

Bruno

[1] https://www.gnu.org/software/automake/manual/html_node/Complete.html


[Message part 3 (message/rfc822, inline)]
From: Van de Bugger <van.de.bugger <at> gmail.com>
To: bug-libtool <at> gnu.org
Subject: [libtool-2.4.6] --enable-shared=PKG does not work if LT_INIT is
 called before AM_INIT_AUTOMAKE
Date: Fri, 12 Jun 2020 02:25:42 +0300
Hi,

I use:

libtool-2.4.6-33.fc32.x86_64
autoconf-2.69-33.fc32.noarch
automake-1.16.1-14.fc32.noarch

I faced a confusing libtool behaviour: --enable-shared=PKG configure
option does not work as described in the libtool manual. I have
prepared a little test to demonstrate it:

$ cat configure.ac 
AC_INIT([Foo], [0.0.1], [foo <at> example.org], [], [https://example.org/foo
])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([_m4])
AC_CONFIG_AUX_DIR([_aux])
LT_INIT([])
AM_INIT_AUTOMAKE([foreign subdir-objects])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT()

echo "========================================"
echo "enable_shared=$enable_shared"
echo "enable_static=$enable_static"
echo "========================================"

$ autoreconf -i

$ ./configure --enable-shared=foo
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
...
config.status: executing libtool commands
config.status: executing depfiles commands
========================================
enable_shared=no
enable_static=yes
========================================

Pay attention to --enable-shared=foo configure option. Regardless of
the option, enable_shared is no. --enable-shared option (without
argument) does work, though:

$ ./configure --enable-shared
...
========================================
enable_shared=yes
enable_static=yes
========================================

I have a look into configure script and found that PACKAGE variable is
used before it is initialized. It seems it was my mistake, I have
called LT_INIT *before* AM_INIT_AUTOMAKE:

LT_INIT([])
AM_INIT_AUTOMAKE([foreign subdir-objects])

Swapping these two lines:

AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT([])

sorts out the problem, so --enable-shared=foo works as expected.

However, libtool manual says nothing about relative order of LT_INIT
and AM_INIT_AUTOMAKE, while it is not obvious for newbies. Could you
please note in libtool manual that LT_INIT must be called  *after*
AM_INIT_AUTOMAKE?

Thanks.









This bug report was last modified 4 years and 302 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.