aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-25 23:25:34 +0200
committerSimon Warta <[email protected]>2015-06-25 23:25:34 +0200
commit4830d15284dc44cb1980d0256976d63dad05c899 (patch)
treef4bf5058d7024bf5ac7693faa867909acc362fc3
parent0b91cbbe2477a631b083ba8809724557259c2e8c (diff)
parent6deda9e82a1141d83476d7c4a6453d249c1e23d1 (diff)
Merge pull request #138 from webmaster128/choices
Add optparse choices parameter to detect config errors nice and early
-rwxr-xr-xconfigure.py8
-rwxr-xr-xsrc/scripts/ci/build.sh4
2 files changed, 8 insertions, 4 deletions
diff --git a/configure.py b/configure.py
index 0d459bb66..fc6e40912 100755
--- a/configure.py
+++ b/configure.py
@@ -282,6 +282,7 @@ def process_command_line(args):
modes = ['release', 'debug', 'coverage']
build_group.add_option('--build-mode', default='release', metavar='MODE',
+ choices=modes,
help="Build mode (one of %s; default %%default)" % (', '.join(modes)))
build_group.add_option('--debug-mode', action='store_const',
@@ -290,7 +291,7 @@ def process_command_line(args):
build_group.add_option('--enable-shared', dest='build_shared_lib',
action='store_true', default=True,
- help=optparse.SUPPRESS_HELP)
+ help=optparse.SUPPRESS_HELP)
build_group.add_option('--disable-shared', dest='build_shared_lib',
action='store_false',
help='disable building shared library')
@@ -324,8 +325,10 @@ def process_command_line(args):
build_group.add_option('--link-method', default=None, metavar='METHOD',
help='choose how links are created')
+ makefile_styles = ['gmake', 'nmake']
build_group.add_option('--makefile-style', metavar='STYLE', default=None,
- help='makefile type (gmake or nmake)')
+ choices=makefile_styles,
+ help='makefile type (%s)' % ' or '.join(makefile_styles))
build_group.add_option('--with-local-config',
dest='local_config', metavar='FILE',
@@ -356,6 +359,7 @@ def process_command_line(args):
build_group.add_option('--maintainer-mode', dest='maintainer_mode',
action='store_true', default=False,
help="Enable extra warnings")
+
build_group.add_option('--dirty-tree', dest='clean_build_tree',
action='store_false', default=True,
help=optparse.SUPPRESS_HELP)
diff --git a/src/scripts/ci/build.sh b/src/scripts/ci/build.sh
index 2aa3e5458..5d88260d4 100755
--- a/src/scripts/ci/build.sh
+++ b/src/scripts/ci/build.sh
@@ -3,9 +3,9 @@
set -ev
if [ "$BUILD_MODE" = "static" ]; then
- CFG_FLAGS="--disable-shared --via-amalgamation"
+ CFG_FLAGS="--disable-shared --via-amalgamation"
elif [ "$BUILD_MODE" = "shared" ]; then
- CFG_FLAGS="--build-mode=shared"
+ CFG_FLAGS=""
elif [ "$BUILD_MODE" = "coverage" ]; then
# lcov gets confused by symlinks
CFG_FLAGS="--build-mode=coverage --link-method=copy"