From d72a6ee2277a26c28ba5444204fa4d259fbd1035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 24 Jan 2019 22:39:08 +0100 Subject: [PATCH 1/3] waf/printing: fix up tri-state of cups configure options with auto default cups and iprint should be enabled by default if support is found. The other way round configure now successfully fails if cups/iprint is requested but not found. Signed-off-by: Bjoern Jacke --- source3/wscript | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/source3/wscript b/source3/wscript index 24e52e592c97..f2a071fa7ed5 100644 --- a/source3/wscript +++ b/source3/wscript @@ -43,8 +43,8 @@ def options(opt): opt.SAMBA3_ADD_OPTION('winbind') opt.SAMBA3_ADD_OPTION('ads') opt.SAMBA3_ADD_OPTION('ldap') - opt.SAMBA3_ADD_OPTION('cups', with_name="enable", without_name="disable") - opt.SAMBA3_ADD_OPTION('iprint', with_name="enable", without_name="disable") + opt.SAMBA3_ADD_OPTION('cups', with_name="enable", without_name="disable", default=None) + opt.SAMBA3_ADD_OPTION('iprint', with_name="enable", without_name="disable", default=None) opt.SAMBA3_ADD_OPTION('pam') opt.SAMBA3_ADD_OPTION('quotas') opt.SAMBA3_ADD_OPTION('sendfile-support', default=None) @@ -602,30 +602,26 @@ msg.msg_accrightslen = sizeof(fd); conf.DEFINE('HAVE_NETGROUP', '1') # Look for CUPS - if Options.options.with_cups: + conf.SET_TARGET_TYPE('cups', 'EMPTY') + if not Options.options.with_cups == False: conf.find_program('cups-config', var='CUPS_CONFIG') if conf.env.CUPS_CONFIG: # we would normally use --libs here, but cups-config incorrectly adds # gssapi_krb5 and other libraries to its --libs output. That breaks the use # of an in-tree heimdal kerberos conf.CHECK_CFG(path=conf.env.CUPS_CONFIG, args="--cflags --ldflags", - package="", uselib_store="CUPS") - conf.CHECK_HEADERS('cups/cups.h cups/language.h', lib='cups') - conf.CHECK_FUNCS_IN('httpConnect httpConnectEncrypt', 'cups') - if conf.CONFIG_SET('HAVE_CUPS_CUPS_H') and conf.CONFIG_SET('HAVE_CUPS_LANGUAGE_H'): + package="cups-config flags", uselib_store="CUPS") + if conf.CHECK_HEADERS('cups/cups.h cups/language.h', lib='cups') and \ + conf.CHECK_FUNCS_IN('httpConnect httpConnectEncrypt', 'cups'): conf.DEFINE('HAVE_CUPS', '1') - else: - conf.undefine('HAVE_CUPS') - conf.SET_TARGET_TYPE('cups', 'EMPTY') - else: - # define an empty subsystem for cups, to allow it to be used as an empty dependency - conf.SET_TARGET_TYPE('cups', 'EMPTY') + if not conf.CONFIG_SET('HAVE_CUPS') and Options.options.with_cups == True: + conf.fatal('cups support not found but it was requested !') + + if not Options.options.with_iprint == False and conf.CONFIG_SET('HAVE_CUPS'): + conf.DEFINE('HAVE_IPRINT', '1') + if not conf.CONFIG_SET('HAVE_IPRINT') and Options.options.with_iprint == True: + conf.fatal('iprint support not found but it was requested !') - if Options.options.with_iprint: - if conf.CONFIG_SET('HAVE_CUPS'): - conf.DEFINE('HAVE_IPRINT', '1') - else: - Logs.warn("--enable-iprint=yes but cups support not sufficient") if Options.options.with_syslog: conf.DEFINE('WITH_SYSLOG', '1') if Options.options.with_automount: -- 2.17.1 From 165770f6228b47840b27c1b3d838bb552271931a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 24 Jan 2019 23:04:05 +0100 Subject: [PATCH 2/3] waf: clean up configure check for libarchive with auto default Signed-off-by: Bjoern Jacke --- source3/wscript | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/source3/wscript b/source3/wscript index f2a071fa7ed5..18d2eb48d9d8 100644 --- a/source3/wscript +++ b/source3/wscript @@ -58,7 +58,7 @@ def options(opt): opt.SAMBA3_ADD_OPTION('dmapi', default=None) # None means autodetection opt.SAMBA3_ADD_OPTION('fam', default=None) # None means autodetection opt.SAMBA3_ADD_OPTION('profiling-data', default=False) - opt.SAMBA3_ADD_OPTION('libarchive', default=True) + opt.SAMBA3_ADD_OPTION('libarchive', default=None) opt.SAMBA3_ADD_OPTION('cluster-support', default=False) @@ -213,23 +213,16 @@ main() { Logs.warn('no suitable FAM library found') # check for libarchive (tar command in smbclient) - # None means autodetect, True/False means enable/disable conf.SET_TARGET_TYPE('archive', 'EMPTY') if Options.options.with_libarchive is not False: - Logs.info("Checking for libarchive existence") if conf.CHECK_HEADERS('archive.h') and conf.CHECK_LIB('archive', shlib=True): conf.CHECK_FUNCS_IN('archive_read_support_filter_all archive_read_free', 'archive') - else: - conf.fatal("libarchive support not found. " - "Try installing libarchive-dev or libarchive-devel. " - "Otherwise, use --without-libarchive to " - "build without libarchive support. " - "libarchive support is required for the smbclient " - "tar-file mode") - elif conf.CONFIG_GET('ENABLE_SELFTEST'): - raise Errors.WafError('libarchive library required for ' + if not conf.CONFIG_SET('HAVE_LIBARCHIVE'): + if conf.CONFIG_GET('ENABLE_SELFTEST'): + raise Errors.WafError('libarchive library required for ' '--enable-selftest') - + if Options.options.with_libarchive == True: + conf.fatal('libarchive support not found but it was requested !') # check for DMAPI libs if Options.options.with_dmapi == False: -- 2.17.1 From c1aaa2f0de3c7995b2d959f6e78094cd194b7783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 25 Jan 2019 00:00:40 +0100 Subject: [PATCH 3/3] waf: clean up configure check for avahi with auto default Signed-off-by: Bjoern Jacke --- source3/wscript | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source3/wscript b/source3/wscript index 18d2eb48d9d8..dc02577d9f52 100644 --- a/source3/wscript +++ b/source3/wscript @@ -49,7 +49,7 @@ def options(opt): opt.SAMBA3_ADD_OPTION('quotas') opt.SAMBA3_ADD_OPTION('sendfile-support', default=None) opt.SAMBA3_ADD_OPTION('utmp') - opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable") + opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable", default=None) opt.SAMBA3_ADD_OPTION('iconv') opt.SAMBA3_ADD_OPTION('acl-support') opt.SAMBA3_ADD_OPTION('dnsupdate') @@ -814,16 +814,16 @@ msg.msg_accrightslen = sizeof(fd); else: Logs.warn("--with-utmp but utmp support not sufficient") - if Options.options.with_avahi: - conf.env.with_avahi = True - if not conf.CHECK_HEADERS('avahi-common/watch.h avahi-client/client.h'): conf.env.with_avahi = False - if not conf.CHECK_FUNCS_IN('avahi_client_new', 'avahi-client'): conf.env.with_avahi = False - if not conf.CHECK_FUNCS_IN('avahi_strerror', 'avahi-common'): conf.env.with_avahi = False - if conf.env.with_avahi: + conf.SET_TARGET_TYPE('avahi-common', 'EMPTY') + conf.SET_TARGET_TYPE('avahi-client', 'EMPTY') + if not Options.options.with_avahi == False: + if conf.CHECK_HEADERS('avahi-common/watch.h avahi-client/client.h') \ + and conf.CHECK_FUNCS_IN('avahi_client_new', 'avahi-client') \ + and conf.CHECK_FUNCS_IN('avahi_strerror', 'avahi-common'): conf.DEFINE('WITH_AVAHI_SUPPORT', 1) - else: - conf.SET_TARGET_TYPE('avahi-common', 'EMPTY') - conf.SET_TARGET_TYPE('avahi-client', 'EMPTY') + if not conf.CONFIG_SET('WITH_AVAHI_SUPPORT') and Options.options.with_avahi == True: + conf.fatal('avahi support not found but it was requested !') + if Options.options.with_iconv: conf.env.with_iconv = True -- 2.17.1