summaryrefslogtreecommitdiffstats
path: root/source3/wscript
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-08-18 11:42:27 +0200
committerMichael Adam <obnox@samba.org>2014-08-18 15:20:11 +0200
commit2afacf940f21759c08bcc4a6e906428595966a19 (patch)
treefbc1e89dc2649df99657df6a4812914a5e807695 /source3/wscript
parent4f58041639168caee379f8f5b936a30f1a71f0a6 (diff)
downloadsamba-2afacf940f21759c08bcc4a6e906428595966a19.tar.gz
samba-2afacf940f21759c08bcc4a6e906428595966a19.tar.xz
samba-2afacf940f21759c08bcc4a6e906428595966a19.zip
build: fix configure to honour --without-dmapi
Previously, --without-dmapi would still autodetect and link a useable dmapi library. This change allows to build without dmapi support even when a dmapi library is found. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10369 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/wscript')
-rw-r--r--source3/wscript72
1 files changed, 44 insertions, 28 deletions
diff --git a/source3/wscript b/source3/wscript
index 18c3c7d1b2..bcf14f81df 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -206,27 +206,32 @@ main() {
conf.fatal('libarchive support requested, but no suitable pkgconfig found')
# check for DMAPI libs
- Logs.info("Checking for DMAPI library existence")
- conf.env['dmapi_lib'] = ''
- samba_dmapi_lib = ''
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dm'):
- samba_dmapi_lib = 'dm'
+ if Options.options.with_dmapi == False:
+ have_dmapi = False
else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'jfsdm'):
- samba_dmapi_lib = 'jfsdm'
+ have_dmapi = True
+ Logs.info("Checking for DMAPI library existence")
+ samba_dmapi_lib = ''
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dm'):
+ samba_dmapi_lib = 'dm'
else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dmapi'):
- samba_dmapi_lib = 'dmapi'
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'jfsdm'):
+ samba_dmapi_lib = 'jfsdm'
else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'xdsm'):
- samba_dmapi_lib = 'xdsm'
- # only bother to test headers and compilation when a candidate
- # library has been found
- if Options.options.with_dmapi == True and samba_dmapi_lib == '':
- conf.fatal('DMAPI support requested, but no suitable DMAPI library found')
- else:
- conf.CHECK_HEADERS('sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h dmapi.h')
- conf.CHECK_CODE('''
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dmapi'):
+ samba_dmapi_lib = 'dmapi'
+ else:
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'xdsm'):
+ samba_dmapi_lib = 'xdsm'
+ # only bother to test headers and compilation when a candidate
+ # library has been found
+ if samba_dmapi_lib == '':
+ have_dmapi = False
+ broken_dmapi = "no suitable DMAPI library found"
+
+ if have_dmapi:
+ conf.CHECK_HEADERS('sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h dmapi.h')
+ conf.CHECK_CODE('''
#include <time.h> /* needed by Tru64 */
#include <sys/types.h> /* needed by AIX */
#ifdef HAVE_XFS_DMAPI_H
@@ -256,17 +261,28 @@ int main(int argc, char **argv)
return 0;
}
''',
- 'USE_DMAPI',
- addmain=False,
- execute=False,
- lib=samba_dmapi_lib,
- msg='Checking whether DMAPI lib '+samba_dmapi_lib+' can be used')
-
- if conf.CONFIG_SET('USE_DMAPI'):
- conf.env['dmapi_lib'] = samba_dmapi_lib
+ 'USEABLE_DMAPI_LIBRARY',
+ addmain=False,
+ execute=False,
+ lib=samba_dmapi_lib,
+ msg='Checking whether DMAPI lib '+samba_dmapi_lib+' can be used')
+ if not conf.CONFIG_SET('USEABLE_DMAPI_LIBRARY'):
+ have_dmapi = False
+ broken_dmapi = "no usable DMAPI library found"
+
+ if have_dmapi:
+ Logs.info("Building with DMAPI support.")
+ conf.env['dmapi_lib'] = samba_dmapi_lib
+ conf.DEFINE('USE_DMAPI', 1)
+ else:
+ if Options.options.with_dmapi == False:
+ Logs.info("Building without DMAPI support (--without-dmapi).")
+ elif Options.options.with_dmapi == True:
+ Logs.error("DMAPI support not available: " + broken_dmapi)
+ conf.fatal('DMAPI support requested but not found.');
else:
- if Options.options.with_dmapi == True:
- conf.fatal('DMAPI support requested but not found');
+ Logs.warn("Building without DMAPI support: " + broken_dmapi)
+ conf.env['dmapi_lib'] = ''
# Check for various members of the stat structure
conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_blocks', define='HAVE_STAT_ST_BLOCKS',