subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1373878 - /subversion/trunk/build/ac-macros/sqlite.m4
Date Thu, 16 Aug 2012 15:15:43 GMT
Author: brane
Date: Thu Aug 16 15:15:42 2012
New Revision: 1373878

URL: http://svn.apache.org/viewvc?rev=1373878&view=rev
Log:
Be a bit more careful about which additional libraries we link with when
building with amalgamated SQLite.

* build/ac-macros/sqlite.m4 (_SVN_SQLITE_DSO_LIBS): New. Check which additionsl
  libraries we have to link in order to support DSO loading.
  (SVN_SQLITE_FILE_CONFIG): Use the result of _SVN_SQLITE_DSO_LIBS instead
  of always linking with -ldl, which fails (at least) on FreeBSD.

Modified:
    subversion/trunk/build/ac-macros/sqlite.m4

Modified: subversion/trunk/build/ac-macros/sqlite.m4
URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/sqlite.m4?rev=1373878&r1=1373877&r2=1373878&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/sqlite.m4 (original)
+++ subversion/trunk/build/ac-macros/sqlite.m4 Thu Aug 16 15:15:42 2012
@@ -189,10 +189,15 @@ AC_DEFUN(SVN_SQLITE_FILE_CONFIG,
 SQLITE_VERSION_OKAY
 #endif],
                  [AC_MSG_RESULT([amalgamation found and is okay])
+                  _SVN_SQLITE_DSO_LIBS
                   AC_DEFINE(SVN_SQLITE_INLINE, 1,
                   [Defined if svn should use the amalgamated version of sqlite])
                   SVN_SQLITE_INCLUDES="-I`dirname $sqlite_amalg`"
-                  SVN_SQLITE_LIBS="-ldl -lpthread"
+                  if test -n "$svn_sqlite_dso_ldflags"; then
+                    SVN_SQLITE_LIBS="$svn_sqlite_dso_ldflags -lpthread"
+                  else
+                    SVN_SQLITE_LIBS="-lpthread"
+                  fi
                   svn_lib_sqlite="yes"],
                  [AC_MSG_RESULT([unsupported amalgamation SQLite version])])
   fi
@@ -244,3 +249,50 @@ AC_DEFUN(SVN_DOWNLOAD_SQLITE,
   echo ""
   AC_MSG_ERROR([Subversion requires SQLite])
 ])
+
+dnl _SVN_SQLITE_DSO_LIBS() dnl Find additional libraries that the
+dnl sqlite amalgamation code should link in order to load
+dnl shared libraries.  Copied from build/libtool.m4
+AC_DEFUN(_SVN_SQLITE_DSO_LIBS,
+[
+  case $host_os in
+  beos* | mingw* | pw32* | cegcc* | cygwin*)
+    svn_sqlite_dso_ldflags=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+                [lt_cv_dlopen="dlopen" svn_sqlite_dso_ldflags="-ldl"],[
+    svn_sqlite_dso_ldflags=
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+          [svn_sqlite_dso_ldflags=],
+      [AC_CHECK_LIB([dld], [shl_load],
+            [svn_sqlite_dso_ldflags="-ldld"],
+        [AC_CHECK_FUNC([dlopen],
+              [svn_sqlite_dso_ldflags=],
+          [AC_CHECK_LIB([dl], [dlopen],
+                [svn_sqlite_dso_ldflags="-ldl"],
+            [AC_CHECK_LIB([svld], [dlopen],
+                  [svn_sqlite_dso_ldflags="-lsvld"],
+              [AC_CHECK_LIB([dld], [dld_link],
+                    [svn_sqlite_dso_ldflags="-ldld"])
+              ])
+            ])
+          ])
+        ])
+      ])
+    ;;
+  esac
+
+  AC_MSG_CHECKING([additional libraries for sqlite])
+  if test -n "$svn_sqlite_dso_ldflags"; then
+    AC_MSG_RESULT(${svn_sqlite_dso_ldflags})
+  else
+    AC_MSG_RESULT(none)
+  fi
+])



Mime
View raw message