[Scummvm-cvs-logs] scummvm master -> fe79702d1d651f8616892732e92922828840fc13

wjp wjp at usecode.org
Fri Nov 25 13:53:22 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
dd6c6a36ea BUILD: Change engine configuration options
fe79702d1d BUILD: Sync create_project with configure engine option changes.


Commit: dd6c6a36ea80531af3f7c180f1d06df23a93fe5c
    https://github.com/scummvm/scummvm/commit/dd6c6a36ea80531af3f7c180f1d06df23a93fe5c
Author: D G Turner (digitall at scummvm.org)
Date: 2011-11-25T02:57:41-08:00

Commit Message:
BUILD: Change engine configuration options

This changes the set of engine options to ./configure to:

--enable-all-engines
--disable-all-engines
--enable-engine=<engine name>[,<engine name>...]

And if plugins are enabled:
--enable-engine-static=<engine name>[,<engine name>...]
--enable-engine-dynamic=<engine name>[,<engine name>...]

Changed paths:
    configure



diff --git a/configure b/configure
index 9675e48..accc883 100755
--- a/configure
+++ b/configure
@@ -411,8 +411,13 @@ get_system_exe_extension() {
 
 # Show the configure help line for an option
 option_help() {
+	if test "${3}" != "" ; then
+		tmpopt_prefix="${3}"
+	else
+		tmpopt_prefix="--"
+	fi
 	tmpopt=`echo $1 | sed 's/_/-/g'`
-	option=`echo "--${tmpopt}                       " | sed "s/\(.\{23\}\).*/\1/"`
+	option=`echo "${tmpopt_prefix}${tmpopt}                       " | sed "s/\(.\{23\}\).*/\1/"`
 	echo "  ${option}  ${2}"
 }
 
@@ -474,9 +479,9 @@ engine_disable_all() {
 # Enable the given engine
 engine_enable() {
 	# Get the parameter
-	if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
-		eng=`echo $1 | cut -d '=' -f 1`
-		opt=`echo $1 | cut -d '=' -f 2`
+	if ( echo $1 | grep ':' ) 2> /dev/null > /dev/null ; then
+		eng=`echo $1 | cut -d ':' -f 1`
+		opt=`echo $1 | cut -d ':' -f 2`
 	else
 		eng=$1
 		opt=yes
@@ -518,15 +523,8 @@ engine_disable() {
 
 # Show the configure help line for a given engine
 show_engine_help() {
-	if test `get_engine_build $1` = yes ; then
-		option="disable"
-		do="don't "
-	else
-		option="enable"
-		do=""
-	fi
 	name=`get_engine_name $1`
-	option_help ${option}-${1} "${do}build the ${name} engine"
+	option_help "${1}" "${name} engine" "  "
 	for sub in `get_engine_subengines $1`; do
 		show_subengine_help $sub $1
 	done
@@ -534,16 +532,9 @@ show_engine_help() {
 
 # Show the configure help line for a given subengine
 show_subengine_help() {
-	if test `get_engine_build $1` = yes ; then
-		option="disable"
-		do="exclude"
-	else
-		option="enable"
-		do="include"
-	fi
 	name=`get_engine_name $1`
 	parent=`get_engine_name $2`
-	option_help ${option}-${1} "${do} the ${name} in ${parent} engine"
+	option_help "${1}" "${name} in ${parent} engine" "  "
 }
 
 # Prepare the strings about the engines to build
@@ -766,6 +757,13 @@ Game engines:
   --enable-all-engines     enable all engines, including those which are
                            broken or unsupported
   --disable-all-engines    disable all engines
+  --enable-engine=<engine name>[,<engine name>...] enable engine(s) listed
+  --disable-engine=<engine name>[,<engine name>...] disable engine(s) listed
+  --enable-engine-static=<engine name>[,<engine name>...] 
+      enable engine(s) listed as static builtin (when plugins are enabled)
+  --enable-engine-dynamic=<engine name>[,<engine name>...]
+      enable engine(s) listed as dynamic plugin (when plugins are enabled)
+    The values of <engine name> for these options are as follows:
 $engines_help
 Optional Features:
   --disable-debug          disable building with debugging symbols
@@ -1068,11 +1066,25 @@ for ac_option in $@; do
 	--disable-all-engines)
 		engine_disable_all
 		;;
-	--enable-*)
-		engine_enable `echo $ac_option | cut -d '-' -f 4-`
+	--enable-engine=*)
+		for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
+			engine_enable "${engine_name}"
+		done
+		;;
+	--enable-engine-static=*)
+		for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
+			engine_enable "${engine_name}:static"
+		done
 		;;
-	--disable-*)
-		engine_disable `echo $ac_option | cut -d '-' -f 4-`
+	--enable-engine-dynamic=*)
+		for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
+			engine_enable "${engine_name}:dynamic"
+		done
+		;;
+	--disable-engine=*)
+		for engine_name in `echo $ac_option | cut -d '=' -f 2 | tr ',' '\n'`; do
+			engine_disable ${engine_name}
+		done
 		;;
 	*)
 		option_error


