[PPL-devel] User-visible changes to lib-link.m4 and lib-prefix.m4

Roberto Bagnara bagnara at cs.unipr.it
Wed Oct 8 18:15:39 CEST 2008


Bruno Haible wrote:
>> We discovered, though, that things stop working for us
>> in passing from the versions distributed with with Gettext 0.14.6
>> to the versions distributed with Gettext 0.15.
> 
> The change between lib-link.m4 of version 0.14.6 and 0.15 is that before,
> it assumed the libraries to be installed in $prefix/lib. In 0.15, on
> Linux bi-arch systems, i.e. systems which have the system libraries both
> in 32-bit mode and in 64-bit mode, when you are compiling in 64-bit mode,
> the macros will look for the libraries in $prefix/lib64 rather than in
> $prefix/lib.
> 
> In 0.18 (or already with the macros in gnulib today) a similar change is
> done for Solaris bi-arch systems.
> 
> For you, the simple fix is
>   cd $prefix
>   ln -s lib lib64
> 
> The vendor conventions on bi-arch Linux systems are to store 32-bit libraries
> in $prefix/lib and 64-bit libraries in $prefix/lib64. Unfortunately this
> does not coincide with the GNU default $(libdir), which is $prefix/lib always.
> Feel free to follow-up to the discussion started at
>   <http://lists.gnu.org/archive/html/autoconf/2008-09/msg00059.html>

Hi Bruno,

thanks for your message.  However, the problem we observe is not in the
location of the library.  The problem is that, passing from the version
distributed with Gettext 0.14.6 to the version distributed with
Gettext 0.15, the right -Idir flag is not added to CPPFLAGS.
Looking at the text of our macro, which begins with

     AC_DEFUN([AC_CHECK_GMP],
     [
     dnl Since libgmp and libgmpxx are usually installed in the same location,
     dnl let the prefixes default from each other.
     if test -n "$with_libgmpxx_prefix" && test -z "$with_libgmp_prefix"; then
       with_libgmp_prefix="$with_libgmpxx_prefix"
     else
       if test -n "$with_libgmp_prefix" && test -z "$with_libgmpxx_prefix"; then
         with_libgmpxx_prefix="$with_libgmp_prefix"
       fi
     fi

     dnl Check how to link with libgmp.
     AC_LIB_LINKFLAGS([gmp])

     dnl Check how to link with libgmpxx.
     AC_LIB_LINKFLAGS([gmpxx], [gmp])

     ac_save_LIBS="$LIBS"
     LIBS="$LIBS $LIBGMPXX"
     AC_LANG_PUSH(C++)

     AC_MSG_CHECKING([for the GMP library version 4.1.3 or above])
     AC_RUN_IFELSE([AC_LANG_SOURCE([[
     #include <gmpxx.h>
     #include <cstdlib>

     #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3)
     #error "GMP version 4.1.3 or higher is required"
     #endif

     int main() {
       mpz_class n("3141592653589793238462643383279502884");
       exit(0);
     }
     ]])],
       AC_MSG_RESULT(yes)
       ac_cv_have_gmp=yes,
       AC_MSG_RESULT(no)
       ac_cv_have_gmp=no,
       AC_MSG_RESULT(no)
       ac_cv_have_gmp=no)

what happens is that, with the newer version, configure attempts
compilation of the program in AC_RUN_IFELSE without the -Idir
option that should have been determined by AC_LIB_LINKFLAGS,
which of course causes the compilation to fail.  Did something
change that could explain this behavior?
Thanks again,

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list