aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--src/config.inc.in1
-rw-r--r--src/lib/pcre/pcre.pas5
3 files changed, 13 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f61c91d3..a61048f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,6 +263,16 @@ AC_SUBST_DEFINE(HAVE_LIBPCRE, $libpcre_HAVE)
# get libpcre library dir
PKG_VALUE([libpcre], [LIBDIR], [variable=libdir], [$libpcre_PKG],
[library dir (e.g. /usr/lib, /sw/lib, ...)])
+# we need the soname of the pcre library
+if test x"$libpcre_HAVE" = xyes; then
+ old_LIBS="$LIBS"
+ LIBS="-lpcre"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [libpcre_LIBNAME=`objdump -p "conftest$EXEEXT" | grep pcre | awk '{print $2}'` dnl '
+ AC_SUBST([libpcre_LIBNAME],[$libpcre_LIBNAME])],
+ [AC_MSG_ERROR([failed to link])])
+ LIBS="$old_LIBS"
+fi
# find portmixer
PKG_HAVE([portmixer], [portmixer], no)
diff --git a/src/config.inc.in b/src/config.inc.in
index 967612a4..232ba615 100644
--- a/src/config.inc.in
+++ b/src/config.inc.in
@@ -71,6 +71,7 @@
{$@DEFINE_HAVE_LIBPCRE@ HaveLibPcre}
{$IF Defined(HaveLibPcre) and Defined(IncludeConstants)}
+ LIBPCRE_LIBNAME = '@libpcre_LIBNAME@';
LIBPCRE_LIBDIR = '@libpcre_LIBDIR@';
{$IFEND}
diff --git a/src/lib/pcre/pcre.pas b/src/lib/pcre/pcre.pas
index ab04a9d0..d328f4cf 100644
--- a/src/lib/pcre/pcre.pas
+++ b/src/lib/pcre/pcre.pas
@@ -503,9 +503,7 @@ implementation
uses
SysUtils,
- {$IFDEF DARWIN}
UConfig,
- {$ENDIF DARWIN}
{$IFDEF MSWINDOWS}
Windows;
{$ENDIF MSWINDOWS}
@@ -536,7 +534,8 @@ const
libpcremodulename = 'pcre3.dll';
{$ENDIF MSWINDOWS}
{$IFDEF LINUX}
- libpcremodulename = 'libpcre.so.0';
+ // "libpcre.so.<soname>", soname is different on platforms
+ libpcremodulename = LIBPCRE_LIBNAME;
{$ENDIF LINUX}
{$IFDEF DARWIN}
libpcremodulename = 'libpcre.dylib'; // this is a symlink for example to libpcre.0.0.1.dylib