labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r744628 - /labs/orthrus/trunk/SConstruct
Date Sun, 15 Feb 2009 08:16:14 GMT
Author: pquerna
Date: Sun Feb 15 08:16:13 2009
New Revision: 744628

URL: http://svn.apache.org/viewvc?rev=744628&view=rev
Log:
Improve linking, so that installed copies should work with both osx's sucky linker, and at
the same time from our working copy.

Modified:
    labs/orthrus/trunk/SConstruct

Modified: labs/orthrus/trunk/SConstruct
URL: http://svn.apache.org/viewvc/labs/orthrus/trunk/SConstruct?rev=744628&r1=744627&r2=744628&view=diff
==============================================================================
--- labs/orthrus/trunk/SConstruct (original)
+++ labs/orthrus/trunk/SConstruct Sun Feb 15 08:16:13 2009
@@ -18,6 +18,7 @@
 EnsureSConsVersion(1, 2, 0)
 
 from os.path import join as pjoin
+
 opts = Variables('build.py')
 
 # TODO: Move these to be gathered from a version header file.
@@ -36,9 +37,6 @@
 env.ParseConfig(env['APRUTIL'] + ' --includes  --ldflags  --libs --link-ld')
 env.AppendUnique(CPPPATH = ["include"])
 
-if env['PLATFORM'] == 'darwin':
-    env.AppendUnique(LINKFLAGS = ['-undefined', 'dynamic_lookup'])
-
 lib = env.SharedLibrary(target='orthrus-%d' % (orthrus_major),
                         source = ['src/core.c', 'src/error.c', 
                                   'src/hex.c', 'src/words.c'])
@@ -47,10 +45,24 @@
 
 appenv = env.Clone()
 appenv.AppendUnique(LIBS=lib)
+if appenv['PLATFORM'] != 'darwin':
+  if 0:
+    # TOOD: Figure out if OS supports origin/relative rpaths
+    appenv.Append(LINKFLAGS = Split('-z origin'))
+    appenv.Append(RPATH = env.Literal(pjoin('\\$$ORIGIN', os.pardir, 'lib')))
+  else:
+    appenv.Append(RPATH = [pjoin(env['PREFIX'], 'lib')])
+
 ortcalc = appenv.Program(target='ortcalc', source = ['src/ui/ortcalc/ortcalc.c'])
 
 install = []
-install.extend(env.Install(pjoin(env['DESTDIR'], env['PREFIX'], 'bin'), ortcalc))
+foo = env.Install(pjoin(env['DESTDIR'], env['PREFIX'], 'bin'), ortcalc)
+if env['PLATFORM'] == 'darwin':
+  env.AddPostAction(foo, 
+    "install_name_tool -change 'liborthrus-%d.dylib' '%s/liborthrus-%d.dylib' %s" % (orthrus_major,

+      pjoin(env['PREFIX'], 'lib'), orthrus_major, foo[0].get_abspath()))
+
+install.extend(foo)
 install.extend(env.Install(pjoin(env['DESTDIR'], env['PREFIX'], 'lib'), lib))
 install.extend(env.Install(pjoin(env['DESTDIR'], env['PREFIX'], 'include', "orthrus-%d" %
(orthrus_major)), headers))
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message