From c693b4f8f38c435beffe1deb6186912123cd05f9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 30 Apr 2010 16:28:12 +0200 Subject: bye bye QMakeProjectEnv qmake variables would have been exported to the command run by $$system() and - optionally - to the command run by system(). however, this was a unix-only feature and made the kernel barf at the huge environment on older linuxes. as we don't like platform-specific hacks which are unreliable, in particular when a workaround exists (the commands execute shell code after all, so one can inject arbitrary env variables), just blow it away - it was undocumented, after all. Reviewed-by: joerg --- mkspecs/features/symbian/symbian_building.prf | 10 ------ qmake/project.cpp | 46 +++------------------------ 2 files changed, 5 insertions(+), 51 deletions(-) diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index a097771..eaa7687 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -282,13 +282,3 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { # Generated pkg files QMAKE_DISTCLEAN += $${TARGET}_template.pkg - -# Pre 2.6.23 Linux kernels have a limit on the environment size that can be passed to -# a forked process. We quite easily overstep this boundary when building big projects -# on Symbian, and since we depend on running the system() command, this causes the build -# to fail. Test here that system() can be successfully run. It is important that this -# check happens as late as possible, otherwise it will not be caught. -execve_sanity_test = $$system("echo testing") -!contains(execve_sanity_test, "testing") { - error("Running system() failed. Maybe your kernel is too old? (Linux kernels need at least version 2.6.23)") -} diff --git a/qmake/project.cpp b/qmake/project.cpp index f4933f2..998d173 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -617,38 +617,6 @@ QStringList qmake_mkspec_paths() return ret; } -class QMakeProjectEnv -{ - QStringList envs; -public: - QMakeProjectEnv() { } - QMakeProjectEnv(QMakeProject *p) { execute(p->variables()); } - QMakeProjectEnv(const QMap &values) { execute(values); } - - void execute(QMakeProject *p) { execute(p->variables()); } - void execute(const QMap &values) { -#ifdef Q_OS_UNIX - for(QMap::ConstIterator it = values.begin(); it != values.end(); ++it) { - const QString var = it.key(), val = it.value().join(" "); - if(!var.startsWith(".")) { - const QString env_var = Option::sysenv_mod + var; - if(!putenv(strdup(QString(env_var + "=" + val).toAscii().data()))) - envs.append(env_var); - } - } -#else - Q_UNUSED(values); -#endif - } - ~QMakeProjectEnv() { -#ifdef Q_OS_UNIX - for(QStringList::ConstIterator it = envs.begin();it != envs.end(); ++it) { - putenv(strdup(QString(*it + "=").toAscii().data())); - } -#endif - } -}; - QMakeProject::~QMakeProject() { if(own_prop) @@ -2097,7 +2065,6 @@ QMakeProject::doProjectExpand(QString func, QList args_list, fprintf(stderr, "%s:%d system(execut) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); } else { - QMakeProjectEnv env(place); char buff[256]; bool singleLine = true; if(args.count() > 1) @@ -2488,8 +2455,7 @@ QMakeProject::doProjectTest(QString func, QList args_list, QMap 2) { fprintf(stderr, "%s:%d: system(exec) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); @@ -2497,13 +2463,11 @@ QMakeProject::doProjectTest(QString func, QList args_list, QMap