From 64f860e96a7662379ff5b9edc2b402631ac6fb66 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 13 Apr 2010 17:27:52 +1000 Subject: build: added autoconf compatible configure options This adds --build, --host, --program-prefix and --disable-dependency-tracking. All we do with them is check them for sanity and throw an error if (for example) the user tries a cross-compile using these options Pair-Programmed-With: Andrew Bartlett --- buildtools/wafsamba/wscript | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'buildtools/wafsamba/wscript') diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 87e70702dc..a395bfedf3 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -5,6 +5,7 @@ import sys, wafsamba import Options, os, preproc from samba_utils import * +from optparse import SUPPRESS_HELP def set_options(opt): opt.tool_options('compiler_cc') @@ -78,6 +79,21 @@ def set_options(opt): help=("set host compiler when cross compiling"), action='store', dest='HOSTCC', default=False) + # we use SUPPRESS_HELP for these, as they are ignored, and are there only + # to allow existing RPM spec files to work + opt.add_option('--build', + help=SUPPRESS_HELP, + action='store', dest='AUTOCONF_BUILD', default='') + opt.add_option('--host', + help=SUPPRESS_HELP, + action='store', dest='AUTOCONF_HOST', default='') + opt.add_option('--program-prefix', + help=SUPPRESS_HELP, + action='store', dest='AUTOCONF_PROGRAM_PREFIX', default='') + opt.add_option('--disable-dependency-tracking', + help=SUPPRESS_HELP, + action='store_true', dest='AUTOCONF_DISABLE_DEPENDENCY_TRACKING', default=False) + @wafsamba.runonce def configure(conf): @@ -120,6 +136,17 @@ def configure(conf): conf.env.CROSS_EXECUTE = Options.options.CROSS_EXECUTE conf.env.HOSTCC = Options.options.HOSTCC + conf.env.AUTOCONF_BUILD = Options.options.AUTOCONF_BUILD + conf.env.AUTOCONF_HOST = Options.options.AUTOCONF_HOST + conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX + + if conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST: + Logs.error('ERROR: Mismatch between --build and --host. Please use --cross-compile instead') + sys.exit(1) + if conf.env.AUTOCONF_PROGRAM_PREFIX: + Logs.error('ERROR: --program-prefix not supported') + sys.exit(1) + # see if we can compile and run a simple C program conf.CHECK_CODE('printf("hello world\\n")', define='HAVE_SIMPLE_C_PROG', -- cgit