lib: Use gpfs.h from third_party on Linux
authorChristof Schmitt <cs@samba.org>
Tue, 19 Dec 2017 22:13:50 +0000 (15:13 -0700)
committerVolker Lendecke <vl@samba.org>
Fri, 18 Jan 2019 16:21:02 +0000 (17:21 +0100)
Update the logic for finding the gpfs.h header file: Look for the header
file in the default location under /usr/lpp/mmfs/include. If it is not
available there, default to the file in third_party/gpfs/ on Linux (AIX
could be added if there is demand).

The configure option --with-gpfs=GPFS_HEADERS_DIR can always be used to
overwrite the default behavior with a specific location.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 18 17:21:02 CET 2019 on sn-devel-144

lib/util/wscript
lib/util/wscript_configure

index d61b11e9e3736941560b846309e76e6fcd2e2725..6f711adcd0c7499557b1845528392367e0362d53 100644 (file)
@@ -20,4 +20,4 @@ def options(opt):
 
     opt.add_option('--with-gpfs',
                    help=("Directory under which gpfs headers are installed"),
-                   action="store", dest='gpfs_headers_dir', default="/usr/lpp/mmfs/include/")
+                   action="store", dest='gpfs_headers_dir')
index b06f1c1407435e0bfac3f72067460ab2e8f363be..93853511575636c70f46fcccaf8cbc1c468bd2e4 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
-from waflib import Options
+from waflib import Logs, Options
+
+import os, sys
 
 if Options.options.disable_fault_handling:
     conf.DEFINE('HAVE_DISABLE_FAULT_HANDLING',1)
@@ -136,6 +138,19 @@ if (conf.CONFIG_SET('HAVE_LTTNG_TRACEF_H') and
     conf.DEFINE('HAVE_LTTNG_TRACEF', '1')
     conf.env['HAVE_LTTNG_TRACEF'] = True
 
-conf.env['CPPPATH_GPFS'] = Options.options.gpfs_headers_dir
-if conf.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):
-    conf.DEFINE('HAVE_GPFS', '1')
+if Options.options.gpfs_headers_dir:
+    conf.env['CPPPATH_GPFS'] = Options.options.gpfs_headers_dir
+    if conf.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):
+        Logs.info('Using gpfs.h from %s' % Options.options.gpfs_headers_dir)
+        conf.DEFINE('HAVE_GPFS', '1')
+else:
+    conf.env['CPPPATH_GPFS'] = "/usr/lpp/mmfs/include/"
+    if conf.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):
+        Logs.info('Using gpfs.h from installed gpfs package.')
+        conf.DEFINE('HAVE_GPFS', '1')
+    else:
+        if sys.platform=="linux":
+            conf.env['CPPPATH_GPFS'] = os.path.abspath("third_party/gpfs")
+            if conf.CHECK_HEADERS('gpfs.h', False, False, "gpfs"):
+                Logs.info('Using gpfs.h from third_party directory.')
+                conf.DEFINE('HAVE_GPFS', '1')