build: fix --with-regedit to properly honour the yes/no/auto scheme
authorMichael Adam <obnox@samba.org>
Mon, 6 May 2013 12:14:02 +0000 (14:14 +0200)
committerKai Blin <kai@samba.org>
Mon, 6 May 2013 16:24:58 +0000 (18:24 +0200)
I.e. fail configure when ncurses support is not found but
regedit build was requested.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
source3/wscript
source3/wscript_configure_system_ncurses

index 28fa11f2276fc62a6b188b9a7f02306f3a826c8f..72ab18a721d253b7408e43fb3314c9f5b373f96c 100644 (file)
@@ -1713,8 +1713,23 @@ main() {
     if conf.CHECK_HEADERS('cephfs/libcephfs.h', False, False, 'cephfs') and conf.CHECK_LIB('cephfs'):
         conf.DEFINE('HAVE_CEPH', '1')
 
-    if Options.options.with_regedit:
+    conf.env.build_regedit = False
+    if not Options.options.with_regedit == False:
         conf.PROCESS_SEPARATE_RULE('system_ncurses')
+        if conf.CONFIG_SET('HAVE_NCURSES'):
+            conf.env.build_regedit = True
+
+    if conf.env.build_regedit:
+        Logs.info("building regedit")
+    else:
+        if Options.options.with_regedit == False:
+            Logs.info("not building regedit (--without-regedit)")
+        elif Options.options.with_regedit == True:
+            Logs.error("ncurses not available, cannot build regedit")
+            conf.fatal("ncurses not available, but --with-regedit was specified")
+        else:
+            Logs.info("ncurses not available, not building regedit")
+
 
     default_static_modules.extend(TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam
                                       auth_sam auth_unix auth_winbind auth_wbc
index e7596be64e3b72141173ebe361bdee2f8e577adf..5c804291cee9296a38ef85e19f41b01d545a579f 100644 (file)
@@ -9,7 +9,6 @@ if not conf.env.NCURSES_CONFIG:
 if conf.env.NCURSES_CONFIG:
     conf.check_cfg(path=conf.env.NCURSES_CONFIG, args="--cflags --libs",
                package="", uselib_store="NCURSES")
-    conf.env.build_regedit = True
 
 conf.CHECK_HEADERS('ncurses.h menu.h panel.h form.h', lib='ncurses')
 
@@ -17,3 +16,11 @@ conf.CHECK_FUNCS_IN('initscr', 'ncurses')
 conf.CHECK_FUNCS_IN('set_menu_items item_count', 'menu')
 conf.CHECK_FUNCS_IN('new_panel show_panel', 'panel')
 conf.CHECK_FUNCS_IN('new_field new_form', 'form')
+
+if conf.CONFIG_SET('HAVE_NCURSES_H') and \
+   conf.CONFIG_SET('HAVE_MENU_H') and \
+   conf.CONFIG_SET('HAVE_PANEL_H') and \
+   conf.CONFIG_SET('HAVE_FORM_H'):
+    conf.DEFINE('HAVE_NCURSES', '1')
+else:
+    conf.undefine('HAVE_NCURSES')