s3:build: first cut at fixing linking of shared/static libs internally
[ira/wip.git] / source3 / m4 / aclocal.m4
index e2d0ec4b8a2c7febb69978dee9a5f03a7df27284..5a07eddb942c2c4b474d7d355a37ce3b6f6c21d5 100644 (file)
@@ -68,7 +68,8 @@ LIBUC[_SHARED_TARGET]=bin/LIBNAME.$SHLIBEXT
 LIBUC[_STATIC_TARGET]=bin/LIBNAME.a
 LIBUC[_SHARED]=
 LIBUC[_STATIC]=
-LIBUC[_LIBS]=
+LIBUC[_LIBS]=LIBLIBS
+LIBUC[_TARGET]=
 [INSTALL_]LIBUC=
 [UNINSTALL_]LIBUC=
 
@@ -79,6 +80,7 @@ AC_SUBST(LIBUC[_STATIC_TARGET])
 AC_SUBST(LIBUC[_SHARED])
 AC_SUBST(LIBUC[_STATIC])
 AC_SUBST(LIBUC[_LIBS])
+AC_SUBST(LIBUC[_TARGET])
 AC_SUBST([INSTALL_]LIBUC)
 AC_SUBST([UNINSTALL_]LIBUC)
 AC_SUBST(LIBUC[_SOVER])
@@ -137,14 +139,18 @@ if eval test x"$build_lib" = "xyes" ; then
        [UNINSTALL_]LIBUC=[uninstall]LIBNAME
        if eval $BLDSHARED = true; then
                LIBUC[_SHARED]=$LIBUC[_SHARED_TARGET]
+               LIBUC[_TARGET]=$LIBUC[_SHARED_TARGET]
                AC_MSG_RESULT(yes)
                if test x"$USESHARED" != x"true" -o x"$[LINK_]LIBUC" = "xSTATIC" ; then
                        enable_static=yes
+                       LIBUC[_TARGET]=$LIBUC[_STATIC_TARGET]
+                       LIBUC[_LIBS]=$LIBUC[_STATIC_TARGET]
                else
                        LIBUC[_LIBS]=LIBLIBS
                fi
        else
                enable_static=yes
+               LIBUC[_TARGET]=$LIBUC[_STATIC_TARGET]
                AC_MSG_RESULT(no shared library support -- will supply static library)
        fi
 else
@@ -152,7 +158,7 @@ else
        AC_MSG_RESULT(shared library not selected, but will supply static library)
 fi
 if test $enable_static = yes; then
-       LIBUC[_STATIC]=$LIBUC[_STATIC_TARGET]
+       LIBUC[_STATIC]=[\$\(]LIBUC[_OBJ0\)]
 fi
 
 m4_popdef([LIBNAME])
@@ -386,11 +392,17 @@ AC_DEFUN(LIB_REMOVE_USR_LIB,[
     case [$]l[$]i in
     -L/usr/lib) ;;
     -L/usr/lib/) ;;
-    -Wl,-rpath,/usr/lib) ;;
-    -Wl,-rpath,/usr/lib/) ;;
+    -L/usr/lib64) ;;
+    -L/usr/lib64/) ;;
+    -Wl,-rpath,/usr/lib) l="";;
+    -Wl,-rpath,/usr/lib/) l="";;
+    -Wl,-rpath,/usr/lib64) l="";;
+    -Wl,-rpath,/usr/lib64/) l="";;
     -Wl,-rpath) l=[$]i;;
     -Wl,-rpath-Wl,/usr/lib) l="";;
     -Wl,-rpath-Wl,/usr/lib/) l="";;
+    -Wl,-rpath-Wl,/usr/lib64) l="";;
+    -Wl,-rpath-Wl,/usr/lib64/) l="";;
     *)
        s=" "
         if test x"[$]ac_new_flags" = x""; then
@@ -886,4 +898,4 @@ int main(void)
        ])
 ])
 
-m4_include(lib/replace/libreplace.m4)
+m4_include(../lib/replace/libreplace.m4)