wafsamba: check for rpath compiler/linker flags
authorRalph Boehme <slow@samba.org>
Thu, 18 Dec 2014 05:37:28 +0000 (06:37 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 19 Dec 2014 12:15:12 +0000 (13:15 +0100)
Older SunOS linker only support -Wl,-R,/path instead of -Wl,-rpath,/path.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/wscript

index 1a2cfe661f8e847ee301244e16f8f4ae6f48ccbd..1a30d2fa9366ab00b09182de6aa9884f245ff6e6 100755 (executable)
@@ -295,6 +295,10 @@ def configure(conf):
                     headers='stdio.h',
                     msg='Checking simple C program')
 
+    # check which compiler/linker flags are needed for rpath support
+    if not conf.CHECK_LDFLAGS(['-Wl,-rpath,.']) and conf.CHECK_LDFLAGS(['-Wl,-R,.']):
+        conf.env['RPATH_ST'] = '-Wl,-R,%s'
+
     # check for rpath
     if conf.CHECK_LIBRARY_SUPPORT(rpath=True):
         support_rpath = True