summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-11-19 11:34:26 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:45 +0100
commitc5e16f339cd5d29aa86b5d6158ec384c7e687915 (patch)
tree8404f2dd2e4ee1e93478f26f8c278f6c2ed28223 /source4
parent662cda2138872d7a6b72278cb9561e64ee35fbdc (diff)
downloadsamba-c5e16f339cd5d29aa86b5d6158ec384c7e687915.tar.gz
samba-c5e16f339cd5d29aa86b5d6158ec384c7e687915.tar.bz2
samba-c5e16f339cd5d29aa86b5d6158ec384c7e687915.zip
r26026: libreplace: split some linker macros
create: AC_LIBREPLACE_LD_SHLIB_LINKER AC_LIBREPLACE_LD_SHLIB_FLAGS AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG and prerequire them for: AC_LIBREPLACE_SHLD AC_LIBREPLACE_SHLD_FLAGS AC_LIBREPLACE_MDLD AC_LIBREPLACE_MDLD_FLAGS metze (This used to be commit cc8692265d6e9161679a779480d6b22dee23f8bb)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/replace/libreplace_ld.m479
1 files changed, 58 insertions, 21 deletions
diff --git a/source4/lib/replace/libreplace_ld.m4 b/source4/lib/replace/libreplace_ld.m4
index e98885445d..f156fa8e9f 100644
--- a/source4/lib/replace/libreplace_ld.m4
+++ b/source4/lib/replace/libreplace_ld.m4
@@ -93,59 +93,96 @@ esac
AC_SUBST(PICFLAG)
])
-AC_DEFUN([AC_LIBREPLACE_SHLD],
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_LINKER],
[
- SHLD="${CC}"
+ LD_SHLIB_LINKER="${CC}"
case "$host_os" in
*irix*)
- SHLD="${PROG_LD}"
+ LD_SHLIB_LINKER="${PROG_LD}"
;;
esac
- AC_SUBST(SHLD)
+ AC_SUBST(LD_SHLIB_LINKER)
])
-AC_DEFUN([AC_LIBREPLACE_SHLD_FLAGS],
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_FLAGS],
[
- SHLD_FLAGS="-shared"
+ LD_SHLIB_FLAGS="-shared"
case "$host_os" in
*linux*)
- SHLD_FLAGS="-shared -Wl,-Bsymbolic"
+ LD_SHLIB_FLAGS="-shared -Wl,-Bsymbolic"
;;
*solaris*)
- SHLD_FLAGS="-G"
+ LD_SHLIB_FLAGS="-G"
if test "${GCC}" = "no"; then
## ${CFLAGS} added for building 64-bit shared
## libs using Sun's Compiler
- SHLD_FLAGS="-G \${CFLAGS}"
+ LD_SHLIB_FLAGS="-G \${CFLAGS}"
fi
;;
*sunos*)
- SHLD_FLAGS="-G"
+ LD_SHLIB_FLAGS="-G"
;;
*irix*)
- SHLD_FLAGS="-shared"
+ LD_SHLIB_FLAGS="-shared"
;;
*aix*)
- SHLD_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
+ LD_SHLIB_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
;;
*hpux*)
if test "${GCC}" = "yes"; then
- SHLD_FLAGS="-shared"
+ LD_SHLIB_FLAGS="-shared"
else
- SHLD_FLAGS="-b"
+ LD_SHLIB_FLAGS="-b"
fi
;;
*osf*)
- SHLD_FLAGS="-shared -warning_unresolved"
+ LD_SHLIB_FLAGS="-shared"
;;
*darwin*)
- SHLD_FLAGS="-bundle -flat_namespace -undefined warning -Wl,-search_paths_first"
+ LD_SHLIB_FLAGS="-bundle -flat_namespace -Wl,-search_paths_first"
;;
esac
+ AC_SUBST(LD_SHLIB_FLAGS)
+])
+
+AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG],
+[
+ LD_SHLIB_DISALLOW_UNDEF_FLAG=""
+
+ #
+ # TODO: enforce error not only warnings
+ #
+ # NOTE: -Wl,--no-allow-shlib-undefined isn't what we want...
+ # as it bails out on broken system libraries
+ #
+ case "$host_os" in
+ *osf*)
+ LD_SHLIB_DISALLOW_UNDEF_FLAG="-warning_unresolved"
+ ;;
+ *darwin*)
+ LD_SHLIB_DISALLOW_UNDEF_FLAG="-undefined warning"
+ ;;
+ esac
+
+ AC_SUBST(LD_SHLIB_DISALLOW_UNDEF_FLAG)
+])
+
+AC_DEFUN([AC_LIBREPLACE_SHLD],
+[
+ AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
+ SHLD="$LD_SHLIB_LINKER"
+ AC_SUBST(SHLD)
+])
+
+AC_DEFUN([AC_LIBREPLACE_SHLD_FLAGS],
+[
+ AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
+ AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG])
+ SHLD_FLAGS="$LD_SHLIB_FLAGS $LD_SHLIB_DISALLOW_UNDEF_FLAG"
AC_SUBST(SHLD_FLAGS)
])
@@ -214,8 +251,8 @@ AC_DEFUN([AC_LD_SONAMEFLAG],
AC_DEFUN([AC_LIBREPLACE_MDLD],
[
- AC_LIBREPLACE_SHLD()
- MDLD=$SHLD
+ AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
+ MDLD="$LD_SHLIB_LINKER"
AC_SUBST(MDLD)
])
@@ -240,9 +277,9 @@ AC_DEFUN([AC_LIBREPLACE_LD_ALLOW_SHLIB_UNDEF_FLAG],
AC_DEFUN([AC_LIBREPLACE_MDLD_FLAGS],
[
- AC_LIBREPLACE_SHLD_FLAGS()
- AC_LIBREPLACE_LD_ALLOW_SHLIB_UNDEF_FLAG()
- MDLD_FLAGS="$SHLD_FLAGS $LD_ALLOW_SHLIB_UNDEF_FLAG"
+ AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
+ AC_REQUIRE([AC_LIBREPLACE_LD_ALLOW_SHLIB_UNDEF_FLAG])
+ MDLD_FLAGS="$LD_SHLIB_FLAGS $LD_ALLOW_SHLIB_UNDEF_FLAG"
AC_SUBST(MDLD_FLAGS)
])