bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

havelib: better support for OpenBSD


From: Bruno Haible
Subject: havelib: better support for OpenBSD
Date: Tue, 2 Jan 2007 21:50:51 +0100
User-agent: KMail/1.9.1

Hi,

The --with-libxyz-prefix option did not actually work on OpenBSD. This patch
should fix it.


2006-12-24  Bruno Haible  <address@hidden>

        Improve support for OpenBSD.
        * build-aux/config.rpath (libname_spec): Export.
        (library_names_spec): New variable. Export.
        * m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Extract libname_spec and
        library_names_spec from the config.rpath output. Locate shared library
        through the name pattern in library_names_spec.

diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*_*.html' 
--exclude='*.*.html' --exclude='*.[13]' --exclude='*.1.in' 
--exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure 
--exclude=config.h.in --exclude=version.texi --exclude=stamp-vti 
--exclude='po-*-gen*.[ch]' --exclude='*.o' --exclude='*.lo' --exclude='*.gmo' 
--exclude=ABOUT-NLS --exclude=gnulib-lib --exclude=gnulib-m4 
--exclude=Makefile.gnulib --exclude='javadoc[12]' --exclude=CVS 
gettext-cvs/autoconf-lib-link/config.rpath 
gettext-6/autoconf-lib-link/config.rpath
*** build-aux/config.rpath      Wed May 17 00:38:10 2006
--- build-aux/config.rpath      Sun Dec 24 19:04:18 2006
***************
*** 488,520 ****
--- 488,541 ----
  
  # Check dynamic linker characteristics
  # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+ # Unlike libtool.m4, here we don't care about _all_ names of the library, but
+ # only about the one the linker finds when passed -lNAME. This is the last
+ # element of library_names_spec in libtool.m4, or possibly two of them if the
+ # linker has special search rules.
+ library_names_spec=      # the last element of library_names_spec in 
libtool.m4
  libname_spec='lib$name'
  case "$host_os" in
    aix3*)
+     library_names_spec='$libname.a'
      ;;
    aix4* | aix5*)
+     library_names_spec='$libname$shrext'
      ;;
    amigaos*)
+     library_names_spec='$libname.a'
      ;;
    beos*)
+     library_names_spec='$libname$shrext'
      ;;
    bsdi[45]*)
+     library_names_spec='$libname$shrext'
      ;;
    cygwin* | mingw* | pw32*)
      shrext=.dll
+     library_names_spec='$libname.dll.a $libname.lib'
      ;;
    darwin* | rhapsody*)
      shrext=.dylib
+     library_names_spec='$libname$shrext'
      ;;
    dgux*)
+     library_names_spec='$libname$shrext'
      ;;
    freebsd1*)
      ;;
    kfreebsd*-gnu)
+     library_names_spec='$libname$shrext'
      ;;
    freebsd* | dragonfly*)
+     case "$host_os" in
+       freebsd[123]*)
+         library_names_spec='$libname$shrext$versuffix' ;;
+       *)
+         library_names_spec='$libname$shrext' ;;
+     esac
      ;;
    gnu*)
+     library_names_spec='$libname$shrext'
      ;;
    hpux9* | hpux10* | hpux11*)
      case $host_cpu in
***************
*** 528,537 ****
--- 549,561 ----
          shrext=.sl
          ;;
      esac
+     library_names_spec='$libname$shrext'
      ;;
    interix3*)
+     library_names_spec='$libname$shrext'
      ;;
    irix5* | irix6* | nonstopux*)
+     library_names_spec='$libname$shrext'
      case "$host_os" in
        irix5* | nonstopux*)
          libsuff= shlibsuff=
***************
*** 549,588 ****
--- 573,628 ----
    linux*oldld* | linux*aout* | linux*coff*)
      ;;
    linux*)
+     library_names_spec='$libname$shrext'
      ;;
    knetbsd*-gnu)
+     library_names_spec='$libname$shrext'
      ;;
    netbsd*)
+     library_names_spec='$libname$shrext'
      ;;
    newsos6)
+     library_names_spec='$libname$shrext'
      ;;
    nto-qnx*)
+     library_names_spec='$libname$shrext'
      ;;
    openbsd*)
+     library_names_spec='$libname$shrext$versuffix'
      ;;
    os2*)
      libname_spec='$name'
      shrext=.dll
+     library_names_spec='$libname.a'
      ;;
    osf3* | osf4* | osf5*)
+     library_names_spec='$libname$shrext'
      ;;
    solaris*)
+     library_names_spec='$libname$shrext'
      ;;
    sunos4*)
+     library_names_spec='$libname$shrext$versuffix'
      ;;
    sysv4 | sysv4.3*)
+     library_names_spec='$libname$shrext'
      ;;
    sysv4*MP*)
+     library_names_spec='$libname$shrext'
      ;;
    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+     library_names_spec='$libname$shrext'
      ;;
    uts4*)
+     library_names_spec='$libname$shrext'
      ;;
  esac
  
  sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
  escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
  shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+ escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e 
"$sed_quote_subst"`
+ escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e 
"$sed_quote_subst"`
  escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed 
-e 's/^X//' -e "$sed_quote_subst"`
  
  LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
***************
*** 596,601 ****
--- 636,647 ----
  # Shared library suffix (normally "so").
  shlibext="$shlibext"
  
+ # Format of library name prefix.
+ libname_spec="$escaped_libname_spec"
+ 
+ # Library names that the linker finds when passed -lNAME.
+ library_names_spec="$escaped_library_names_spec"
+ 
  # Flag to hardcode \$libdir into a binary during linking.
  # This must work even if \$libdir does not exist.
  hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*_*.html' 
--exclude='*.*.html' --exclude='*.[13]' --exclude='*.1.in' 
--exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure 
--exclude=config.h.in --exclude=version.texi --exclude=stamp-vti 
--exclude='po-*-gen*.[ch]' --exclude='*.o' --exclude='*.lo' --exclude='*.gmo' 
--exclude=ABOUT-NLS --exclude=gnulib-lib --exclude=gnulib-m4 
--exclude=Makefile.gnulib --exclude='javadoc[12]' --exclude=CVS 
gettext-cvs/autoconf-lib-link/m4/lib-link.m4 
gettext-6/autoconf-lib-link/m4/lib-link.m4
*** m4/lib-link.m4      Sun Dec 10 02:45:46 2006
--- m4/lib-link.m4      Sun Dec 24 19:43:14 2006
***************
*** 1,4 ****
! # lib-link.m4 serial 10 (gettext-0.16.2)
  dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # lib-link.m4 serial 11 (gettext-0.16.2)
  dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 120,125 ****
--- 120,127 ----
    wl="$acl_cv_wl"
    libext="$acl_cv_libext"
    shlibext="$acl_cv_shlibext"
+   libname_spec="$acl_cv_libname_spec"
+   library_names_spec="$acl_cv_library_names_spec"
    hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
    hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
    hardcode_direct="$acl_cv_hardcode_direct"
***************
*** 211,237 ****
            found_la=
            found_so=
            found_a=
            if test $use_additional = yes; then
!             if test -n "$shlibext" \
!                && { test -f "$additional_libdir/lib$name.$shlibext" \
!                     || { test "$shlibext" = dll \
!                          && test -f "$additional_libdir/lib$name.dll.a"; }; 
}; then
!               found_dir="$additional_libdir"
!               if test -f "$additional_libdir/lib$name.$shlibext"; then
!                 found_so="$additional_libdir/lib$name.$shlibext"
                else
!                 found_so="$additional_libdir/lib$name.dll.a"
                fi
!               if test -f "$additional_libdir/lib$name.la"; then
!                 found_la="$additional_libdir/lib$name.la"
                fi
!             else
!               if test -f "$additional_libdir/lib$name.$libext"; then
!                 found_dir="$additional_libdir"
!                 found_a="$additional_libdir/lib$name.$libext"
!                 if test -f "$additional_libdir/lib$name.la"; then
!                   found_la="$additional_libdir/lib$name.la"
!                 fi
                fi
              fi
            fi
--- 213,265 ----
            found_la=
            found_so=
            found_a=
+           eval libname=\"$libname_spec\"        # typically: libname=lib$name
+           if test -n "$shlibext"; then
+             shrext=".$shlibext"                 # typically: shrext=.so
+           else
+             shrext=
+           fi
            if test $use_additional = yes; then
!             dir="$additional_libdir"
!             dnl The same code as in the loop below:
!             dnl First look for a shared library.
!             if test -n "$shlibext"; then
!               if test -f "$dir/$libname$shrext"; then
!                 found_dir="$dir"
!                 found_so="$dir/$libname$shrext"
                else
!                 if test "$library_names_spec" = '$libname$shrext$versuffix'; 
then
!                   ver=`(cd "$dir" && \
!                         for f in "$libname$shrext".*; do echo "$f"; done \
!                         | sed -e "s,^$libname$shrext\\\\.,," \
!                         | tr '.' ' ' | sort -n -r -k1 -k2 -k3 -k4 -k5 | tr ' 
' '.' \
!                         | sed 1q ) 2>/dev/null`
!                   if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; 
then
!                     found_dir="$dir"
!                     found_so="$dir/$libname$shrext.$ver"
!                   fi
!                 else
!                   eval library_names=\"$library_names_spec\"
!                   for f in $library_names; do
!                     if test -f "$dir/$f"; then
!                       found_dir="$dir"
!                       found_so="$dir/$f"
!                       break
!                     fi
!                   done
!                 fi
                fi
!             fi
!             dnl Then look for a static library.
!             if test "X$found_dir" = "X"; then
!               if test -f "$dir/$libname.$libext"; then
!                 found_dir="$dir"
!                 found_a="$dir/$libname.$libext"
                fi
!             fi
!             if test "X$found_dir" != "X"; then
!               if test -f "$dir/$libname.la"; then
!                 found_la="$dir/$libname.la"
                fi
              fi
            fi
***************
*** 241,266 ****
                case "$x" in
                  -L*)
                    dir=`echo "X$x" | sed -e 's/^X-L//'`
