[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for NetBSD linking paths (-base)
From: |
Andrew Ruder |
Subject: |
Patch for NetBSD linking paths (-base) |
Date: |
Sat, 3 Dec 2005 19:06:12 -0600 |
User-agent: |
Mutt/1.5.9i |
Hey all,
Attached is a patch that when adding paths to LDFLAGS and LDIR_FLAGS, it
will do
-L/path
on most platforms, and on netbsd do:
-Wl,-R/path -L/path
for all the --with-*-library configure options.
Please apply to -base if it looks OK.
Thanks,
Andrew Ruder
Changelog:
2005-12-03 Andrew Ruder <address@hidden>
* configure.ac: Automatically add -Wl,-R/path when using
--with-*-library on NetBSD.
* config/add_library_path.m4: Macro to add the ld paths
correctly on different platforms
* configure: Regenerated
--
Andrew Ruder
http://www.aeruder.net
diff -rNu base/config/addlibrarypath.m4 base-working/config/addlibrarypath.m4
--- base/config/addlibrarypath.m4 1969-12-31 18:00:00.000000000 -0600
+++ base-working/config/addlibrarypath.m4 2005-12-03 19:55:27.000000000
-0600
@@ -0,0 +1,20 @@
+dnl librarypath macros
+dnl Copyright (C) 2005 Free Software Foundation
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+dnl
+dnl Written by Andrew Ruder
+dnl GS_ADD_LIBRARY_PATH
+dnl Adds -L$1 -Wl,-R$1 on netbsd and -L$1 elsewhere to LDFLAGS and LDIR_FLAGS
+AC_DEFUN([GS_ADD_LIBRARY_PATH], [
+case "$target_os" in
+ netbsd*)
+ LDFLAGS="$LDFLAGS -L$1 -Wl,-R$1"
+ LDIR_FLAGS="$LDIR_FLAGS -Wl-R$1 -L$1";;
+ *)
+ LDFLAGS="$LDFLAGS -L$1"
+ LDIR_FLAGS="$LDIR_FLAGS -L$1";;
+esac
+])
+
diff -rNu base/configure base-working/configure
--- base/configure 2005-12-03 19:00:02.000000000 -0600
+++ base-working/configure 2005-12-03 19:57:03.000000000 -0600
@@ -13865,8 +13865,16 @@
ffi_libdir="no"
fi;
if test ${ffi_libdir} != "no"; then
- LDFLAGS="$LDFLAGS -L${ffi_libdir}"
- LDIR_FLAGS="$LDIR_FLAGS -L${ffi_libdir}"
+
+case "$target_os" in
+ netbsd*)
+ LDFLAGS="$LDFLAGS -L${ffi_libdir} -Wl,-R${ffi_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${ffi_libdir} -Wl-R${ffi_libdir}";;
+ *)
+ LDFLAGS="$LDFLAGS -L${ffi_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${ffi_libdir}";;
+esac
+
fi
if test "${ac_cv_header_ffi_h+set}" = set; then
@@ -14447,8 +14455,16 @@
fi;
if test "$libiconv_libdir" != "no"; then
- LDFLAGS="$LDFLAGS -L$libiconv_libdir"
- LDIR_FLAGS="$LDIR_FLAGS -L$libiconv_libdir"
+
+case "$target_os" in
+ netbsd*)
+ LDFLAGS="$LDFLAGS -L${libiconv_libdir} -Wl,-R${libiconv_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${libiconv_libdir}
-Wl-R${libiconv_libdir}";;
+ *)
+ LDFLAGS="$LDFLAGS -L${libiconv_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${libiconv_libdir}";;
+esac
+
fi
old_LIBS="$LIBS"
@@ -15405,8 +15421,16 @@
INCLUDE_FLAGS="$INCLUDE_FLAGS -I$gmp_incdir"
fi
if test "$gmp_libdir" != "no"; then
- LDFLAGS="$LDFLAGS -L$gmp_libdir"
- LDIR_FLAGS="$LDIR_FLAGS -L$gmp_libdir"
+
+case "$target_os" in
+ netbsd*)
+ LDFLAGS="$LDFLAGS -L${gmp_libdir} -Wl,-R${gmp_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${gmp_libdir} -Wl-R${gmp_libdir}";;
+ *)
+ LDFLAGS="$LDFLAGS -L${gmp_libdir}"
+ LDIR_FLAGS="$LDIR_FLAGS -L${gmp_libdir}";;
+esac
+
fi
USE_GMP=0
diff -rNu base/configure.ac base-working/configure.ac
--- base/configure.ac 2005-12-03 19:00:02.000000000 -0600
+++ base-working/configure.ac 2005-12-03 19:56:58.000000000 -0600
@@ -27,6 +27,7 @@
builtin(include, config/procfs.m4)dnl
builtin(include, config/pathxml.m4)dnl
builtin(include, config/codeset.m4)dnl
+builtin(include, config/addlibrarypath.m4)dnl
AC_INIT
AC_CONFIG_SRCDIR([Source/NSArray.m])
@@ -1126,8 +1127,7 @@
[ --with-ffi-library=PATH library path for ffi (ffcall/libffi) libraries],
ffi_libdir="$withval", ffi_libdir="no")
if test ${ffi_libdir} != "no"; then
- LDFLAGS="$LDFLAGS -L${ffi_libdir}"
- LDIR_FLAGS="$LDIR_FLAGS -L${ffi_libdir}"
+GS_ADD_LIBRARY_PATH([${ffi_libdir}])
fi
AC_CHECK_HEADER(ffi.h, have_libffi=yes, have_libffi=no)
@@ -1242,8 +1242,7 @@
libiconv_libdir="$withval", libiconv_libdir="no")
if test "$libiconv_libdir" != "no"; then
- LDFLAGS="$LDFLAGS -L$libiconv_libdir"
- LDIR_FLAGS="$LDIR_FLAGS -L$libiconv_libdir"
+ GS_ADD_LIBRARY_PATH([${libiconv_libdir}])
fi
old_LIBS="$LIBS"
@@ -1367,8 +1366,7 @@
INCLUDE_FLAGS="$INCLUDE_FLAGS -I$gmp_incdir"
fi
if test "$gmp_libdir" != "no"; then
- LDFLAGS="$LDFLAGS -L$gmp_libdir"
- LDIR_FLAGS="$LDIR_FLAGS -L$gmp_libdir"
+ GS_ADD_LIBRARY_PATH([${gmp_libdir}])
fi
USE_GMP=0
- Patch for NetBSD linking paths (-base),
Andrew Ruder <=