On Thu, Oct 21, 2010 at 5:29 PM, Ollie Wild <a...@google.com> wrote: > > This is motivated by GCC. We compile Fortran shared libraries which > must execute on systems with no libgfortrans.so. The usual approach, > passing --with-pic to configure is undesirable because it reduces the > performance of other static libraries. Instead, I have modified > --with-pic to accept a list of packages (as --enable-shared does). > > This allows us to configure GCC with --with-pic=libgfortran to compile > only libgfortran.a with position-independent code. > > All tests pass with and without this change. I have not added a new > test. AFAICT, the demo-[no]pic-* tests don't actually check that > -fPIC is used during compilation, and there doesn't appear to be a > comparable test for --enable-shared. If you would prefer a test for > this feature, please provide suggestions for how to approach this (I > am not familiar with the libtool testing framework). > > Thanks, > Ollie > > > 2010-10-21 Ollie Wild <a...@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.
Peter, thanks for noticing the quoting bug. Updated patch attached. I've removed quoting of $withval, but left $lt_save_ifs quoting in place. That's consistent with --enable-shared, and even though the new value of IFS may make that unnecessary, I'd prefer to be conservative. (BTW, please cc me directly on responses. I am not on the libtool-patches mailing list.) Ollie 2010-10-21 Ollie Wild <a...@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.
2010-10-21 Ollie Wild <a...@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. diff --git a/libltdl/m4/ltoptions.m4 b/libltdl/m4/ltoptions.m4 index 17cfd51..160f7f2 100644 --- a/libltdl/m4/ltoptions.m4 +++ b/libltdl/m4/ltoptions.m4 @@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # 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"], + [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 pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$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])