aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 22:24:48 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 22:24:48 +0000
commit97c0fcbbef19012f825cba0fc3f16037322ce84c (patch)
tree4169f36e050f4df84280c948148f8f054c37091e /share
parent8ebc3f17961ef6a0cf708cc6bdca948d77817ee0 (diff)
downloadbuild-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.gz
build-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.bz2
build-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.xz
build-97c0fcbbef19012f825cba0fc3f16037322ce84c.zip
We're getting closer and closer, qt4 is more configurable and gets QT flags
for you for CXXFLAGS and LDFLAGS, added a bunch more stuff and fixed a strange function input bug.
Diffstat (limited to '')
-rw-r--r--share/autoinclude/general-rules.bld8
-rw-r--r--share/include/qt4.bld63
2 files changed, 64 insertions, 7 deletions
diff --git a/share/autoinclude/general-rules.bld b/share/autoinclude/general-rules.bld
index 46720c6..30a4376 100644
--- a/share/autoinclude/general-rules.bld
+++ b/share/autoinclude/general-rules.bld
@@ -78,7 +78,7 @@ rule "lib"
78rule "cpp" 78rule "cpp"
79{ 79{
80 input "*.cpp"; 80 input "*.cpp";
81 output cppToObj(); 81 output INPUT.cppToObj();
82// output replace(".cpp", ".o"); 82// output replace(".cpp", ".o");
83 requires getMakeDeps("${CXX} ${CXXFLAGS} -M ${INPUT}"); 83 requires getMakeDeps("${CXX} ${CXXFLAGS} -M ${INPUT}");
84 profile "build" 84 profile "build"
@@ -91,7 +91,7 @@ rule "cpp"
91rule "c" 91rule "c"
92{ 92{
93 input "*.c"; 93 input "*.c";
94 output cToObj(); 94 output INPUT.cToObj();
95// output replace(".c", ".o"); 95// output replace(".c", ".o");
96 requires getMakeDeps("${CC} ${CFLAGS} -M ${INPUT}"); 96 requires getMakeDeps("${CC} ${CFLAGS} -M ${INPUT}");
97 profile "build" 97 profile "build"
@@ -115,8 +115,8 @@ rule "bison"
115rule "flex" 115rule "flex"
116{ 116{
117 input "*.l"; 117 input "*.l";
118 output replace(".l", ".yy.c"); 118 output INPUT.replace(".l", ".yy.c");
119 output replace(".l", ".yy.h"); 119 output INPUT.replace(".l", ".yy.h");
120 profile "build" 120 profile "build"
121 { 121 {
122 execute("${FLEX} ${FLEXFLAGS} ${INPUT}"); 122 execute("${FLEX} ${FLEXFLAGS} ${INPUT}");
diff --git a/share/include/qt4.bld b/share/include/qt4.bld
index 749cc52..a5a7867 100644
--- a/share/include/qt4.bld
+++ b/share/include/qt4.bld
@@ -1,4 +1,58 @@
1 1
2function qt_getCXXFLAGS()
3{
4 if QTDIR == null then
5 {
6 error "QTDIR is not set, cannot find QT tools.";
7 }
8
9 ret = "-D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LI "
10 "-DQT_SHARED -I${QTDIR}/mkspecs/linux-g++ "
11 "$(PKG_CONFIG_PATH=PKG_CONFIG_PATH:${QTDIR}/lib/pkgconfig "
12 "pkg-config --cflags QtCore QtGui ice glu x11 xext libpng freetype2 "
13 "gobject-2.0 sm xrender fontconfig gthread-2.0 glib-2.0)";
14 if UI_DIR != null then
15 {
16 ret += "-I${UI_DIR}";
17 }
18 if RCC_DIR != null then
19 {
20 ret += "-I${RCC_DIR}";
21 }
22 if MOC_DIR != null then
23 {
24 ret += "-I${MOC_DIR}";
25 }
26 return ret;
27}
28
29function qt_getLDFLAGS()
30{
31 if QTDIR == null then
32 {
33 error "QTDIR is not set, cannot find QT tools.";
34 }
35
36 return "-Wl,-rpath,${QTDIR}/lib $(PKG_CONFIG_PATH="
37 "PKG_CONFIG_PATH:${QTDIR}/lib/pkgconfig "
38 "pkg-config --libs QtCore QtGui ice glu x11 xext libpng freetype2 "
39 "gobject-2.0 sm xrender fontconfig gthread-2.0 glib-2.0) -laudio -lz "
40 "-lm -ldl";
41}
42
43function qt_getToolPath( TOOL, DEFAULT )
44{
45 if QTDIR == null then
46 {
47 error "QTDIR is not set, cannot find QT tools.";
48 }
49 if TOOL == null then
50 {
51 return "${QTDIR}/bin/${DEFAULT}";
52 }
53 return TOOL;
54}
55
2function qt_uiToH() 56function qt_uiToH()
3{ 57{
4 if "${UI_DIR}" == "" then 58 if "${UI_DIR}" == "" then
@@ -22,7 +76,8 @@ rule "qt_ui"
22 tag "headers"; 76 tag "headers";
23 profile "build" 77 profile "build"
24 { 78 {
25 execute("${QTDIR}/bin/uic -o ${OUTPUT} ${INPUT}"); 79 UIC = qt_getToolPath( UIC, "uic" );
80 execute("${UIC} -o ${OUTPUT} ${INPUT}");
26 } 81 }
27} 82}
28 83
@@ -48,8 +103,9 @@ rule "qt_rcc"
48 output INPUT.qt_qrcToCpp(); 103 output INPUT.qt_qrcToCpp();
49 profile "build" 104 profile "build"
50 { 105 {
106 RCC = qt_getToolPath( RCC, "rcc" );
51 NAME = INPUT.fileName().replace(".qrc",""); 107 NAME = INPUT.fileName().replace(".qrc","");
52 execute("${QTDIR}/bin/rcc -name ${NAME} -o ${OUTPUT} ${INPUT}"); 108 execute("${RCC} -name ${NAME} -o ${OUTPUT} ${INPUT}");
53 } 109 }
54} 110}
55 111
@@ -90,7 +146,8 @@ rule "qt_moc"
90 output INPUT.qt_hToMocCpp(); 146 output INPUT.qt_hToMocCpp();
91 profile "build" 147 profile "build"
92 { 148 {
93 execute("${QTDIR}/bin/moc -o${OUTPUT} ${INPUT}"); 149 MOC = qt_getToolPath( MOC, "moc" );
150 execute("${MOC} -o${OUTPUT} ${INPUT}");
94 } 151 }
95} 152}
96 153