summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-04-30 14:28:12 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-04-30 15:02:43 (GMT)
commitc693b4f8f38c435beffe1deb6186912123cd05f9 (patch)
treeb47c1019da25c2b812a8ce205d813526df7e214a
parent00c17e9b630366121116e360cd907c66dffd8fe6 (diff)
downloadQt-c693b4f8f38c435beffe1deb6186912123cd05f9.zip
Qt-c693b4f8f38c435beffe1deb6186912123cd05f9.tar.gz
Qt-c693b4f8f38c435beffe1deb6186912123cd05f9.tar.bz2
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
-rw-r--r--mkspecs/features/symbian/symbian_building.prf10
-rw-r--r--qmake/project.cpp46
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<QString, QStringList> &values) { execute(values); }
-
- void execute(QMakeProject *p) { execute(p->variables()); }
- void execute(const QMap<QString, QStringList> &values) {
-#ifdef Q_OS_UNIX
- for(QMap<QString, QStringList>::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<QStringList> 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<QStringList> args_list, QMap<QSt
}
}
return false; }
- case T_SYSTEM: {
- bool setup_env = true;
+ case T_SYSTEM:
if(args.count() < 1 || args.count() > 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<QStringList> args_list, QMap<QSt
}
if(args.count() == 2) {
const QString sarg = args[1];
- setup_env = (sarg.toLower() == "true" || sarg.toInt());
+ if (sarg.toLower() == "true" || sarg.toInt())
+ warn_msg(WarnParser, "%s:%d: system()'s second argument is now hard-wired to false.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
}
- QMakeProjectEnv env;
- if(setup_env)
- env.execute(place);
- bool ret = system(args[0].toLatin1().constData()) == 0;
- return ret; }
+ return system(args[0].toLatin1().constData()) == 0;
case T_RETURN:
if(function_blocks.isEmpty()) {
fprintf(stderr, "%s:%d unexpected return()\n",