aboutsummaryrefslogtreecommitdiffstats
path: root/us_maker_edition/src/lib/pcre
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-15 21:28:52 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-15 21:28:52 +0000
commit115255f6a3c2be422680710b5d6ba4226c3383a6 (patch)
tree3bbe81786e12808220efa589adb799e0412d20a2 /us_maker_edition/src/lib/pcre
parentcf141f470e4cb45b8c886e1536846a8254cdd302 (diff)
downloadusdx-115255f6a3c2be422680710b5d6ba4226c3383a6.tar.gz
usdx-115255f6a3c2be422680710b5d6ba4226c3383a6.tar.xz
usdx-115255f6a3c2be422680710b5d6ba4226c3383a6.zip
merged trunk r2528 into us_maker branch
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2530 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'us_maker_edition/src/lib/pcre')
-rw-r--r--us_maker_edition/src/lib/pcre/pcre.pas17
1 files changed, 16 insertions, 1 deletions
diff --git a/us_maker_edition/src/lib/pcre/pcre.pas b/us_maker_edition/src/lib/pcre/pcre.pas
index 50e3371a..ab04a9d0 100644
--- a/us_maker_edition/src/lib/pcre/pcre.pas
+++ b/us_maker_edition/src/lib/pcre/pcre.pas
@@ -503,6 +503,9 @@ implementation
uses
SysUtils,
+ {$IFDEF DARWIN}
+ UConfig,
+ {$ENDIF DARWIN}
{$IFDEF MSWINDOWS}
Windows;
{$ENDIF MSWINDOWS}
@@ -536,7 +539,11 @@ const
libpcremodulename = 'libpcre.so.0';
{$ENDIF LINUX}
{$IFDEF DARWIN}
- libpcremodulename = 'libpcre.dylib';
+ libpcremodulename = 'libpcre.dylib'; // this is a symlink for example to libpcre.0.0.1.dylib
+ // the system resolves the symlink
+ libpcremodulenamefromfink = LIBPCRE_LIBDIR + '/' + libpcremodulename;
+ // the install command in the Makefile resolves the symlink, when installing libpcre.dylib in the app bundle
+ libpcremodulenamefromexecutable = '@executable_path/' + libpcremodulename;
{$ENDIF DARWIN}
PCRECompileExportName = 'pcre_compile';
PCRECompile2ExportName = 'pcre_compile2';
@@ -780,6 +787,14 @@ begin
{$IFDEF UNIX}
PCRELib := dlopen(PAnsiChar(libpcremodulename), RTLD_NOW);
{$ENDIF UNIX}
+
+ {$IFDEF DARWIN} // if libpcre.dylib is not found, first try from the executable path and finally from the fink path
+ if PCRELib = INVALID_MODULEHANDLE_VALUE then
+ PCRELib := dlopen(PAnsiChar(libpcremodulenamefromexecutable), RTLD_NOW);
+ if PCRELib = INVALID_MODULEHANDLE_VALUE then
+ PCRELib := dlopen(PAnsiChar(libpcremodulenamefromfink), RTLD_NOW);
+ {$ENDIF DARWIN}
+
Result := PCRELib <> INVALID_MODULEHANDLE_VALUE;
if Result then
begin