?? configure
字號:
#!/bin/sh## Generated by qconf 1.4 ( http://delta.affinix.com/qconf/ )#show_usage() {cat <<EOTUsage: $0 [OPTION]...This script creates necessary configuration files to build/install.Main options: --qtdir=[path] Directory where Qt is installed. --static Create a static library instead of shared. --verbose Show extra configure output. --help This help text.Project options: --release Build with debugging turned off (default). --debug Build with debugging turned on. --debug-and-release Build two versions, with and without debugging turned on (mac only). --no-separate-debug-info Do not store debug information in a separate file (default for mac). --separate-debug-info Strip debug information into a separate .debug file (default for non-mac). --universal Build with Mac universal binary support. --mac-sdk=[path] Path to Mac universal SDK (PPC host only). --plugins-path=[path] Path to install to. Default: qtdir/pluginsDependency options: --with-qca=[path] Specify path to QCA tree, mainly for building against an uninstalled QCA. --with-openssl-inc=[path] Path to OpenSSL include files --with-openssl-lib=[path] Path to OpenSSL library filesEOT}# which/make detection adapted from Qtwhich_command() { OLD_HOME=$HOME HOME=/dev/null export HOME WHICH=`which which 2>/dev/null` if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then WHICH=which elif [ -z "$WHICH" ]; then if which which >/dev/null 2>&1; then WHICH=which else for a in /usr/ucb /usr/bin /bin /usr/local/bin; do if [ -x $a/which ]; then WHICH=$a/which break; fi done fi fi if [ -z "$WHICH" ]; then OLD_IFS=$IFS IFS=: for a in $PATH; do if [ -x $a/$1 ]; then echo "$a/$1" IFS=$OLD_IFS export IFS HOME=$OLD_HOME export HOME return 0 fi done IFS=$OLD_IFS export IFS else a=`"$WHICH" "$1" 2>/dev/null` if [ ! -z "$a" -a -x "$a" ]; then echo "$a" HOME=$OLD_HOME export HOME return 0 fi fi HOME=$OLD_HOME export HOME return 1}WHICH=which_command# find a make commandif [ -z "$MAKE" ]; then MAKE= for mk in gmake make; do if $WHICH $mk >/dev/null 2>&1; then MAKE=`$WHICH $mk` break fi done if [ -z "$MAKE" ]; then echo "You don't seem to have 'make' or 'gmake' in your PATH." echo "Cannot proceed." exit 1 fifishow_qt_info() { printf "Be sure you have a proper Qt 4.0 build environment set up. This means not\n" printf "just Qt, but also a C++ compiler, a make tool, and any other packages\n" printf "necessary for compiling C++ programs.\n" printf "\n" printf "If you are certain everything is installed, then it could be that Qt 4 is not\n" printf "being recognized or that a different version of Qt is being detected by\n" printf "mistake (for example, this could happen if \$QTDIR is pointing to a Qt 3\n" printf "installation). At least one of the following conditions must be satisfied:\n" printf "\n" printf " 1) --qtdir is set to the location of Qt\n" printf " 2) \$QTDIR is set to the location of Qt\n" printf " 3) QtCore is in the pkg-config database\n" printf " 4) qmake is in the \$PATH\n" printf "\n" printf "This script will use the first one it finds to be true, checked in the above\n" printf "order. #3 and #4 are the recommended options. #1 and #2 are mainly for\n" printf "overriding the system configuration.\n" printf "\n"}while [ $# -gt 0 ]; do optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` case "$1" in --qtdir=*) EX_QTDIR=$optarg shift ;; --static) QC_STATIC="Y" shift ;; --release) QC_RELEASE="Y" shift ;; --debug) QC_DEBUG="Y" shift ;; --debug-and-release) QC_DEBUG_AND_RELEASE="Y" shift ;; --no-separate-debug-info) QC_NO_SEPARATE_DEBUG_INFO="Y" shift ;; --separate-debug-info) QC_SEPARATE_DEBUG_INFO="Y" shift ;; --universal) QC_UNIVERSAL="Y" shift ;; --mac-sdk=*) QC_MAC_SDK=$optarg shift ;; --plugins-path=*) QC_PLUGINS_PATH=$optarg shift ;; --with-qca=*) QC_WITH_QCA=$optarg shift ;; --with-openssl-inc=*) QC_WITH_OPENSSL_INC=$optarg shift ;; --with-openssl-lib=*) QC_WITH_OPENSSL_LIB=$optarg shift ;; --verbose) QC_VERBOSE="Y" shift ;; --help) show_usage; exit ;; *) show_usage; exit ;; esacdoneecho "Configuring qca-ossl ..."if [ "$QC_VERBOSE" = "Y" ]; thenechoecho EX_QTDIR=$EX_QTDIRecho QC_STATIC=$QC_STATICecho QC_RELEASE=$QC_RELEASEecho QC_DEBUG=$QC_DEBUGecho QC_DEBUG_AND_RELEASE=$QC_DEBUG_AND_RELEASEecho QC_NO_SEPARATE_DEBUG_INFO=$QC_NO_SEPARATE_DEBUG_INFOecho QC_SEPARATE_DEBUG_INFO=$QC_SEPARATE_DEBUG_INFOecho QC_UNIVERSAL=$QC_UNIVERSALecho QC_MAC_SDK=$QC_MAC_SDKecho QC_PLUGINS_PATH=$QC_PLUGINS_PATHecho QC_WITH_QCA=$QC_WITH_QCAecho QC_WITH_OPENSSL_INC=$QC_WITH_OPENSSL_INCecho QC_WITH_OPENSSL_LIB=$QC_WITH_OPENSSL_LIBechofiprintf "Verifying Qt 4 build environment ... "# run qmake -v and check versionqmake_check_v4() { if [ -x "$1" ]; then if echo `$1 -v 2>&1` | grep "Qt version 4\." >/dev/null 2>&1; then return 0 elif [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: $1 not for Qt 4" fi fi return 1}if [ "$QC_VERBOSE" = "Y" ]; then echofiqm=""names="qmake-qt4 qmake4 qmake"# qt4 check: --qtdirif [ -z "$qm" ] && [ ! -z "$EX_QTDIR" ]; then for n in $names; do qstr=$EX_QTDIR/bin/$n if qmake_check_v4 "$qstr"; then qm=$qstr break; fi donefiif [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: qmake not found via --qtdir"fi# qt4 check: QTDIRif [ -z "$qm" ] && [ ! -z "$QTDIR" ]; then for n in $names; do qstr=$QTDIR/bin/$n if qmake_check_v4 "$qstr"; then qm=$qstr break; fi donefiif [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: qmake not found via \$QTDIR"fi# qt4 check: pkg-configif [ -z "$qm" ]; then str=`pkg-config QtCore --variable=exec_prefix 2>/dev/null` if [ ! -z "$str" ]; then for n in $names; do qstr=$str/bin/$n if qmake_check_v4 "$qstr"; then qm=$qstr break; fi done fifiif [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: qmake not found via pkg-config"fi# qt4 check: PATHif [ -z "$qm" ]; then for n in $names; do qstr=`$WHICH $n 2>/dev/null` if qmake_check_v4 "$qstr"; then qm=$qstr break; fi donefiif [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: qmake not found via \$PATH"fiif [ -z "$qm" ]; then if [ "$QC_VERBOSE" = "Y" ]; then echo " -> fail" else echo "fail" fi printf "\n" printf "Reason: Unable to find the 'qmake' tool for Qt 4.\n" printf "\n" show_qt_info exit 1;fiif [ "$QC_VERBOSE" = "Y" ]; then echo qmake found in $qmfigen_files() {cat >$1/modules.cpp <<EOT#line 1 "buildmode.qcm"/*-----BEGIN QCMOD-----name: buildmodesection: projectarg: release,Build with debugging turned off (default).arg: debug,Build with debugging turned on.arg: debug-and-release,Build two versions, with and without debugging turned on (mac only).arg: no-separate-debug-info,Do not store debug information in a separate file (default for mac).arg: separate-debug-info,Strip debug information into a separate .debug file (default for non-mac).-----END QCMOD-----arg: no-framework,Do not build as a Mac framework (default).arg: framework,Build as a Mac framework.*/#define QC_BUILDMODEbool qc_buildmode_release = false;bool qc_buildmode_debug = false;bool qc_buildmode_framework = false;bool qc_buildmode_separate_debug_info = false;class qc_buildmode : public ConfObj{public: qc_buildmode(Conf *c) : ConfObj(c) {} QString name() const { return "buildmode"; } QString shortname() const { return "buildmode"; } // no output QString checkString() const { return QString(); } bool exec() { // first, parse out the options bool opt_release = false; bool opt_debug = false; bool opt_debug_and_release = false; //bool opt_no_framework = false; //bool opt_framework = false; bool opt_no_separate_debug_info = false; bool opt_separate_debug_info = false; if(conf->getenv("QC_RELEASE") == "Y") opt_release = true; if(conf->getenv("QC_DEBUG") == "Y") opt_debug = true; if(conf->getenv("QC_DEBUG_AND_RELEASE") == "Y") opt_debug_and_release = true; //if(conf->getenv("QC_NO_FRAMEWORK") == "Y") // opt_no_framework = true; //if(conf->getenv("QC_FRAMEWORK") == "Y") // opt_framework = true; if(conf->getenv("QC_NO_SEPARATE_DEBUG_INFO") == "Y") opt_no_separate_debug_info = true; if(conf->getenv("QC_SEPARATE_DEBUG_INFO") == "Y") opt_separate_debug_info = true;#ifndef Q_OS_MAC if(opt_debug_and_release) { printf("\nError: The --debug-and-release option is for mac only.\n"); exit(1); }#endif // sanity check exclusive options int x; // build mode x = 0; if(opt_release) ++x; if(opt_debug) ++x; if(opt_debug_and_release) ++x; if(x > 1) { printf("\nError: Use only one of --release, --debug, or --debug-and-release.\n"); exit(1); } // framework /*x = 0; if(opt_no_framework) ++x; if(opt_framework) ++x; if(x > 1) { printf("\nError: Use only one of --framework or --no-framework.\n"); exit(1); }*/ // debug info x = 0; if(opt_no_separate_debug_info) ++x; if(opt_separate_debug_info) ++x; if(x > 1) { printf("\nError: Use only one of --separate-debug-info or --no-separate-debug-info\n"); exit(1); } // now process the options if(opt_release) qc_buildmode_release = true; else if(opt_debug) qc_buildmode_debug = true; else if(opt_debug_and_release) { qc_buildmode_release = true; qc_buildmode_debug = true; } else // default qc_buildmode_release = true; /*if(opt_framework) qc_buildmode_framework = true; else if(opt_no_framework) { // nothing to do } else // default { // nothing to do }*/ if(opt_separate_debug_info) qc_buildmode_separate_debug_info = true; else if(opt_no_separate_debug_info) { // nothing to do } else // default {#ifndef Q_OS_MAC qc_buildmode_separate_debug_info = true;#endif } // make the string QStringList opts; if(qc_buildmode_release && qc_buildmode_debug) { opts += "debug_and_release"; opts += "build_all"; } else if(qc_buildmode_release) opts += "release"; else // qc_buildmode_debug opts += "debug"; //if(qc_buildmode_framework) // opts += "lib_bundle"; if(qc_buildmode_separate_debug_info) opts += "separate_debug_info"; QString str = QString("CONFIG += ") + opts.join(" ") + '\n'; conf->addExtra(str); return true; }};#line 1 "universal.qcm"/*-----BEGIN QCMOD-----name: Mac universal binary supportsection: projectarg: universal,Build with Mac universal binary support.arg: mac-sdk=[path],Path to Mac universal SDK (PPC host only).-----END QCMOD-----*/#define QC_UNIVERSALbool qc_universal_enabled = false;QString qc_universal_sdk;//----------------------------------------------------------------------------// qc_universal//----------------------------------------------------------------------------class qc_universal : public ConfObj{public: qc_universal(Conf *c) : ConfObj(c) {} QString name() const { return "Mac universal binary support"; } QString shortname() const { return "universal"; } QString checkString() const { return QString(); } bool exec() {#ifdef Q_OS_MAC if(qc_getenv("QC_UNIVERSAL") == "Y") { qc_universal_enabled = true; QString str = "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n" " CONFIG += x86 ppc\n" "}\n"; QString sdk = qc_getenv("QC_MAC_SDK"); if(!sdk.isEmpty()) { str += QString("QMAKE_MAC_SDK = %1\n").arg(sdk); qc_universal_sdk = sdk; } conf->addExtra(str); }#endif return true; }};#line 1 "qca.qcm"/*-----BEGIN QCMOD-----name: QCA >= 2.0arg: with-qca=[path],Specify path to QCA tree, mainly for building against an uninstalled QCA.-----END QCMOD-----*/// based on crypto.prf. any changes made to that file need to be tracked here.static QString internal_crypto_prf(const QString &incdir, const QString &libdir){ QString out = QString( "CONFIG *= qt\n" "INCLUDEPATH += %1/QtCrypto\n" "LIBS += -L%2\n" "\n" "LINKAGE = -lqca\n" "CONFIG(debug, debug|release) {\n" " windows:LINKAGE = -lqcad\n" " mac:LINKAGE = -lqca_debug\n" "}\n" "LIBS += \$\$LINKAGE\n" ).arg(incdir, libdir); return out;}//----------------------------------------------------------------------------// qc_qca//----------------------------------------------------------------------------class qc_qca : public ConfObj{public: qc_qca(Conf *c) : ConfObj(c) {} QString name() const { return "QCA >= 2.0"; } QString shortname() const { return "qca"; } bool exec() { // get the build mode#ifdef BUILDMODE bool release = buildmode_release; bool debug = buildmode_debug;#else // else, default to just release mode bool release = true; bool debug = false;#endif // test for "crypto" feature and check qca version number QString qca_prefix, qca_incdir, qca_libdir, qca_crypto_prf; qca_prefix = conf->getenv("QC_WITH_QCA"); QString proextra; if(!qca_prefix.isEmpty()) { qca_incdir = qca_prefix + "/include"; qca_libdir = qca_prefix + "/lib"; qca_crypto_prf = internal_crypto_prf(qca_incdir, qca_libdir); proextra = "CONFIG += qt\n"
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -