summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/wscript
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-13 17:27:52 +1000
committerAndrew Tridgell <tridge@samba.org>2010-04-13 17:34:44 +1000
commit64f860e96a7662379ff5b9edc2b402631ac6fb66 (patch)
tree7435cdfafb2ba3ba2bfe7ec7ae3adede84ddc428 /buildtools/wafsamba/wscript
parent6661ecbe944567a1813fad46d67554433196aae1 (diff)
downloadsamba-64f860e96a7662379ff5b9edc2b402631ac6fb66.tar.gz
samba-64f860e96a7662379ff5b9edc2b402631ac6fb66.tar.bz2
samba-64f860e96a7662379ff5b9edc2b402631ac6fb66.zip
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 <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba/wscript')
-rw-r--r--buildtools/wafsamba/wscript27
1 files changed, 27 insertions, 0 deletions
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',