From a6167267d302b97b94fd350df4b27dc7c9a20ef4 Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Thu, 27 Jan 2011 13:48:13 +0100 Subject: Allow the user to select imageformats to be built as plugin vs internal This adds what is already there for different plugin types to imageformats plugins -- allowing the user to configure which image formats will be built into Qt and which will be built as plugins. Merge-request: 1028 Reviewed-by: Oswald Buddenhagen --- configure | 24 +++++++++++++++++++++++- tools/configure/configureapp.cpp | 12 ++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/configure b/configure index b11d82d..b60da9e 100755 --- a/configure +++ b/configure @@ -934,6 +934,16 @@ if [ -d "$relpath/src/plugins/gfxdrivers" ]; then CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off fi +CFG_IMAGEFORMAT_PLUGIN_AVAILABLE= +if [ -d "$relpath/src/plugins/imageformats" ]; then + for a in "$relpath/src/plugins/imageformats/"*; do + if [ -d "$a" ]; then + base_a=`basename "$a"` + CFG_IMAGEFORMAT_PLUGIN_AVAILABLE="${CFG_IMAGEFORMAT_PLUGIN_AVAILABLE} ${base_a}" + fi + done +fi + #------------------------------------------------------------------------------- # Set Default NaCl options #------------------------------------------------------------------------------- @@ -2140,7 +2150,7 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - sql-*|gfx-*|decoration-*|kbd-*|mouse-*) + sql-*|gfx-*|decoration-*|kbd-*|mouse-*|imageformat-*) # if Qt style options were used, $VAL can be "no", "qt", or "plugin" # if autoconf style options were used, $VAL can be "yes" or "no" [ "$VAL" = "yes" ] && VAL=qt @@ -2182,6 +2192,13 @@ while [ "$#" -gt 0 ]; do avail="$CFG_MOUSE_PLUGIN_AVAILABLE" fi ;; + imageformat) + avail="$CFG_IMAGEFORMAT_PLUGIN_AVAILABLE" + if [ "$OPT" != "plugin" ]; then + # png is always built in + avail="$avail png" + fi + ;; *) avail="" echo "BUG: Unhandled type $VAR used in $CURRENT_OPT" @@ -2202,6 +2219,11 @@ while [ "$#" -gt 0 ]; do # set the CFG_SQL_driver eval "CFG_SQL_$VAL=\$OPT" continue + elif [ "$VAR" = "imageformat" ]; then + [ "$OPT" = "qt" ] && OPT=yes + VAL="`echo $VAL |tr a-z A-Z`" + eval "CFG_$VAL=$OPT" + continue fi if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 64fc6a9..6b87c8e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -437,6 +437,7 @@ void Configure::parseCmdLine() { int argCount = configCmdLine.size(); int i = 0; + const QStringList imageFormats = QStringList() << "gif" << "png" << "mng" << "jpeg" << "tiff"; #if !defined(EVAL) if (argCount < 1) // skip rest if no arguments @@ -829,6 +830,17 @@ void Configure::parseCmdLine() dictionary[ "SQL_IBASE" ] = "plugin"; else if (configCmdLine.at(i) == "-no-sql-ibase") dictionary[ "SQL_IBASE" ] = "no"; + + // Image formats -------------------------------------------- + else if (configCmdLine.at(i).startsWith("-qt-imageformat-") && + imageFormats.contains(configCmdLine.at(i).section('-', 3))) + dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "yes"; + else if (configCmdLine.at(i).startsWith("-plugin-imageformat-") && + imageFormats.contains(configCmdLine.at(i).section('-', 3))) + dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "plugin"; + else if (configCmdLine.at(i).startsWith("-no-imageformat-") && + imageFormats.contains(configCmdLine.at(i).section('-', 3))) + dictionary[ configCmdLine.at(i).section('-', 3).toUpper() ] = "no"; #endif // IDE project generation ----------------------------------- else if (configCmdLine.at(i) == "-no-dsp") -- cgit v0.12