Hello community, here is the log from the commit of package qconf for openSUSE:Factory checked in at 2018-01-16 09:42:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qconf (Old) and /work/SRC/openSUSE:Factory/.qconf.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qconf" Tue Jan 16 09:42:29 2018 rev:12 rq:564192 version:20171222.61ec953300 Changes: -------- --- /work/SRC/openSUSE:Factory/qconf/qconf.changes 2016-04-30 23:31:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.qconf.new/qconf.changes 2018-01-16 09:42:31.689246531 +0100 @@ -1,0 +2,15 @@ +Sun Jan 14 14:41:48 UTC 2018 - [email protected] + +- Update to version 20171222.61ec953300: + * bump to 2.4 + * update configure + * fix for qt 5.10 + * Fix version in README + * if non-required pkgconfig dependency is found, define HAVE_PKG_$PKGNAME + * More careful packaging / avoid inclusion of *.o + * Don't fail on recongnized options. Just show warning + * Configure regenerated with new version + * remove delta project references from readme + * Fix configure on GNU Hurd + +------------------------------------------------------------------- Old: ---- qconf-20160309.61a9b87f4f.tar.xz New: ---- _servicedata qconf-20171222.61ec953300.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qconf.spec ++++++ --- /var/tmp/diff_new_pack.kfimib/_old 2018-01-16 09:42:32.261219758 +0100 +++ /var/tmp/diff_new_pack.kfimib/_new 2018-01-16 09:42:32.265219571 +0100 @@ -20,11 +20,11 @@ %define with_qt5 1 %endif -%define version_unconverted 20160309.61a9b87f4f +%define version_unconverted 20171222.61ec953300 Name: qconf Url: http://delta.affinix.com/qconf/ -Version: 20160309.61a9b87f4f +Version: 20171222.61ec953300 Release: 0 Summary: Configuration tool for qmake License: GPL-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.kfimib/_old 2018-01-16 09:42:32.313217325 +0100 +++ /var/tmp/diff_new_pack.kfimib/_new 2018-01-16 09:42:32.313217325 +0100 @@ -1,15 +1,16 @@ <services> - <service mode="localonly" name="tar_scm"> + <service mode="disabled" name="tar_scm"> <param name="url">git://github.com/psi-plus/qconf.git</param> <param name="scm">git</param> <param name="exclude">configure.exe</param> <param name="filename">qconf</param> - <param name="versionformat">%ad.%h</param> + <param name="changesgenerate">enable</param> + <param name="versionformat">%cd.%h</param> </service> - <service mode="localonly" name="recompress"> + <service mode="disabled" name="recompress"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> - <service mode="localonly" name="set_version"> + <service mode="disabled" name="set_version"> </service> </services> ++++++ _servicedata ++++++ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/psi-plus/qconf.git</param> <param name="changesrevision"></param></service></servicedata> ++++++ qconf-20160309.61a9b87f4f.tar.xz -> qconf-20171222.61ec953300.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/README.md new/qconf-20171222.61ec953300/README.md --- old/qconf-20160309.61a9b87f4f/README.md 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/README.md 2017-12-22 07:23:12.000000000 +0100 @@ -1,9 +1,7 @@ -QConf v2.0 +QConf v2.4 ========== Authors: Justin Karneges <[email protected]>, Sergey Ilinykh <[email protected]>, Ivan Romanov <[email protected]> -Mailing List: Delta Project <[email protected]> -Website: http://delta.affinix.com/qconf/ QConf allows you to have a nice configure script for your qmake-based project. It is intended for developers who don't need (or want) to use the more complex GNU autotools. QConf also generates a configure.exe program for use on Windows. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/conf/conf4.cpp new/qconf-20171222.61ec953300/conf/conf4.cpp --- old/qconf-20160309.61a9b87f4f/conf/conf4.cpp 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/conf/conf4.cpp 2017-12-22 07:23:12.000000000 +0100 @@ -10,6 +10,12 @@ #include <stdio.h> #include <stdlib.h> +#include <limits.h> +#ifndef PATH_MAX +# ifdef Q_OS_WIN +# define PATH_MAX 260 +# endif +#endif class MocTestObject : public QObject { @@ -185,7 +191,9 @@ bool escaped = false; QChar quote, backslash = QLatin1Char('\\'); QString buf; +#ifdef PATH_MAX buf.reserve(PATH_MAX); +#endif for (int i=0; i < flags.length(); i++) { if (searchStart && flags[i].isSpace()) { continue; @@ -423,6 +431,10 @@ conf->addLib(libs); //if(!other.isEmpty()) // conf->addExtra(QString("QMAKE_CFLAGS += %1\n").arg(other)); + + if(!required) + conf->addDefine("HAVE_PKG_" + qc_escapeArg(pkgname).toUpper()); + return true; } }; @@ -996,6 +1008,7 @@ QString str; str += "# qconf\n\n"; + str += "greaterThan(QT_MAJOR_VERSION, 4):CONFIG += c++11\n"; QString var; var = qc_normalize_path(qc_getenv("PREFIX")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/configure new/qconf-20171222.61ec953300/configure --- old/qconf-20160309.61a9b87f4f/configure 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/configure 2017-12-22 07:23:12.000000000 +0100 @@ -14,9 +14,9 @@ --bindir=[path] Directory for binaries. Default: PREFIX/bin --datadir=[path] Directory for data. Default: PREFIX/share --qtdir=[path] Directory where Qt is installed. - --extraconf=[conf] Extra configuration for nonstandard cases + --extraconf=[conf] Extra configuration for nonstandard cases. --verbose Show extra configure output. - --qtselect=[N] Select major Qt verion (4 or 5). + --qtselect=[N] Select major Qt version (4 or 5). --help This help text. EOT @@ -44,7 +44,7 @@ for a in /usr/ucb /usr/bin /bin /usr/local/bin; do if [ -x $a/which ]; then WHICH=$a/which - break; + break fi done fi @@ -93,11 +93,11 @@ fi show_qt_info() { - printf "Be sure you have a proper Qt 4.0 build environment set up. This means not\n" + 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 "If you are certain everything is installed, then it could be that Qt 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" @@ -150,7 +150,7 @@ shift ;; --help) show_usage; exit ;; - *) show_usage; exit 1;; + *) echo "configure: WARNING: unrecognized options: $1" >&2; shift; ;; esac done @@ -170,22 +170,42 @@ echo fi -printf "Verifying Qt 4 build environment ... " +printf "Verifying Qt build environment ... " -[ -z "$QC_QTSELECT" ] && QC_QTSELECT="$QT_SELECT" -QTSEARCHTTEXT="$QC_QTSELECT" -[ -z "$QC_QTSELECT" ] && QTSEARCHTTEXT="4 or 5" +if [ -z "$QC_QTSELECT" ]; then + QC_QTSELECT="$(echo $QT_SELECT | tr -d "qt")" +fi -# run qmake -v and check version -qmake_check_v4() { +if [ ! -z "$QC_QTSELECT" ]; then + QTSEARCHTEXT="$QC_QTSELECT" +else + QTSEARCHTEXT="4 or 5" +fi + +# run qmake and check version +qmake_check() { if [ -x "$1" ]; then - local v=`"$1" -query QT_VERSION 2>&1` - vmaj="${v%%.*}" - case "${v}" in ?.?.?) [ -z "$QC_QTSELECT" ] && [ "$vmaj" = 4 -o "$vmaj" = 5 ] && return 0; - [ -n "$QC_QTSELECT" ] && [ "$vmaj" = "$QC_QTSELECT" ] && return 0; ;; + cmd="\"$1\" -query QT_VERSION" + if [ "$QC_VERBOSE" = "Y" ]; then + echo "running: $cmd" + fi + vout=`/bin/sh -c "$cmd" 2>&1` + case "${vout}" in + *.*.*) + vmaj="${vout%%.*}" + if [ ! -z "$QC_QTSELECT" ]; then + if [ "$vmaj" = "$QC_QTSELECT" ]; then + return 0 + fi + else + if [ "$vmaj" = "4" ] || [ "$vmaj" = "5" ]; then + return 0 + fi + fi + ;; esac if [ "$QC_VERBOSE" = "Y" ]; then - echo "Warning: $1 not for Qt ${QTSEARCHTTEXT}" + echo "Warning: $1 not for Qt ${QTSEARCHTEXT}" fi fi return 1 @@ -202,17 +222,20 @@ if [ -z "$QC_QTSELECT" ]; then names="${qt5_names} ${qt4_names} $names" else - [ "$QC_QTSELECT" = "4" ] && names="${qt4_names} $names" - [ "$QC_QTSELECT" -ge "5" ] && names="${qt5_names} $names" + if [ "$QC_QTSELECT" = "4" ]; then + names="${qt4_names} $names" + elif [ "$QC_QTSELECT" -ge "5" ]; then + names="${qt5_names} $names" + fi fi if [ -z "$qm" ] && [ ! -z "$EX_QTDIR" ]; then # qt4 check: --qtdir for n in $names; do qstr=$EX_QTDIR/bin/$n - if qmake_check_v4 "$qstr"; then + if qmake_check "$qstr"; then qm=$qstr - break; + break fi done if [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then @@ -223,9 +246,9 @@ # qt4 check: QTDIR for n in $names; do qstr=$QTDIR/bin/$n - if qmake_check_v4 "$qstr"; then + if qmake_check "$qstr"; then qm=$qstr - break; + break fi done if [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then @@ -233,34 +256,51 @@ fi else - # Try all other implicit checks # qtchooser if [ -z "$qm" ]; then qtchooser=$($WHICH qtchooser 2>/dev/null) if [ ! -z "$qtchooser" ]; then - cmd="$qtchooser -run-tool=qmake -qt=${QC_QTSELECT}" - qtbins="$($cmd -query QT_INSTALL_BINS 2>/dev/null)" - if [ -n "$qtbins" ] && qmake_check_v4 "$qtbins/qmake"; then - qm="$qtbins/qmake" - break; + if [ ! -z "$QC_QTSELECT" ]; then + versions="$QC_QTSELECT" + else + cmd="$qtchooser --list-versions" + if [ "$QC_VERBOSE" = "Y" ]; then + echo "running: $cmd" + fi + versions=`$cmd` fi + for version in $versions; do + cmd="$qtchooser -run-tool=qmake -qt=${version} -query QT_INSTALL_BINS" + if [ "$QC_VERBOSE" = "Y" ]; then + echo "running: $cmd" + fi + qtbins=`$cmd 2>/dev/null` + if [ ! -z "$qtbins" ] && qmake_check "$qtbins/qmake"; then + qm="$qtbins/qmake" + break + fi + done fi fi if [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then echo "Warning: qmake not found via qtchooser" fi - # qt4 check: pkg-config + # qt4: pkg-config if [ -z "$qm" ]; then - str=`pkg-config QtCore --variable=exec_prefix 2>/dev/null` + cmd="pkg-config QtCore --variable=exec_prefix" + if [ "$QC_VERBOSE" = "Y" ]; then + echo "running: $cmd" + fi + str=`$cmd 2>/dev/null` if [ ! -z "$str" ]; then for n in $names; do qstr=$str/bin/$n - if qmake_check_v4 "$qstr"; then + if qmake_check "$qstr"; then qm=$qstr - break; + break fi done fi @@ -269,17 +309,19 @@ echo "Warning: qmake not found via pkg-config" fi - # qt4 check: PATH + # qmake in PATH if [ -z "$qm" ]; then for n in $names; do qstr=`$WHICH -a $n 2>/dev/null` for q in $qstr; do - if qmake_check_v4 "$q"; then + if qmake_check "$q"; then qm="$q" - break; + break fi done - [ -n "$qm" ] && break + if [ ! -z "$qm" ]; then + break + fi done fi if [ -z "$qm" ] && [ "$QC_VERBOSE" = "Y" ]; then @@ -296,7 +338,7 @@ echo "fail" fi printf "\n" - printf "Reason: Unable to find the 'qmake' tool for Qt ${QTSEARCHTTEXT}.\n" + printf "Reason: Unable to find the 'qmake' tool for Qt ${QTSEARCHTEXT}.\n" printf "\n" show_qt_info exit 1; @@ -473,6 +515,12 @@ #include <stdio.h> #include <stdlib.h> +#include <limits.h> +#ifndef PATH_MAX +# ifdef Q_OS_WIN +# define PATH_MAX 260 +# endif +#endif class MocTestObject : public QObject { @@ -648,7 +696,9 @@ bool escaped = false; QChar quote, backslash = QLatin1Char('\\\\'); QString buf; +#ifdef PATH_MAX buf.reserve(PATH_MAX); +#endif for (int i=0; i < flags.length(); i++) { if (searchStart && flags[i].isSpace()) { continue; @@ -886,6 +936,10 @@ conf->addLib(libs); //if(!other.isEmpty()) // conf->addExtra(QString("QMAKE_CFLAGS += %1\\n").arg(other)); + + if(!required) + conf->addDefine("HAVE_PKG_" + qc_escapeArg(pkgname).toUpper()); + return true; } }; @@ -1459,6 +1513,7 @@ QString str; str += "# qconf\\n\\n"; + str += "greaterThan(QT_MAJOR_VERSION, 4):CONFIG += c++11\\n"; QString var; var = qc_normalize_path(qc_getenv("PREFIX")); @@ -1539,6 +1594,8 @@ DEFINES += HAVE_MODULES +greaterThan(QT_MAJOR_VERSION, 4):CONFIG += c++11 + EOT } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/package.sh new/qconf-20171222.61ec953300/package.sh --- old/qconf-20160309.61a9b87f4f/package.sh 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/package.sh 2017-12-22 07:23:12.000000000 +0100 @@ -9,6 +9,8 @@ VERSION=$1 mkdir -p build/qconf-$VERSION -cp -a AUTHORS COPYING README.md TODO conf configure configure.exe examples modules qconf.* src build/qconf-$VERSION +cp -a AUTHORS COPYING README.md TODO conf configure configure.exe examples modules qconf.pro qconf.qc src build/qconf-$VERSION cd build -tar jcvf qconf-$VERSION.tar.bz2 qconf-$VERSION +tar Jcvf qconf-$VERSION.tar.xz qconf-$VERSION + +echo; echo Packed $(pwd)/qconf-$VERSION.tar.xz diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/qconf.pro new/qconf-20171222.61ec953300/qconf.pro --- old/qconf-20160309.61a9b87f4f/qconf.pro 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/qconf.pro 2017-12-22 07:23:12.000000000 +0100 @@ -16,10 +16,19 @@ } !isEmpty(CXXFLAGS) { + QMAKE_CXXFLAGS = $$CXXFLAGS QMAKE_CXXFLAGS_DEBUG = $$CXXFLAGS QMAKE_CXXFLAGS_RELEASE = $$CXXFLAGS } +isEmpty(LDFLAGS) { + LDFLAGS=$$(LDFLAGS) +} + +!isEmpty(LDFLAGS) { + QMAKE_LFLAGS = $$LDFLAGS +} + !isEmpty(DATADIR) { contains($$list($$[QT_VERSION]), 4.0.*|4.1.*) { DEFINES += DATADIR=\"$$DATADIR\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/src/configexe/README.txt new/qconf-20171222.61ec953300/src/configexe/README.txt --- old/qconf-20160309.61a9b87f4f/src/configexe/README.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/qconf-20171222.61ec953300/src/configexe/README.txt 2017-12-22 07:23:12.000000000 +0100 @@ -0,0 +1,2 @@ +1. Install mingw32 +2. gcc embed.c configexe.c -static-libgcc -o configexe_stub.exe \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/src/configexe/configexe.c new/qconf-20171222.61ec953300/src/configexe/configexe.c --- old/qconf-20160309.61a9b87f4f/src/configexe/configexe.c 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/src/configexe/configexe.c 2017-12-22 07:23:12.000000000 +0100 @@ -13,6 +13,7 @@ #include <sys/stat.h> #include <errno.h> //#include <unistd.h> +#include <limits.h> #include "embed.h" #if defined(WIN32) || defined(_WIN32) @@ -42,6 +43,8 @@ static char *libdir = NULL; static char *datadir = NULL; +static int run_buffer_stdout(const char *command, char *out_buf, size_t buf_size); + enum ArgType { ArgValue, @@ -356,6 +359,9 @@ #else str = append_free(str, "/qmake"); #endif + if (qc_verbose) { + printf("Check if \"%s\" exists\n", str); + } if(file_exists(str)) { return str; @@ -367,38 +373,62 @@ } } +static int qmake_query(const char *qmake_path, const char *var, char *out_buf, size_t buf_size) +{ + char command[PATH_MAX]; + int cnt = snprintf(command, sizeof(command) - 1, "%s -query %s", qmake_path, var); + if (cnt > 0 && cnt < (int)sizeof(command)) + { + command[sizeof(command) - 1] = '\0'; // To be sure line has null-terminator + return run_buffer_stdout(command, out_buf, buf_size); + } + return 0; // fail +} + +static int qmake_query_maj_ver(const char *qmake_path, char *out_buf, size_t buf_size) +{ + if (qmake_query(qmake_path, "QT_VERSION", out_buf, buf_size)) { + int at = index_of(out_buf, '.'); + if (at > 0) + { + out_buf[at] = '\0'; + return 1; + } + } + return 0; +} + +// modifies contents of spec_path and returns pointer to spec name +char *extract_spec_name(char *spec_path) +{ + char *end = spec_path; + while (!iscntrl(*end)) { + if (*end == '/') { + if (iscntrl(*(end+1))) { // next is end of line + break; + } else { + spec_path = end + 1; + end = spec_path + 1; + } + } else + end++; + } + *end = 0; + return spec_path; +} + int check_qtversion(char *path, char *version) { - FILE *file; int res = 0; if (version) { - char command[PATH_MAX]; - int cnt = snprintf(command, sizeof(command) - 1, "%s -query QT_VERSION", path); - if (cnt > 0 && cnt < (int)sizeof(command)) - { - command[sizeof(command) - 1] = '\0'; // To be sure line has null-terminator - file = popen(command, "r"); - if (file) + char buf[20]; // version string output always small + if (qmake_query_maj_ver(path, buf, sizeof(buf))) { + res = !strcmp(version, buf); + if (!res && qc_verbose) { - char buf[20]; // version string output always small - if (fread(buf, 1, sizeof(buf), file) > 0) - { - buf[sizeof(buf) - 1] = '\0'; - int at = index_of(buf, '.'); - if (at > 0) - { - // Compare major version - buf[at] = '\0'; - res = !strcmp(version, buf); - if (!res && qc_verbose) - { - printf("Warning: %s not for Qt %s\n", path, qtsearchtext); - } - } - } - pclose(file); + printf("Warning: %s not for Qt %s\n", path, qtsearchtext); } } } @@ -410,6 +440,23 @@ return res; } +static char* parse_qtselect(char *src) +{ + unsigned long int ver; + if (src) { + if (src[0] == 'q' && src[1] == 't') + src += 2; + + ver = strtoul(src, NULL, 10); + if (ver > 0 && ver < ULONG_MAX) { + qc_qtselect = strdup(src); + qtsearchtext = qc_qtselect; + return qc_qtselect; + } + } + return NULL; +} + static char *find_qmake() { char *qtdir; @@ -417,11 +464,7 @@ char try_syspath = 1; if (!qc_qtselect) - { - qc_qtselect = strdup(get_envvar("QT_SELECT")); - if (qc_qtselect) - qtsearchtext = qc_qtselect; - } + parse_qtselect(get_envvar("QT_SELECT")); qtdir = ex_qtdir; @@ -490,6 +533,28 @@ return NULL; } +static int run_buffer_stdout(const char *command, char *out_buf, size_t buf_size) +{ + FILE *file; + + file = popen(command, "r"); + if (file) + { + size_t bytes_left = buf_size - 1; // 1 for null terminator + size_t bytes_read; + while (bytes_left && (bytes_read = fread(out_buf, 1, bytes_left, file)) > 0) + bytes_left -= bytes_read; + + out_buf[buf_size - bytes_left - 1] = '\0'; + pclose(file); + + return 1; // ok + } + + out_buf[0] = 0; // just in case + return 0; // fail +} + static int run_silent_stdout(const char *cmd) { char *str; @@ -535,6 +600,8 @@ #else str = append_free(str, " >../conf.log 2>&1"); #endif + if (qc_verbose) + printf("Starting \"%s\"\n", str); ret = system(str); free(str); @@ -656,31 +723,50 @@ str = strdup(makecmd); str = append_free(str, " clean"); - ret = run_silent_all(str); + ret = run_conflog_all(str); free(str); if(ret != 0) return 0; - if(run_conflog_all(makecmd) != 0) + if(run_conflog_all(makecmd) != 0) { + if (qc_verbose) + printf("\"%s\" failed\n", makecmd); return 0; + } *maketool = strdup(makecmd); return 1; } -static char *maketool_list[] = +static char *maketool_list_common[] = +{ + "mingw32-make", + "make", + "jom", + "nmake", + NULL +}; + +static char *maketool_list_mingw[] = { "make", "mingw32-make", + NULL +}; + +static char *maketool_list_vs[] = +{ + "jom", "nmake", NULL }; -static int do_conf_create(qcdata_t *q, const char *qmake_path, char **maketool) +static int do_conf_create(qcdata_t *q, const char *qmake_path, const char *spec, char **maketool) { char *str; int n; int at; + char **maketool_list; if(!qc_ensuredir(qconftemp_path)) return 0; @@ -703,6 +789,13 @@ free(str); at = -1; + if (strstr(spec, "win32-msvc")) { + maketool_list = maketool_list_vs; + } else if(strstr(spec, "win32-g++")) { + maketool_list = maketool_list_mingw; + } else { + maketool_list = maketool_list_common; + } for(n = 0; maketool_list[n]; ++n) { if(qc_verbose) @@ -753,6 +846,8 @@ { char *qmake_path; char *maketool; + int qt_maj_version = 0; + char *specs_name = NULL; int n; int ret; @@ -787,13 +882,75 @@ if(qc_verbose) printf("qmake found in %s\n", qmake_path); + // figure out what version it is. + { + char buf[20]; // version string output always small + if (qmake_query_maj_ver(qmake_path, buf, sizeof(buf))) { + qt_maj_version = strtoul(buf, NULL, 10); + if (qt_maj_version == ULONG_MAX) + qt_maj_version = 0; + } + if (qt_maj_version == 0) { + if(qc_verbose) { + printf(" -> fail\n"); + printf("Qt major version is not parsable\n"); + } else + printf("fail\n"); + free(qmake_path); + return 0; + } + } + + // find specc name + { + char *spec = get_envvar("QMAKESPEC"); + if (!spec) { + // try to find default spec + if (qt_maj_version > 4) { + char buf[32]; + if (qmake_query(qmake_path, "QMAKE_XSPEC", buf, sizeof(buf))) // or QMAKE_SPEC ? + specs_name = strdup(buf); + // it's possible to compute full path like QT_HOST_DATA/QMAKE_XSPEC + } else { + char *qmake_conf, buf[1024]; + FILE *fp; + qmake_query(qmake_path, "QMAKE_MKSPECS", buf, sizeof(buf)); + qmake_conf = append_free(strdup(buf), "/default/qmake.conf"); + fp = fopen(qmake_conf, "r"); + free(qmake_conf); + if (fp) { + size_t br; + if ((br = fread(buf, 1, sizeof(buf) - 1, fp)) > 0) { + char *str, *end; + buf[br] = 0; + str = strstr(buf, "QMAKESPEC_ORIGINAL="); + if (str) { + str = extract_spec_name(str); + if (str) { + specs_name = strdup(str); + } + } + } + fclose(fp); + } + } + } else { + char *s = strdup(spec); + specs_name = extract_spec_name(s); + if (specs_name) { + specs_name = strdup(specs_name); + } + free(s); + } + } + // TODO: in verbose mode, print out default makespec and what we're // overriding the makespec to (if any). since at this time we don't // ever override the makespec on windows, we don't need this yet. cleanup_qconftemp(); maketool = NULL; - if(!do_conf_create(q, qmake_path, &maketool)) + if(!do_conf_create(q, qmake_path, specs_name, &maketool)) { cleanup_qconftemp(); if(qc_verbose) @@ -944,10 +1101,7 @@ else if(strcmp(var, "qtselect") == 0) { if (val && strlen(val)) - { - qc_qtselect = strdup(val); - qtsearchtext = qc_qtselect; - } + qc_qtselect = parse_qtselect(val); } else { Binary files old/qconf-20160309.61a9b87f4f/src/configexe/configexe_stub.exe and new/qconf-20171222.61ec953300/src/configexe/configexe_stub.exe differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qconf-20160309.61a9b87f4f/src/qconf.cpp new/qconf-20171222.61ec953300/src/qconf.cpp --- old/qconf-20160309.61a9b87f4f/src/qconf.cpp 2016-04-21 14:39:18.000000000 +0200 +++ new/qconf-20171222.61ec953300/src/qconf.cpp 2017-12-22 07:23:12.000000000 +0100 @@ -747,7 +747,7 @@ " shift\n" " ;;\n" " --help) show_usage; exit ;;\n" - " *) show_usage; exit 1;;\n" + " *) echo \"configure: WARNING: unrecognized options: $1\" >&2; shift; ;;\n" " esac\n" "done\n\n"; @@ -767,7 +767,7 @@ { QString str = "if [ -z \"$QC_QTSELECT\" ]; then\n" - " QC_QTSELECT=\"$QT_SELECT\"\n" + " QC_QTSELECT=\"$(echo $QT_SELECT | tr -d \"qt\")\"\n" "fi\n" "\n" "if [ ! -z \"$QC_QTSELECT\" ]; then\n" @@ -785,7 +785,7 @@ " fi\n" " vout=`/bin/sh -c \"$cmd\" 2>&1`\n" " case \"${vout}\" in\n" - " ?.?.?)\n" + " *.*.*)\n" " vmaj=\"${vout%%.*}\"\n" " if [ ! -z \"$QC_QTSELECT\" ]; then\n" " if [ \"$vmaj\" = \"$QC_QTSELECT\" ]; then\n" @@ -1533,6 +1533,7 @@ QByteArray confpro = f.readAll(); f.close(); confpro += "\nDEFINES += HAVE_MODULES\n"; + confpro += "\ngreaterThan(QT_MAJOR_VERSION, 4):CONFIG += c++11\n"; printf("Project name: %s\n", qPrintable(conf.name)); printf("Profile: %s\n", qPrintable(conf.profile));
