Reported at <https://savannah.gnu.org/support/index.php?110674>.
* doc/libtool.texi (LT_INIT): Talk about --enable-pic instead of
--with-pic, and about --disable-pic instead of --without-pic.
(Test descriptions): Likewise.
* m4/ltoptions.m4 (_LT_WITH_PIC): Use AC_ARG_ENABLE instead of
AC_ARG_WITH. In the default case, use _AC_ENABLE_IF, in order to still
recognize the old options --with-pic and --without-pic.
* tests/demo.at: Add a test for --enable-pic, keeping the test for
--with-pic. Test '--disable-pic' instead of '--with-pic=no'.
* tests/with-pic.at: Test --enable-pic instead of --with-pic.
* NEWS: Mention the change.
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes:
+
+ - The configure options --with-pic and --without-pic have been renamed
+ to --enable-pic and --disable-pic, respectively. The old names
+ --with-pic and --without-pic are still supported, though, for
+ backward compatibility.
+
* Noteworthy changes in release 2.5.2 (2024-08-29) [beta]
@defmacx AC_PROG_LIBTOOL
@defmacx AM_PROG_LIBTOOL
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
+@option{--enable-static}, @option{--disable-static}, @option{--enable-pic}, and
+@option{--disable-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
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,
+The @option{--enable-pic} and @option{--disable-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
+static libraries.
+The @option{--enable-pic} option also accepts a comma-separated
+list of package names. Specifying @option{--enable-pic=@var{pkgs}} is the same
+as configuring every package in @var{pkgs} with @option{--enable-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}.
@item pic-only
Change the default behaviour for @command{libtool} to try to use only
PIC objects. The user may still override this default by specifying
-@option{--without-pic} to @command{configure}.
+@option{--disable-pic} to @command{configure}.
@item no-pic
Change the default behaviour of @command{libtool} to try to use only
non-PIC objects. The user may still override this default by
-specifying @option{--with-pic} to @command{configure}.
+specifying @option{--enable-pic} to @command{configure}.
@end table
install as expected.
@item @file{tests/with_pic.at}
-Tests the function of the @option{--with-pic} flag. The @option{--with-pic}
+Tests the function of the @option{--enable-pic} flag. The @option{--enable-pic}
flag is used to specify whether or not @command{libtool} uses PIC objects.
-This includes tests for setting @option{--with-pic} to no, yes, or a comma
+This includes tests for setting @option{--enable-pic} to no, yes, or a comma
delimited list of package names.
@end table
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 9 ltoptions.m4
+# serial 10 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# 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@<:@=PKGS@:>@],
+[AC_ARG_ENABLE([pic],
+ [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[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=m4_default([$1], [default])])
+ case $enableval in
+ yes|no) pic_mode=$enableval ;;
+ *)
+ 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 $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [dnl Continue to support --with-pic and --without-pic, for backward
+ dnl compatibility.
+ _AC_ENABLE_IF([with], [pic],
+ [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=m4_default([$1], [default])])]
+ )
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
_LT_DEMO_SETUP
+LT_AT_CHECK_CONFIG([--enable-pic])
+_LT_CHECK_EXECUTE
+
+AT_CLEANUP
+
+
+AT_SETUP([force PIC objects (old option name)])
+
+_LT_DEMO_SETUP
+
LT_AT_CHECK_CONFIG([--with-pic])
_LT_CHECK_EXECUTE
])
_LT_DEMO_SETUP
-LT_AT_CHECK_CONFIG([--with-pic=no])
+LT_AT_CHECK_CONFIG([--disable-pic])
_LT_CHECK_EXECUTE
AT_CLEANUP
-# with-pic.at -- test the --with-pic flag -*- Autotest -*-
+# with-pic.at -- test the --enable-pic flag -*- Autotest -*-
# Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc.
#
# along with GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
####
-AT_SETUP([test --with-pic])
+AT_SETUP([test --enable-pic])
# Set up a tests/demo.at style project.
_LT_DEMO_SETUP
: ${MAKE=make}
-LT_AT_CONFIGURE([--disable-shared --with-pic=no])
+LT_AT_CONFIGURE([--disable-shared --enable-pic=no])
AT_CHECK([$MAKE], [], [stdout], [ignore])
AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
$MAKE clean
-LT_AT_CONFIGURE([--disable-shared --with-pic=yes])
+LT_AT_CONFIGURE([--disable-shared --enable-pic=yes])
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"])
+LT_AT_CONFIGURE([--disable-shared --enable-pic="demo,foo,bar"])
AT_CHECK([$MAKE], [], [stdout], [ignore])
AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
$MAKE clean
-LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"])
+LT_AT_CONFIGURE([--disable-shared --enable-pic="foo,bar"])
AT_CHECK([$MAKE], [], [stdout], [ignore])
AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
$MAKE clean