r25852: Move SHLIBEXT determination into a test as well.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 6 Nov 2007 01:35:46 +0000 (02:35 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:44:27 +0000 (05:44 +0100)
source/build/m4/check_ld.m4
source/lib/ldb/configure.ac
source/lib/replace/libreplace_ld.m4

index 77c22bcfd615f17c41d569c17a8c12a6a32b0fb1..460cb15621ba3b780ac8babad2122fca3486958c 100644 (file)
@@ -18,11 +18,8 @@ AC_SUBST(BLDSHARED)
 AC_SUBST(LD)
 AC_SUBST(LDFLAGS)
 AC_SUBST(SHLD)
-AC_SUBST(SHLD_FLAGS)
 AC_SUBST(SHLD_UNDEF_FLAGS)
-AC_SUBST(SHLIBEXT)
 AC_SUBST(SONAMEFLAG)
-AC_SUBST(PICFLAG)
 
 # Assume non-shared by default and override below
 # these are the defaults, good for lots of systems
@@ -31,7 +28,6 @@ STLD_FLAGS="-rcs"
 BLDSHARED="false"
 LD="${CC}"
 SHLD="${CC}"
-SHLIBEXT="so"
 SONAMEFLAG=""
 PICFLAG=""
 
@@ -101,10 +97,8 @@ case "$host_os" in
                        BLDSHARED="true" # I hope this is correct
                fi
                if test "$host_cpu" = "ia64"; then
-                       SHLIBEXT="so"
                        LDFLAGS="$LDFLAGS -Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32"
                else
-                       SHLIBEXT="sl"
                        LDFLAGS="$LDFLAGS -Wl,-E,+b/usr/local/lib:/usr/lib"
                fi
                ;;
@@ -119,7 +113,6 @@ case "$host_os" in
                ;;
        *darwin*)
                BLDSHARED="true"
-               SHLIBEXT="dylib"
                ;;
 esac
 
@@ -140,6 +133,7 @@ AC_MSG_RESULT([$STLD_FLAGS])
 AC_LD_PICFLAG
 AC_LD_EXPORT_DYNAMIC
 AC_LD_SHLDFLAGS
+AC_LD_SHLIBEXT
 
 AC_ARG_ENABLE(shared,
 [  --disable-shared        Disable testing for building shared libraries],
index ffa3f4f7502132a71bf63ca561a94e52fc814678..d6f6a4996ec120180fc2c920f4e78eab54267bbf 100644 (file)
@@ -38,9 +38,6 @@ AC_CHECK_HEADERS(stdint.h dlfcn.h)
 AC_CONFIG_HEADER(include/config.h)
 AC_SEARCH_LIBS(dlopen, dl, AC_DEFINE(HAVE_DLOPEN, [1], [have dlopen]))
 
-SHLIBEXT="so" # Should be set based on OS later on
-AC_SUBST(SHLIBEXT)
-
 AC_DEFINE_UNQUOTED(LDB_MODULESDIR, LIBDIR "/ldb" , [Modules directory] )
 AC_SUBST(LDB_MODULESDIR)
 
@@ -74,6 +71,7 @@ AC_SUBST(EXTRA_OBJ)
 AC_LD_EXPORT_DYNAMIC
 AC_LD_PICFLAG
 AC_LD_SHLDFLAGS
+AC_LD_SHLIBEXT
 
 m4_include(libldb.m4)
 AC_OUTPUT(Makefile ldb.pc)
index 07dd2db231786cc290ba8d058ead7fc834d19a4a..7f85fb4ccc6d585e134f3cf4fc2e9895be94b93c 100644 (file)
@@ -101,3 +101,21 @@ AC_DEFUN([AC_LD_SHLDFLAGS],
 
        AC_SUBST(SHLD_FLAGS)
 ])
+
+AC_DEFUN([AC_LD_SHLIBEXT],
+[
+       SHLIBEXT="so"
+       case "$host_os" in
+               *hpux*)
+                       if test "$host_cpu" = "ia64"; then
+                               SHLIBEXT="so"
+                       else
+                               SHLIBEXT="sl"
+                       fi
+               ;;
+               *darwin*)
+                       SHLIBEXT="dylib"
+               ;;
+       esac
+       AC_SUBST(SHLIBEXT)
+])