summaryrefslogtreecommitdiffstats
path: root/src/libcommuni/configure
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2015-09-09 19:00:56 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2015-09-09 19:02:23 +0200
commit8a6d4b06f2291c363f3dea17837ed20893852453 (patch)
treec091375499e35eaa1810586454e0834c06e6c9b2 /src/libcommuni/configure
parentf554a27046f203e56a07baaf214d90834942e3f5 (diff)
downloadmanager-8a6d4b06f2291c363f3dea17837ed20893852453.tar.gz
manager-8a6d4b06f2291c363f3dea17837ed20893852453.zip
Cleanup repo with some directories
Diffstat (limited to 'src/libcommuni/configure')
-rwxr-xr-xsrc/libcommuni/configure319
1 files changed, 319 insertions, 0 deletions
diff --git a/src/libcommuni/configure b/src/libcommuni/configure
new file mode 100755
index 0000000..3c29418
--- /dev/null
+++ b/src/libcommuni/configure
@@ -0,0 +1,319 @@
+#!/bin/sh
+
+BUILD_TREE=`/bin/pwd`
+SOURCE_TREE=`dirname $0`
+SOURCE_TREE=`cd "$SOURCE_TREE"; /bin/pwd`
+CONFIG_VARS="$BUILD_TREE/.config.vars"
+
+INSTALL_PREFIX=
+INSTALL_LIBS=
+INSTALL_BINS=
+INSTALL_HEADERS=
+INSTALL_FEATURES=
+INSTALL_IMPORTS=
+INSTALL_QML=
+
+BUILD_EXAMPLES=yes
+BUILD_TESTS=yes
+
+BUILD_UCHARDET=auto
+BUILD_ICU=auto
+
+QMAKE_CONFIG=
+QMAKE_PARAMS=
+QMAKE_DEBUG=
+QMAKE_SPEC=
+OPT_HELP=no
+
+QMAKE=`which qmake || which qmake-qt5 || which qmake-qt4` 2>/dev/null
+
+if [ -f "$CONFIG_VARS" ]; then
+ rm "$CONFIG_VARS"
+fi
+
+#-------------------------------------------------------------------------------
+# parse command line arguments
+#-------------------------------------------------------------------------------
+
+# parse the arguments, setting things to "yes" or "no"
+while [ "$#" -gt 0 ]; do
+ CURRENT_OPT="$1"
+ UNKNOWN_ARG=no
+ case "$1" in
+ #Autoconf style options
+ --enable-*)
+ VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
+ VAL=yes
+ ;;
+ --disable-*)
+ VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
+ VAL=no
+ ;;
+ --*=*)
+ VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
+ VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
+ ;;
+ --nomake|--make|--prefix|--libdir|--bindir|--headerdir|--featuredir|--importdir|--qmldir|--qmake|--spec|--config|--var)
+ VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
+ shift
+ VAL="$1"
+ ;;
+ --no-*)
+ VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
+ VAL=no
+ ;;
+ --*)
+ VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
+ VAL=yes
+ ;;
+ #Qt style options that pass an argument
+ -nomake|-make|-prefix|-libdir|-bindir|-headerdir|-featuredir|-importdir|-qmldir|-qmake|-spec|-config|-var)
+ VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
+ shift
+ VAL="$1"
+ ;;
+ #Qt style no options
+ -no-uchardet|-no-icu)
+ VAR=`echo $1 | sed 's,^-no-\(.*\),\1,'`
+ VAL=no
+ ;;
+ #Qt style yes options
+ -uchardet|-icu)
+ VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
+ VAL=yes
+ ;;
+ -*)
+ VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
+ VAL=unknown
+ ;;
+ *)
+ UNKNOWN_ARG=yes
+ ;;
+ esac
+ if [ "$UNKNOWN_ARG" = "yes" ]; then
+ echo "$1: unknown argument"
+ OPT_HELP=yes
+ ERROR=yes
+ shift
+ continue
+ fi
+ shift
+
+ UNKNOWN_OPT=no
+ case "$VAR" in
+ prefix)
+ INSTALL_PREFIX="$VAL"
+ ;;
+ libdir)
+ INSTALL_LIBS="$VAL"
+ ;;
+ bindir)
+ INSTALL_BINS="$VAL"
+ ;;
+ headerdir)
+ INSTALL_HEADERS="$VAL"
+ ;;
+ featuredir)
+ INSTALL_FEATURES="$VAL"
+ ;;
+ importdir)
+ INSTALL_IMPORTS="$VAL"
+ ;;
+ qmldir)
+ INSTALL_QML="$VAL"
+ ;;
+ nomake)
+ case "$VAL" in
+ examples)
+ BUILD_EXAMPLES=no
+ ;;
+ tests)
+ BUILD_TESTS=no
+ ;;
+ *)
+ CURRENT_OPT="$VAL"
+ UNKNOWN_OPT=yes
+ ;;
+ esac
+ ;;
+ make)
+ case "$VAL" in
+ examples)
+ BUILD_EXAMPLES=yes
+ ;;
+ tests)
+ BUILD_TESTS=yes
+ ;;
+ *)
+ CURRENT_OPT="$VAL"
+ UNKNOWN_OPT=yes
+ ;;
+ esac
+ ;;
+ verbose)
+ QMAKE_CONFIG="$QMAKE_CONFIG verbose"
+ ;;
+ static)
+ QMAKE_CONFIG="$QMAKE_CONFIG static"
+ ;;
+ qmake)
+ QMAKE="$VAL"
+ ;;
+ spec)
+ QMAKE_SPEC="$VAL"
+ ;;
+ config)
+ QMAKE_CONFIG="$QMAKE_CONFIG $VAL"
+ ;;
+ var)
+ echo "$VAL" >> "$CONFIG_VARS"
+ ;;
+ d)
+ QMAKE_DEBUG="$QMAKE_DEBUG -d"
+ ;;
+ uchardet)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ BUILD_UCHARDET=$VAL
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
+ icu)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ BUILD_ICU=$VAL
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
+ h|help)
+ OPT_HELP=yes
+ ;;
+ *)
+ UNKNOWN_OPT=yes
+ ;;
+ esac
+ if [ "$UNKNOWN_OPT" = "yes" ]; then
+ echo "${CURRENT_OPT}: unknown option"
+ OPT_HELP=yes
+ ERROR=yes
+ fi
+done
+
+if [ "$OPT_HELP" = "yes" ]; then
+ cat << EOF
+Usage: configure [options]
+
+Installation options:
+
+ -prefix <dir> ............ The installation prefix
+ -libdir <dir> ............ Libraries will be installed to <dir>
+ (default QT_INSTALL_LIBS)
+ -bindir <dir> ............ Binaries will be installed to <dir>
+ (default QT_INSTALL_BINS)
+ -headerdir <dir> ......... Headers will be installed to <dir>
+ (default QT_INSTALL_HEADERS/Communi)
+ -featuredir <dir> ........ Features will be installed to <dir>
+ (default QT_HOST_DATA/mkspecs/features)
+ -importdir <dir> ......... Imports for QML1 will be installed to <dir>/Communi
+ (default QT_INSTALL_IMPORTS/Communi)
+ -qmldir <dir> ............ Imports for QML2 will be installed to <dir>/Communi
+ (default QT_INSTALL_QML/Communi)
+
+Configure options:
+
+ -verbose ................. Verbose build output
+ -static .................. Build static library
+ -qmake ................... qmake to use
+ -config (config) ......... Additional configuration options recognized by qmake
+ (eg. -config warn_off)
+ -var (value) ............. Additional variables recognized by qmake
+ (eg. -var "QMAKE_LFLAGS += -L/path/to/icu")
+ -make (part) ............. Add part to the list of parts to be built at
+ make time (available parts: examples tests)
+ -nomake (part) ........... Exclude part from the list of parts to be built
+
+Additional options:
+
+ -no-uchardet ............. Do not build uchardet support
+ -uchardet ................ Build uchardet support
+
+ -no-icu .................. Do not build ICU support
+ -icu ..................... Build ICU support
+
+EOF
+ [ "x$ERROR" = "xyes" ] && exit 1
+ exit 0
+fi
+
+if [ ! -f "$QMAKE" ]; then
+ echo "ERROR: Unable to find qmake. Try $0 -qmake /path/to/qmake."
+ exit 1
+fi
+
+if [ "$INSTALL_PREFIX" != "" ]; then
+ [ "$INSTALL_LIBS" = "" ] && INSTALL_LIBS="$INSTALL_PREFIX/lib"
+ [ "$INSTALL_BINS" = "" ] && INSTALL_BINS="$INSTALL_PREFIX/bin"
+ [ "$INSTALL_HEADERS" = "" ] && INSTALL_HEADERS="$INSTALL_PREFIX/include"
+ [ "$INSTALL_FEATURES" = "" ] && INSTALL_FEATURES="$INSTALL_PREFIX/features"
+ [ "$INSTALL_IMPORTS" = "" ] && INSTALL_IMPORTS="$INSTALL_PREFIX/imports"
+ [ "$INSTALL_QML" = "" ] && INSTALL_QML="$INSTALL_PREFIX/qml"
+fi
+[ "$INSTALL_LIBS" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_LIBS=$INSTALL_LIBS"
+[ "$INSTALL_BINS" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_BINS=$INSTALL_BINS"
+[ "$INSTALL_HEADERS" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_HEADERS=$INSTALL_HEADERS"
+[ "$INSTALL_FEATURES" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_FEATURES=$INSTALL_FEATURES"
+[ "$INSTALL_IMPORTS" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_IMPORTS=$INSTALL_IMPORTS"
+[ "$INSTALL_QML" != "" ] && QMAKE_PARAMS="$QMAKE_PARAMS IRC_INSTALL_QML=$INSTALL_QML"
+
+[ "$INSTALL_LIBS" = "" ] && INSTALL_LIBS=`$QMAKE -query QT_INSTALL_LIBS`
+[ "$INSTALL_BINS" = "" ] && INSTALL_BINS=`$QMAKE -query QT_INSTALL_BINS`
+[ "$INSTALL_HEADERS" = "" ] && INSTALL_HEADERS=`$QMAKE -query QT_INSTALL_HEADERS`/Communi
+
+if [ "$INSTALL_FEATURES" = "" ]; then
+ $QMAKE -query QT_HOST_DATA > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ INSTALL_FEATURES=`$QMAKE -query QMAKE_MKSPECS`/features
+ else
+ INSTALL_FEATURES=`$QMAKE -query QT_HOST_DATA`/mkspecs/features
+ fi
+fi
+
+[ "$INSTALL_IMPORTS" = "" ] && INSTALL_IMPORTS=`$QMAKE -query QT_INSTALL_IMPORTS`
+[ "$INSTALL_QML" = "" ] && INSTALL_QML=`$QMAKE -query QT_INSTALL_QML`
+
+[ "$BUILD_EXAMPLES" = "no" ] && QMAKE_PARAMS="$QMAKE_PARAMS -config no_examples"
+[ "$BUILD_TESTS" = "no" ] && QMAKE_PARAMS="$QMAKE_PARAMS -config no_tests"
+
+[ "$BUILD_UCHARDET" = "no" ] && QMAKE_PARAMS="$QMAKE_PARAMS -config no_uchardet"
+[ "$BUILD_ICU" = "no" ] && QMAKE_PARAMS="$QMAKE_PARAMS -config no_icu"
+
+[ "$QMAKE_SPEC" != "" ] && QMAKE_SPEC="-spec $QMAKE_SPEC"
+
+echo
+echo "Running $QMAKE $QMAKE_SPEC..."
+
+$QMAKE $QMAKE_SPEC $QMAKE_DEBUG $QMAKE_PARAMS "CONFIG+=$QMAKE_CONFIG" -r $SOURCE_TREE/libcommuni.pro
+if [ $? != 0 ]; then
+ echo "ERROR: qmake run failed."
+ exit 1
+fi
+
+echo
+echo "Communi build configuration:"
+if [ "$QMAKE_CONFIG" != "" ]; then
+ echo "Configuration ...................$QMAKE_CONFIG"
+fi
+echo "uchardet support ................ $BUILD_UCHARDET"
+echo "ICU support ..................... $BUILD_ICU"
+echo "Examples ........................ $BUILD_EXAMPLES"
+echo "Tests ........................... $BUILD_TESTS"
+echo
+echo "Install libs .................... $INSTALL_LIBS"
+#echo "Install binaries ................ $INSTALL_BINS"
+echo "Install headers ................. $INSTALL_HEADERS"
+echo "Install features ................ $INSTALL_FEATURES"
+echo "Install QML1 imports ............ $INSTALL_IMPORTS"
+echo "Install QML2 imports ............ $INSTALL_QML"
+echo
+echo Communi is now configured for building. Just run \'make\'.
+echo