4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-12 18:49:34 +00:00

build system changes as per mailing list discussion, also begin centralizing plugin .qcm files

svn path=/trunk/kdesupport/qca/; revision=669674
This commit is contained in:
Justin Karneges 2007-05-30 00:53:00 +00:00
parent 6a83a7e040
commit 2036e30718
9 changed files with 35 additions and 76 deletions

@ -1,8 +1,8 @@
# prepend this file with a QCA_PREFIX definition
# prepend this file with QCA_INCDIR/QCA_LIBDIR definitions
CONFIG *= qt
INCLUDEPATH += $$QCA_PREFIX/include/QtCrypto
LIBS += -L$$QCA_PREFIX/lib
INCLUDEPATH += $$QCA_INCDIR/QtCrypto
LIBS += -L$$QCA_LIBDIR
LINKAGE = -lqca
CONFIG(debug, debug|release) {

@ -1,7 +1,8 @@
@echo off
REM install qmake feature file pointing to the current directory
echo QCA_PREFIX = %CD% > crypto.prf
echo QCA_INCDIR = %CD%\include > crypto.prf
echo QCA_LIBDIR = %CD%\lib >> crypto.prf
type crypto.prf.in >> crypto.prf
copy crypto.prf %QTDIR%\mkspecs\features

@ -1,52 +0,0 @@
/*
-----BEGIN QCMOD-----
name: buildmode
section: project
arg: release,Build with debugging turned off
arg: debug,Build with debugging turned on
arg: debug-and-release,Build two versions, with and without debugging turned on (default)
-----END QCMOD-----
*/
#define BUILDMODE
bool buildmode_release = false;
bool buildmode_debug = 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()
{
// build mode
bool release = false;
bool debug = false;
QString config_buildmode;
if(conf->getenv("QC_RELEASE") == "Y")
{
release = true;
config_buildmode = "CONFIG += release\n";
}
else if(conf->getenv("QC_DEBUG") == "Y")
{
debug = true;
config_buildmode = "CONFIG += debug\n";
}
else // if(conf->getenv("QC_DEBUG_AND_RELEASE") == "Y")
{
release = true;
debug = true;
config_buildmode = "CONFIG += debug_and_release build_all\n";
}
buildmode_release = release;
buildmode_debug = debug;
conf->addExtra(config_buildmode);
return true;
}
};

@ -54,15 +54,17 @@ public:
" unsigned long x = OPENSSL_VERSION_NUMBER;\n"
" if(x >= 0x00907000) return 0; else return 1;\n"
"}\n";
QString ext;
QStringList incs;
QString libs;
if(!inc.isEmpty())
ext += QString("-I") + inc + ' ';
incs += inc;
if(kb)
ext += QString("-I") + kbdir + ' ';
incs += kbdir;
if(!lib.isEmpty())
ext += QString("-L") + lib + " -lssl -lcrypto ";
libs += QString("-L") + lib + ' ';
libs += "-lssl -lcrypto";
int ret;
if(!conf->doCompileAndLink(str, QStringList(), ext, QString(), &ret))
if(!conf->doCompileAndLink(str, incs, libs, QString(), &ret))
return false;
if(ret == 0)
conf->addDefine("OSSL_097");

@ -6,14 +6,18 @@
<dep type='buildmode'>
<required/>
</dep>
<dep type='universal'>
<required/>
</dep>
<dep type='qca'>
<required/>
</dep>
<dep type='openssl'>
<required/>
</dep>
<dep type='extra'>
<dep type='qcapluginpath'>
<required/>
</dep>
<moddir>.</moddir>
<moddir>../../qcm</moddir>
</qconf>

1
qca.qc

@ -2,6 +2,7 @@
<name>Qt Cryptographic Architecture (QCA)</name>
<profile>qca.pro</profile>
<lib/>
<incdir/>
<libdir/>
<datadir/>
<moddir>qcm</moddir>

@ -79,6 +79,8 @@ public:
f.close();
QString prefix = conf->getenv("PREFIX");
QString incdir = conf->getenv("INCDIR");
QString libdir = conf->getenv("LIBDIR");
// write qmake-feature file
QString crypto_in;
@ -89,7 +91,8 @@ public:
f.close();
}
str = QString("QCA_PREFIX = %1\n").arg(prefix);
str = QString("QCA_INCDIR = %1\n").arg(incdir);
str += QString("QCA_LIBDIR = %1\n").arg(libdir);
str += crypto_in;
f.setFileName("crypto.prf");
@ -111,8 +114,8 @@ public:
QString pkg_template1 = QString(
"prefix=%1\n"
"exec_prefix=${prefix}\n"
"libdir=${prefix}/lib\n"
"includedir=${prefix}/include/QtCrypto\n"
"libdir=%2\n"
"includedir=%3/QtCrypto\n"
"\n");
QString pkg_template2 = QString(
@ -133,28 +136,28 @@ public:
QDir::current().mkdir("lib");
if(release)
{
str = pkg_template1.arg(prefix);
str = pkg_template1.arg(prefix, libdir, incdir);
str += pkg_template2.arg("QCA");
str += pkg_template3.arg("QtCore");
str += pkg_template4.arg("qca");
f.setFileName("lib/qca.pc");
f.setFileName("lib/qca2.pc");
if(f.open(QFile::WriteOnly | QFile::Truncate))
f.write(str.toLatin1());
f.close();
pcfiles += "lib/qca.pc";
pcfiles += "lib/qca2.pc";
}
if(debug)
{
str = pkg_template1.arg(prefix);
str = pkg_template1.arg(prefix, libdir, incdir);
str += pkg_template2.arg("QCA_debug");
str += pkg_template3.arg("QtCore_debug");
str += pkg_template4.arg("qca_debug");
f.setFileName("lib/qca_debug.pc");
f.setFileName("lib/qca2_debug.pc");
if(f.open(QFile::WriteOnly | QFile::Truncate))
f.write(str.toLatin1());
f.close();
pcfiles += "lib/qca_debug.pc";
pcfiles += "lib/qca2_debug.pc";
}
str = QString(

@ -1,15 +1,15 @@
/*
-----BEGIN QCMOD-----
name: extra
name: qcapluginpath
-----END QCMOD-----
*/
class qc_extra : public ConfObj
class qc_qcapluginpath : public ConfObj
{
public:
qc_extra(Conf *c) : ConfObj(c) {}
QString name() const { return "extra"; }
QString shortname() const { return "extra"; }
qc_qcapluginpath(Conf *c) : ConfObj(c) {}
QString name() const { return "qcapluginpath"; }
QString shortname() const { return "qcapluginpath"; }
// no output
QString checkString() const { return QString(); }