winexe: add configure option to control whether to build it (default: auto)
authorGünther Deschner <gd@samba.org>
Wed, 4 Mar 2020 17:51:01 +0000 (18:51 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 9 Mar 2020 16:27:21 +0000 (16:27 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar  9 16:27:21 UTC 2020 on sn-devel-184

examples/winexe/wscript_build
source3/wscript

index 43c09717e3dc04dc67dd36a22d17475290f7fec5..559ed3fc7066fc7b3c2279be93c7af7bfaeb5317 100644 (file)
@@ -106,4 +106,5 @@ if winexesvc_binaries != '':
                           LOADPARM_CTX
                           libsmb
                           msrpc3
-                      ''')
+                      ''',
+                      enabled=bld.env.build_winexe)
index 85466b493fae655c0d08f4d8c18905877d1333c6..6d5bd22ca4984262c26d85c9f5bf897c9937a48e 100644 (file)
@@ -63,6 +63,7 @@ def options(opt):
     opt.samba_add_onoff_option('cluster-support', default=False)
 
     opt.samba_add_onoff_option('regedit', default=None)
+    opt.samba_add_onoff_option('winexe', default=None)
 
     opt.samba_add_onoff_option('fake-kaserver',
                           help=("Include AFS fake-kaserver support"), default=False)
@@ -1782,6 +1783,22 @@ main() {
     if conf.CHECK_HEADERS('ftw.h') and conf.CHECK_FUNCS('nftw'):
         conf.env.build_mvxattr = True
 
+    conf.env.build_winexe = False
+    if not Options.options.with_winexe == False:
+        if conf.CONFIG_SET('HAVE_WINEXE_CC_WIN32') or conf.CONFIG_SET('HAVE_WINEXE_CC_WIN64'):
+            conf.env.build_winexe = True
+
+    if conf.env.build_winexe:
+        Logs.info("building winexe")
+    else:
+        if Options.options.with_winexe == False:
+            Logs.info("not building winexe (--without-winexe)")
+        elif Options.options.with_winexe == True:
+            Logs.error("mingw not available, cannot build winexe")
+            conf.fatal("mingw not available, but --with-winexe was specified")
+        else:
+            Logs.info("mingw not available, not building winexe")
+
     conf.CHECK_FUNCS_IN('DES_pcbc_encrypt', 'crypto')
     if Options.options.with_fake_kaserver == True:
         conf.CHECK_HEADERS('afs/param.h afs/stds.h', together=True)