[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: havelib: better support for OpenBSD
From: |
Bruno Haible |
Subject: |
Re: havelib: better support for OpenBSD |
Date: |
Mon, 8 Jan 2007 21:12:14 +0100 |
User-agent: |
KMail/1.9.1 |
Ralf Wildenhues wrote:
> This patch breaks building CVS M4 on GNU/Linux/x86.
Thanks for reporting this.
Does this patch (already applied to gnulib CVS) fix the problem?
Bruno
2007-01-08 Bruno Haible <address@hidden>
Avoid variable names that conflict with those from libtool.
* m4/lib-link.m4 (AC_LIB_RPATH, AC_LIB_LINKFLAGS_BODY,
AC_LIB_LINKFLAGS_FROM_LIBS): Rename libext to acl_libext,
shlibext to acl_shlibext, libname_spec to acl_libname_spec,
library_names_spec to acl_library_names_spec, hardcode_* to
acl_hardcode_*.
Reported by Ralf Wildenhues.
diff -c -3 -r1.19 lib-link.m4
*** m4/lib-link.m4 8 Jan 2007 18:53:15 -0000 1.19
--- m4/lib-link.m4 8 Jan 2007 20:13:21 -0000
***************
*** 1,4 ****
! # lib-link.m4 serial 12 (gettext-0.16.2)
dnl Copyright (C) 2001-2007 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 13 (gettext-0.16.2)
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
***************
*** 100,107 ****
])
dnl Determine the platform dependent parameters needed to use rpath:
! dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
! dnl hardcode_direct, hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
--- 100,111 ----
])
dnl Determine the platform dependent parameters needed to use rpath:
! dnl acl_libext,
! dnl acl_shlibext,
! dnl acl_hardcode_libdir_flag_spec,
! dnl acl_hardcode_libdir_separator,
! dnl acl_hardcode_direct,
! dnl acl_hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
***************
*** 118,131 ****
acl_cv_rpath=done
])
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"
! hardcode_minus_L="$acl_cv_hardcode_minus_L"
dnl Determine whether the user wants rpath handling at all.
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not hardcode runtime library paths],
--- 122,135 ----
acl_cv_rpath=done
])
wl="$acl_cv_wl"
! acl_libext="$acl_cv_libext"
! acl_shlibext="$acl_cv_shlibext"
! acl_libname_spec="$acl_cv_libname_spec"
! acl_library_names_spec="$acl_cv_library_names_spec"
! acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
! acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
! acl_hardcode_direct="$acl_cv_hardcode_direct"
! acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
dnl Determine whether the user wants rpath handling at all.
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not hardcode runtime library paths],
***************
*** 213,221 ****
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
--- 217,225 ----
found_la=
found_so=
found_a=
! eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
! if test -n "$acl_shlibext"; then
! shrext=".$acl_shlibext" # typically: shrext=.so
else
shrext=
fi
***************
*** 223,234 ****
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\\\\.,," \
--- 227,238 ----
dir="$additional_libdir"
dnl The same code as in the loop below:
dnl First look for a shared library.
! if test -n "$acl_shlibext"; then
if test -f "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
! if test "$acl_library_names_spec" =
'$libname$shrext$versuffix'; then
ver=`(cd "$dir" && \
for f in "$libname$shrext".*; do echo "$f"; done \
| sed -e "s,^$libname$shrext\\\\.,," \
***************
*** 239,245 ****
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"
--- 243,249 ----
found_so="$dir/$libname$shrext.$ver"
fi
else
! eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
if test -f "$dir/$f"; then
found_dir="$dir"
***************
*** 252,260 ****
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
--- 256,264 ----
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
! if test -f "$dir/$libname.$acl_libext"; then
found_dir="$dir"
! found_a="$dir/$libname.$acl_libext"
fi
fi
if test "X$found_dir" != "X"; then
***************
*** 270,281 ****
-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\\\\.,," \
--- 274,285 ----
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
dnl First look for a shared library.
! if test -n "$acl_shlibext"; then
if test -f "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
! if test "$acl_library_names_spec" =
'$libname$shrext$versuffix'; then
ver=`(cd "$dir" && \
for f in "$libname$shrext".*; do echo "$f";
done \
| sed -e "s,^$libname$shrext\\\\.,," \
***************
*** 286,292 ****
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"
--- 290,296 ----
found_so="$dir/$libname$shrext.$ver"
fi
else
! eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
if test -f "$dir/$f"; then
found_dir="$dir"
***************
*** 299,307 ****
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
--- 303,311 ----
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
! if test -f "$dir/$libname.$acl_libext"; then
found_dir="$dir"
! found_a="$dir/$libname.$acl_libext"
fi
fi
if test "X$found_dir" != "X"; then
***************
*** 342,353 ****
ltrpathdirs="$ltrpathdirs $found_dir"
fi
dnl The hardcoding into $LIBNAME is system dependent.
! if test "$hardcode_direct" = yes; then
dnl Using DIR/libNAME.so during linking hardcodes DIR into
the
dnl resulting binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
! if test -n "$hardcode_libdir_flag_spec" && test
"$hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode DIR into the
resulting
dnl binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
--- 346,357 ----
ltrpathdirs="$ltrpathdirs $found_dir"
fi
dnl The hardcoding into $LIBNAME is system dependent.
! if test "$acl_hardcode_direct" = yes; then
dnl Using DIR/libNAME.so during linking hardcodes DIR into
the
dnl resulting binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
! if test -n "$acl_hardcode_libdir_flag_spec" && test
"$acl_hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode DIR into the
resulting
dnl binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
***************
*** 378,390 ****
if test -z "$haveit"; then
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
fi
! if test "$hardcode_minus_L" != no; then
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
! dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to
the
dnl compiler. So give up. No hardcoding. This affects
only
dnl very old systems.
--- 382,394 ----
if test -z "$haveit"; then
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
fi
! if test "$acl_hardcode_minus_L" != no; then
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
! dnl We cannot use $acl_hardcode_runpath_var and
LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to
the
dnl compiler. So give up. No hardcoding. This affects
only
dnl very old systems.
***************
*** 573,590 ****
done
done
if test "X$rpathdirs" != "X"; then
! if test -n "$hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user must
dnl pass all path elements in one option. We can arrange that for a
dnl single library, but not when more than one $LIBNAMEs are used.
alldirs=
for found_dir in $rpathdirs; do
! alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
done
! dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
acl_save_libdir="$libdir"
libdir="$alldirs"
! eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
--- 577,594 ----
done
done
if test "X$rpathdirs" != "X"; then
! if test -n "$acl_hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user must
dnl pass all path elements in one option. We can arrange that for a
dnl single library, but not when more than one $LIBNAMEs are used.
alldirs=
for found_dir in $rpathdirs; do
!
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
done
! dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
acl_save_libdir="$libdir"
libdir="$alldirs"
! eval flag=\"$acl_hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
***************
*** 592,598 ****
for found_dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$found_dir"
! eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
--- 596,602 ----
for found_dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$found_dir"
! eval flag=\"$acl_hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
***************
*** 641,647 ****
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
$1=
if test "$enable_rpath" != no; then
! if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no;
then
dnl Use an explicit option to hardcode directories into the resulting
dnl binary.
rpathdirs=
--- 645,651 ----
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
$1=
if test "$enable_rpath" != no; then
! if test -n "$acl_hardcode_libdir_flag_spec" && test
"$acl_hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode directories into the resulting
dnl binary.
rpathdirs=
***************
*** 675,690 ****
done
else
dnl The linker is used for linking directly.
! if test -n "$hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user
dnl must pass all path elements in one option.
alldirs=
for dir in $rpathdirs; do
! alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
done
acl_save_libdir="$libdir"
libdir="$alldirs"
! eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
$1="$flag"
else
--- 679,694 ----
done
else
dnl The linker is used for linking directly.
! if test -n "$acl_hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user
dnl must pass all path elements in one option.
alldirs=
for dir in $rpathdirs; do
!
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
done
acl_save_libdir="$libdir"
libdir="$alldirs"
! eval flag=\"$acl_hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
$1="$flag"
else
***************
*** 692,698 ****
for dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$dir"
! eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
$1="${$1}${$1:+ }$flag"
done
--- 696,702 ----
for dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$dir"
! eval flag=\"$acl_hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
$1="${$1}${$1:+ }$flag"
done