From 4a11bc034b3c85cd259a3ca75e0f495e8fd3ed83 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 11 Mar 2007 18:32:36 +0000 Subject: [PATCH] - New configure file generated by qconf v1.3 instead of v1.2 --- configure | 60 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/configure b/configure index c3ba91a6f..980022aff 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh # -# Generated by qconf 1.2 ( http://delta.affinix.com/qconf/ ) +# Generated by qconf 1.3 ( http://delta.affinix.com/qconf/ ) # show_usage() { @@ -10,11 +10,12 @@ Usage: $0 [OPTION]... This script creates necessary configuration files to build/install. Main options: - --prefix=[path] Base path for build/install. Default: /usr/local - --bindir=[path] Directory for binaries. Default: PREFIX/bin - --qtdir=[path] Directory where Qt is installed. - --verbose Show extra configure output. - --help This help text. + --prefix=[path] Base path for build/install. Default: /usr/local + --bindir=[path] Directory for binaries. Default: PREFIX/bin + --datadir=[path] Directory for data. Default: PREFIX/share + --qtdir=[path] Directory where Qt is installed. + --verbose Show extra configure output. + --help This help text. EOT } @@ -121,6 +122,11 @@ while [ $# -gt 0 ]; do shift ;; + --datadir=*) + DATADIR=$optarg + shift + ;; + --qtdir=*) EX_QTDIR=$optarg shift @@ -137,6 +143,7 @@ done PREFIX=${PREFIX:-/usr/local} BINDIR=${BINDIR:-$PREFIX/bin} +DATADIR=${DATADIR:-$PREFIX/share} echo "Configuring qbittorrent ..." @@ -144,6 +151,7 @@ if [ "$QC_DEBUG" = "Y" ]; then echo echo PREFIX=$PREFIX echo BINDIR=$BINDIR +echo DATADIR=$DATADIR echo EX_QTDIR=$EX_QTDIR echo fi @@ -574,6 +582,36 @@ int qc_runprogram(const QString &prog, const QStringList &args, QByteArray *out, */ } +bool qc_removedir(const QString &dirPath) +{ + QDir dir(dirPath); + if(!dir.exists()) + return false; + QStringList list = dir.entryList(); + foreach(QString s, list) + { + if(s == "." || s == "..") + continue; + QFileInfo fi(dir.filePath(s)); + if(fi.isDir()) + { + if(!qc_removedir(fi.filePath())) + return false; + } + else + { + if(!dir.remove(s)) + return false; + } + } + QString dirName = dir.dirName(); + if(!dir.cdUp()) + return false; + if(!dir.rmdir(dirName)) + return false; + return true; +} + void qc_splitcflags(const QString &cflags, QStringList *incs, QStringList *otherflags) { incs->clear(); @@ -873,9 +911,12 @@ bool Conf::doCompileAndLink(const QString &filedata, const QStringList &incs, co QDir::setCurrent(oldpath); // cleanup - dir.remove("atest.pro"); - dir.remove("atest.cpp"); - tmp.rmdir("atest"); + //dir.remove("atest.pro"); + //dir.remove("atest.cpp"); + //tmp.rmdir("atest"); + + // remove whole dir since distclean doesn't always work + qc_removedir(tmp.filePath("atest")); if(!ok) return false; @@ -1260,6 +1301,7 @@ EOT export PREFIX export BINDIR +export DATADIR export EX_QTDIR export QC_DEBUG rm -rf .qconftemp