+2010-11-07 Ollie Wild <aaw@google.com>
+
+ Modify --with-pic to support per-package configurations.
+ * libltdl/m4/libtool.m4: Modify --with-pic to accept a list of
+ package names. Modelled off --enable-shared.
+ * tests/with-pic.at: New test.
+ * Makefile.am (TESTSUITE_AT): Add tests/with-pic.at.
+ * doc/libtool.texi (LT_INIT): Enhance documentation of
+ --with-pic configure flag.
+ * NEWS (New features): Mention that --with-pic now accepts a
+ comma-separated list of package names.
+
2010-11-10 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Fix cwrapper test failure with --disable-static.
tests/ctor.at \
tests/exceptions.at \
tests/early-libtool.at \
+ tests/with-pic.at \
tests/no-executables.at \
tests/deplibs-ident.at \
tests/configure-iface.at \
New in 2.4.2 2010-12-??: git version 2.4.1a, Libtool team:
+* New features:
+
+ - The --with-pic configure option now supports a list of comma-separated
+ package names. This can be used to build some static libraries with PIC
+ objects while building others with non-PIC objects.
+
* Bug fixes:
- The generic approximation of the command line length limit (when getconf is
@defmac LT_INIT (@var{options})
@defmacx AC_PROG_LIBTOOL
@defmacx AM_PROG_LIBTOOL
-Add support for the @option{--enable-shared} and @option{--disable-shared}
-@code{configure} flags.@footnote{@code{LT_INIT} requires that
-you define the @file{Makefile} variable @code{top_builddir} in your
+Add support for the @option{--enable-shared}, @option{--disable-shared},
+@option{--enable-static}, @option{--disable-static}, @option{--with-pic}, and
+@option{--without-pic} @code{configure} flags.@footnote{@code{LT_INIT} requires
+that you define the @file{Makefile} variable @code{top_builddir} in your
@file{Makefile.in}. Automake does this automatically, but Autoconf
users should set it to the relative path to the top of your build
directory (@file{../..}, for example).} @code{AC_PROG_LIBTOOL} and
The package name @samp{default} matches any packages that have not set
their name in the @code{PACKAGE} environment variable.
+The @option{--with-pic} and @option{--without-pic} configure flags can be used
+to specify whether or not @command{libtool} uses PIC objects. By default,
+@command{libtool} uses PIC objects for shared libraries and non-PIC objects for
+static libraries. The @option{--with-pic} option also accepts a comma-separated
+list of package names. Specifying @option{--with-pic=@var{pkgs}} is the same
+as configuring every package in @var{pkgs} with @option{--with-pic} and every
+other package with the default configuration. The package name @samp{default}
+is treated the same as for @option{--enable-shared} and
+@option{--enable-static}.
+
This macro also sets the shell variable @code{LIBTOOL_DEPS}, that you
can use to automatically update the libtool script if it becomes
out-of-date. In order to do that, add to your @file{configure.ac}:
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
--- /dev/null
+# with-pic.at -- test the --with-pic flag -*- Autotest -*-
+
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool 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 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+AT_SETUP([test --with-pic])
+eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`
+
+AT_CHECK([test "z$pic_flag" != "z" || exit 77])
+AT_CHECK([test "$at_srcdir" != . || exit 77])
+
+CONFIGURE=$abs_top_srcdir/tests/demo/configure
+: ${MAKE=make}
+
+LT_AT_CONFIGURE([--disable-shared --with-pic=no], [$CONFIGURE])
+AT_CHECK([$MAKE], [], [stdout], [ignore])
+AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
+$MAKE clean
+
+LT_AT_CONFIGURE([--disable-shared --with-pic=yes], [$CONFIGURE])
+AT_CHECK([$MAKE], [], [stdout], [ignore])
+AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
+$MAKE clean
+
+LT_AT_CONFIGURE([--disable-shared --with-pic="demo,foo,bar"], [$CONFIGURE])
+AT_CHECK([$MAKE], [], [stdout], [ignore])
+AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
+$MAKE clean
+
+LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"], [$CONFIGURE])
+AT_CHECK([$MAKE], [], [stdout], [ignore])
+AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
+$MAKE clean
+
+AT_CLEANUP