Commit: fe79702d1d651f8616892732e92922828840fc13
    https://github.com/scummvm/scummvm/commit/fe79702d1d651f8616892732e92922828840fc13
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-25T02:59:21-08:00

Commit Message:
BUILD: Sync create_project with configure engine option changes.

Changed paths:
    devtools/create_project/create_project.cpp



diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 0a80bed..527136c 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -105,6 +105,30 @@ struct FSNode {
 };
 
 typedef std::list<FSNode> FileList;
+
+typedef StringList TokenList;
+
+/**
+ * Takes a given input line and creates a list of tokens out of it.
+ *
+ * A token in this context is separated by whitespaces. A special case
+ * are quotation marks though. A string inside quotation marks is treated
+ * as single token, even when it contains whitespaces.
+ *
+ * Thus for example the input:
+ * foo bar "1 2 3 4" ScummVM
+ * will create a list with the following entries:
+ * "foo", "bar", "1 2 3 4", "ScummVM"
+ * As you can see the quotation marks will get *removed* too.
+ *
+ * You can also use this with non-whitespace by passing another separator
+ * character (e.g. ',').
+ *
+ * @param input The text to be tokenized.
+ * @param separator The token separator.
+ * @return A list of tokens.
+ */
+TokenList tokenize(const std::string &input, char separator = ' ');
 } // End of anonymous namespace
 
 enum ProjectType {
@@ -201,6 +225,38 @@ int main(int argc, char *argv[]) {
 				std::cerr << "ERROR: Unsupported version: \"" << msvcVersion << "\" passed to \"--msvc-version\"!\n";
 				return -1;
 			}
+		} else if (!strncmp(argv[i], "--enable-engine=", 16)) {
+			const char *names = &argv[i][16];
+			if (!*names) {
+				std::cerr << "ERROR: Invalid command \"" << argv[i] << "\"\n";
+				return -1;
+			}
+
+			TokenList tokens = tokenize(names, ',');
+			TokenList::const_iterator token = tokens.begin();
+			while (token != tokens.end()) {
+				std::string name = *token++;
+				if (!setEngineBuildState(name, setup.engines, true)) {
+					std::cerr << "ERROR: \"" << name << "\" is not a known engine!\n";
+					return -1;
+				}
+			}
+		} else if (!strncmp(argv[i], "--disable-engine=", 17)) {
+			const char *names = &argv[i][17];
+			if (!*names) {
+				std::cerr << "ERROR: Invalid command \"" << argv[i] << "\"\n";
+				return -1;
+			}
+
+			TokenList tokens = tokenize(names, ',');
+			TokenList::const_iterator token = tokens.begin();
+			while (token != tokens.end()) {
+				std::string name = *token++;
+				if (!setEngineBuildState(name, setup.engines, false)) {
+					std::cerr << "ERROR: \"" << name << "\" is not a known engine!\n";
+					return -1;
+				}
+			}
 		} else if (!strncmp(argv[i], "--enable-", 9)) {
 			const char *name = &argv[i][9];
 			if (!*name) {
@@ -211,12 +267,9 @@ int main(int argc, char *argv[]) {
 			if (!std::strcmp(name, "all-engines")) {
 				for (EngineDescList::iterator j = setup.engines.begin(); j != setup.engines.end(); ++j)
 					j->enable = true;
-			} else if (!setEngineBuildState(name, setup.engines, true)) {
-				// If none found, we'll try the features list
-				if (!setFeatureBuildState(name, setup.features, true)) {
-					std::cerr << "ERROR: \"" << name << "\" is neither an engine nor a feature!\n";
-					return -1;
-				}
+			} else if (!setFeatureBuildState(name, setup.features, true)) {
+				std::cerr << "ERROR: \"" << name << "\" is not a feature!\n";
+				return -1;
 			}
 		} else if (!strncmp(argv[i], "--disable-", 10)) {
 			const char *name = &argv[i][10];
@@ -228,12 +281,9 @@ int main(int argc, char *argv[]) {
 			if (!std::strcmp(name, "all-engines")) {
 				for (EngineDescList::iterator j = setup.engines.begin(); j != setup.engines.end(); ++j)
 					j->enable = false;
-			} else if (!setEngineBuildState(name, setup.engines, false)) {
-				// If none found, we'll try the features list
-				if (!setFeatureBuildState(name, setup.features, false)) {
-					std::cerr << "ERROR: \"" << name << "\" is neither an engine nor a feature!\n";
-					return -1;
-				}
+			} else if (!setFeatureBuildState(name, setup.features, false)) {
+				std::cerr << "ERROR: \"" << name << "\" is not a feature!\n";
+				return -1;
 			}
 		} else if (!std::strcmp(argv[i], "--file-prefix")) {
 			if (i + 1 >= argc) {
@@ -620,26 +670,6 @@ void displayHelp(const char *exe) {
 	cout.setf(std::ios_base::right, std::ios_base::adjustfield);
 }
 
-typedef StringList TokenList;
-
-/**
- * Takes a given input line and creates a list of tokens out of it.
- *
- * A token in this context is separated by whitespaces. A special case
- * are quotation marks though. A string inside quotation marks is treated
- * as single token, even when it contains whitespaces.
- *
- * Thus for example the input:
- * foo bar "1 2 3 4" ScummVM
- * will create a list with the following entries:
- * "foo", "bar", "1 2 3 4", "ScummVM"
- * As you can see the quotation marks will get *removed* too.
- *
- * @param input The text to be tokenized.
- * @return A list of tokens.
- */
-TokenList tokenize(const std::string &input);
-
 /**
  * Try to parse a given line and create an engine definition
  * out of the result.
@@ -769,7 +799,7 @@ bool parseEngine(const std::string &line, EngineDesc &engine) {
 	return true;
 }
 
-TokenList tokenize(const std::string &input) {
+TokenList tokenize(const std::string &input, char separator) {
 	TokenList result;
 
 	std::string::size_type sIdx = input.find_first_not_of(" \t");
@@ -783,12 +813,15 @@ TokenList tokenize(const std::string &input) {
 			++sIdx;
 			nIdx = input.find_first_of('\"', sIdx);
 		} else {
-			nIdx = input.find_first_of(' ', sIdx);
+			nIdx = input.find_first_of(separator, sIdx);
 		}
 
 		if (nIdx != std::string::npos) {
 			result.push_back(input.substr(sIdx, nIdx - sIdx));
-			sIdx = input.find_first_not_of(" \t", nIdx + 1);
+			if (separator == ' ')
+				sIdx = input.find_first_not_of(" \t", nIdx + 1);
+			else
+				sIdx = input.find_first_not_of(separator, nIdx + 1);
 		} else {
 			result.push_back(input.substr(sIdx));
 			break;






More information about the Scummvm-git-logs mailing list