!                   if test -n "$shlibext" \
!                      && { test -f "$dir/lib$name.$shlibext" \
!                           || { test "$shlibext" = dll \
!                                && test -f "$dir/lib$name.dll.a"; }; }; then
!                     found_dir="$dir"
!                     if test -f "$dir/lib$name.$shlibext"; then
!                       found_so="$dir/lib$name.$shlibext"
                      else
!                       found_so="$dir/lib$name.dll.a"
!                     fi
!                     if test -f "$dir/lib$name.la"; then
!                       found_la="$dir/lib$name.la"
                      fi
!                   else
!                     if test -f "$dir/lib$name.$libext"; then
                        found_dir="$dir"
!                       found_a="$dir/lib$name.$libext"
!                       if test -f "$dir/lib$name.la"; then
!                         found_la="$dir/lib$name.la"
!                       fi
                      fi
                    fi
                    ;;
--- 269,312 ----
                case "$x" in
                  -L*)
                    dir=`echo "X$x" | sed -e 's/^X-L//'`
!                   dnl First look for a shared library.
!                   if test -n "$shlibext"; then
!                     if test -f "$dir/$libname$shrext"; then
!                       found_dir="$dir"
!                       found_so="$dir/$libname$shrext"
                      else
!                       if test "$library_names_spec" = 
'$libname$shrext$versuffix'; then
!                         ver=`(cd "$dir" && \
!                               for f in "$libname$shrext".*; do echo "$f"; 
done \
!                               | sed -e "s,^$libname$shrext\\\\.,," \
!                               | tr '.' ' ' | sort -n -r -k1 -k2 -k3 -k4 -k5 | 
tr ' ' '.' \
!                               | sed 1q ) 2>/dev/null`
!                         if test -n "$ver" && test -f 
"$dir/$libname$shrext.$ver"; then
!                           found_dir="$dir"
!                           found_so="$dir/$libname$shrext.$ver"
!                         fi
!                       else
!                         eval library_names=\"$library_names_spec\"
!                         for f in $library_names; do
!                           if test -f "$dir/$f"; then
!                             found_dir="$dir"
!                             found_so="$dir/$f"
!                             break
!                           fi
!                         done
!                       fi
                      fi
!                   fi
!                   dnl Then look for a static library.
!                   if test "X$found_dir" = "X"; then
!                     if test -f "$dir/$libname.$libext"; then
                        found_dir="$dir"
!                       found_a="$dir/$libname.$libext"
!                     fi
!                   fi
!                   if test "X$found_dir" != "X"; then
!                     if test -f "$dir/$libname.la"; then
!                       found_la="$dir/$libname.la"
                      fi
                    fi
                    ;;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]