[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: noinst_LTLIBRARIES multiply defined in condition TRUE
From: |
Bruno Haible |
Subject: |
Re: noinst_LTLIBRARIES multiply defined in condition TRUE |
Date: |
Wed, 29 Nov 2006 15:26:17 +0100 |
User-agent: |
KMail/1.9.1 |
Simon Josefsson wrote:
> With recent gnulib, I get this during autoreconf:
>
> gl/Makefile.am:24: noinst_LTLIBRARIES multiply defined in condition TRUE ...
> gl/Makefile.am:16: ... `noinst_LTLIBRARIES' previously defined here
>
> The Makefile.am reads:
>
> AUTOMAKE_OPTIONS = 1.5 gnits
>
> noinst_LTLIBRARIES = libgnu.la
>
> libgnu_la_SOURCES =
> libgnu_la_LIBADD = $(gl_LTLIBOBJS)
> libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
> EXTRA_libgnu_la_SOURCES =
> libgnu_la_LDFLAGS = $(AM_LDFLAGS)
> noinst_HEADERS =
> noinst_LTLIBRARIES =
> EXTRA_DIST =
> BUILT_SOURCES =
> SUFFIXES =
> MOSTLYCLEANFILES = core *.stackdump
> MOSTLYCLEANDIRS =
> CLEANFILES =
> DISTCLEANFILES =
> MAINTAINERCLEANFILES =
>
> Which seems clearly wrong.
>
> The culprit seems to be the patch below, which makes gnulib-tool read:
>
> if grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *= *$libname\\.$libext\$"
> allsnippets.tmp > /dev/null; then
> # One of the snippets already specifies an installation location for the
> # library. Don't confuse automake by saying it should not be installed.
> :
> else
> # By default, the generated library should not be installed.
> echo "noinst_${perhapsLT}LIBRARIES $assign $libname.$libext"
> fi
> echo
> echo "${libname}_${libext}_SOURCES ="
> # Here we use $(LIBOBJS), not @address@hidden The value is the same.
> However,
> # automake during its analyses looks for $(LIBOBJS), not for @address@hidden
> echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
> echo "${libname}_${libext}_DEPENDENCIES =
> \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
> echo "EXTRA_${libname}_${libext}_SOURCES ="
> if test "$libtool" = true; then
> echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
> fi
> if test -z "$makefile_name"; then
> echo "noinst_HEADERS ="
> echo "noinst_LTLIBRARIES ="
>
> Thus outputting two noinst_LTLIBRARIES statements.
You're right, I missed the fact that noinst_LTLIBRARIES was already assigned
to.
> Bruno, what is the reason for this change?
It's to allow modules to augment noinst_LTLIBRARIES. (For example, if a
package wants to be buildable with CC=g++ but needs the regex module, it
needs to add "-x c" to the CPPFLAGS of this module. Automake supports only
CPPFLAGS per library, not per module, so this requires an intermediate
library.)
I'm applying this fix.
2006-11-29 Bruno Haible <address@hidden>
* gnulib-tool (func_emit_lib_Makefile_am): Initialize also
noinst_LIBRARIES. Augment noinst_LIBRARIES and noinst_LTLIBRARIES
using +=.
Reported by Simon Josefsson <address@hidden>.
diff -c -3 -r1.198 gnulib-tool
*** gnulib-tool 27 Nov 2006 14:22:11 -0000 1.198
--- gnulib-tool 29 Nov 2006 14:24:22 -0000
***************
*** 1236,1261 ****
echo "AUTOMAKE_OPTIONS = 1.5 gnits${subdir_options}"
fi
echo
- if grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *= *$libname\\.$libext\$"
allsnippets.tmp > /dev/null; then
- # One of the snippets already specifies an installation location for the
- # library. Don't confuse automake by saying it should not be installed.
- :
- else
- # By default, the generated library should not be installed.
- echo "noinst_${perhapsLT}LIBRARIES $assign $libname.$libext"
- fi
- echo
- echo "${libname}_${libext}_SOURCES ="
- # Here we use $(LIBOBJS), not @address@hidden The value is the same.
However,
- # automake during its analyses looks for $(LIBOBJS), not for @address@hidden
- echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
- echo "${libname}_${libext}_DEPENDENCIES =
\$(${macro_prefix}_${perhapsLT}LIBOBJS)"
- echo "EXTRA_${libname}_${libext}_SOURCES ="
- if test "$libtool" = true; then
- echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
- fi
if test -z "$makefile_name"; then
echo "noinst_HEADERS ="
echo "noinst_LTLIBRARIES ="
# Automake versions < 1.9b create an empty pkgdatadir at installation time
# if you specify pkgdata_DATA to empty. This is a workaround.
--- 1236,1244 ----
echo "AUTOMAKE_OPTIONS = 1.5 gnits${subdir_options}"
fi
echo
if test -z "$makefile_name"; then
echo "noinst_HEADERS ="
+ echo "noinst_LIBRARIES ="
echo "noinst_LTLIBRARIES ="
# Automake versions < 1.9b create an empty pkgdatadir at installation time
# if you specify pkgdata_DATA to empty. This is a workaround.
***************
*** 1276,1281 ****
--- 1259,1283 ----
echo "AM_CPPFLAGS ="
fi
echo
+ if grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *= *$libname\\.$libext\$"
allsnippets.tmp > /dev/null; then
+ # One of the snippets already specifies an installation location for the
+ # library. Don't confuse automake by saying it should not be installed.
+ :
+ else
+ # By default, the generated library should not be installed.
+ echo "noinst_${perhapsLT}LIBRARIES += $libname.$libext"
+ fi
+ echo
+ echo "${libname}_${libext}_SOURCES ="
+ # Here we use $(LIBOBJS), not @address@hidden The value is the same.
However,
+ # automake during its analyses looks for $(LIBOBJS), not for @address@hidden
+ echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
+ echo "${libname}_${libext}_DEPENDENCIES =
\$(${macro_prefix}_${perhapsLT}LIBOBJS)"
+ echo "EXTRA_${libname}_${libext}_SOURCES ="
+ if test "$libtool" = true; then
+ echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
+ fi
+ echo
cat allsnippets.tmp \
| sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g'
echo