mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
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>
This commit is contained in:
parent
4f58041639
commit
2afacf940f
@ -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')
|
||||
'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 conf.CONFIG_SET('USE_DMAPI'):
|
||||
conf.env['dmapi_lib'] = samba_dmapi_lib
|
||||
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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user