1#-*- mode: makefile; tab-width: 4; -*-
2#
3########## fwbuilder/qmake.inc.in
4#
5QTDIR = $$(QTDIR)
6TEMPLATE = app
7DEFINES += $$(DEFINES)
8LANGUAGE = C++
9UI_DIR = ui
10MANDIR = @MANDIR@
11DOCDIR = @DOCDIR@
12
13HAVE_QTDBUS = @HAVE_QTDBUS@
14HAVE_CPPUNIT = @HAVE_CPPUNIT@
15CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
16CPPUNIT_LIBS = @CPPUNIT_LIBS@
17
18# CONFIG -= nostrip
19# CONFIG += release
20CONFIG += debug
21
22unix {
23    PREFIX = @PREFIX@
24
25    ANTLR_INCLUDEPATH =  @ANTLR_INCLUDEPATH@
26    ANTLR_LIBS =  @ANTLR_LIBS@
27
28    QMAKE_CXX = @CCACHE@ @DISTCC@ $$QMAKE_CXX
29
30    INCLUDEPATH += .. ../..
31    INCLUDEPATH += @XML_CFLAGS_Q@ @XSLT_CFLAGS_Q@
32    LIBS += @PTHREAD_LIBS@ @XML_LIBS@ @XSLT_LIBS@ @LIBSNMP_LIBS@ @LIB_RESOLV@ @LIBS@
33
34    UI_DIR = .ui
35    MOC_DIR = .moc
36    OBJECTS_DIR = .obj
37
38    QMAKE_CXXFLAGS_DEBUG += -Wno-reserved-user-defined-literal
39    QMAKE_CXXFLAGS_RELEASE += -Wno-reserved-user-defined-literal
40
41    !macx {
42
43        exec_prefix = @EXEC_PREFIX@
44        DESTDIR =
45        ICONSDIR = @ICONSDIR@
46
47        target.path = $$PREFIX/bin
48        dtd.path = @RES_DIR@/
49        migration.path = @RES_DIR@/migration
50        doc.path = @DOCDIR@
51        datadir.path   = @DATADIR@
52
53        res.path = @RES_DIR@
54        res_os.path = $$res.path/os/
55        res_platform.path = $$res.path/platform/
56        res_help_C.path = $$res.path/help/C
57        res_help_en_US.path = $$res.path/help/en_US
58        res_desktop.path = @DATADIR@/applications/
59        res_configlets.path = $$res.path/configlets
60
61        # INSTALLS += icns
62        # LIBS += @LIBS@
63
64        PKGLOCALEDIR = $$res.path/locale
65
66        CONFIG += warn_on
67
68#		DEFINES += __STDC_FORMAT_MACROS
69    }
70}
71
72win32 {
73    # Keep this as a absolute full path. For some reason, when
74    # I leave it is up to qmake to define this variable, and it
75    # makes it "xcopy /i /y /s /q", I get an error "Invalid number of parameters"
76    # even though command line looks correct. Chances are, there is another
77    # xcopy somewhere on the system that gets used, but I could not find it.
78    # Setting this variable using full path works.
79    QMAKE_COPY_DIR = C:\\Windows\\System32\\xcopy /I /Y /S /Q
80
81    PREFIX = "c:/tmp/build_root"
82    DOCDIR = "$$PREFIX/doc/fwbuilder"
83    exec_prefix = "$$PREFIX"
84    MANDIR = "$$PREFIX/man/"
85    DESTDIR = ""
86
87    doc.path    = $$DOCDIR
88
89    target.path = $$PREFIX/
90    res.path = $$PREFIX/resources
91    res_os.path = $$res.path/os
92    res_platform.path = $$res.path/platform
93    res_help_C.path = $$res.path/help/C
94    res_help_en_US.path = $$res.path/help/en_US
95    res_configlets.path = $$res.path/configlets
96
97    PKGLOCALEDIR = $$res.path/locale
98
99    CONFIG += qt thread rtti stl warn_on release
100    CONFIG -= debug
101
102    BINARY_SUBDIR = release
103
104    DEFINES += LIBXML_STATIC LIBXSLT_STATIC
105    DEFINES += LIBEXSLT_STATIC XMLSEC_STATIC
106    DEFINES += WIN32_LEAN_AND_MEAN
107
108    INCLUDEPATH += "../.."
109
110    INCLUDEPATH += $$(TOOLCHAIN_PREFIX)/include $$(TOOLCHAIN_PREFIX)/include/libxml2 $$(TOOLCHAIN_PREFIX)/include/net-snmp /include
111
112   LIBS += -L$$(TOOLCHAIN_PREFIX)/lib -L$$(TOOLCHAIN_PREFIX)/bin
113   # LIBS += -l xslt -l xml2 -l iconv -l pthread -l ws2_32
114   #LIBS += -l xslt -l xml2 -l iconv -l pthread -l netsnmp -l ws2_32
115   LIBS += -lxslt -lxml2 -liconv -lpthread -lz -lws2_32
116
117# workaround for QT += dbus not working atm
118# Standard QT binary Windows distribution does not include QtDBus library
119# Checked with 4.4.1 and 4.4.3 06/12/2009
120#    LIBS += -lQtDBus
121
122    target.path = $$PREFIX/bin
123
124# on windows we use antlr DLL
125    HAVE_ANTLR_RUNTIME = 1
126    HAVE_EXTERNAL_ANTLR = 0
127    antlr.path = $$PREFIX/lib
128
129# Qt on windows does not have DBus framework support, turn parts of .pro files off
130#    HAVE_QTDBUS =
131
132    ANTLR_INCLUDEPATH = ..
133    ANTLR_LIBS = ../antlr/release/libantlr.a
134
135# our parsers are linked as a library (code is in src/parsers)
136    FWBPARSER_LIB = ../parsers/release/libfwbparser.a
137
138# fwtransfer library for secuwall (and possibly other os/platform)
139# override the name for windows
140#    FWTRANSFER_LIB = ../fwtransfer/release/libfwtransfer.a
141}
142
143macx {
144
145    #	PREFIX = "$$DESTDIR"
146	DOCDIR = "$$PREFIX/doc/"
147	MANDIR = "$$PREFIX/share/man"
148
149    # These do not really matter because we never run make install on Mac OS X
150    target.path = $$PREFIX/
151    res.path = $$PREFIX/resources/
152    res_os.path = $$res.path/os
153    res_platform.path = $$res.path/platform
154    res_help_C.path = $$res.path/help/C
155    res_help_en_US.path = $$res.path/help/en_US
156    res_configlets.path = $$res.path/configlets
157
158	icns.files = fwbuilder.icns
159	icns.path = $$PREFIX/
160
161	PKGLOCALEDIR = $$res.path/locale
162
163# If I build on 10.6 without these, generated binary depends on
164# /usr/lib/libxml2.2.dynlib that has compatibility version 10.0.0
165# which does not work on 10.5 where its compatibility version is
166# 9.0.0. Chances are, the same thing may be happening with other
167# dependency libraries. Building on 10.6 with deployment target 10.5
168# should solve the problem
169	QMAKE_MACOSX_DEPLOYMENT_TARGET = $$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
170	QMAKE_CXXFLAGS += -mmacosx-version-min=$$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
171	QMAKE_MAC_SDK = $$(QMAKE_MAC_SDK)
172
173	CONFIG += qt thread rtti stl warn_on debug  # release
174
175# not compiling for PPC because of problems on Snow Leopard
176	CONFIG -= x86
177	CONFIG += x86_64
178
179# See http://trolltech.com/developer/task-tracker/index_html?method=entry&id=211852
180# for why ppc architecture is commented out.
181# If Trolltech does not fix it by the time of release v3.0, will have
182# to figure out workaround (turn off precompiled headers ?)
183#	CONFIG += ppc
184
185	INCLUDEPATH += $(INSTALL_ROOT)/$$PREFIX/include/
186	INCLUDEPATH += /usr/include/libxml2 /usr/include
187
188	QMAKE_LIBS_QT =
189	QMAKE_LIBS_QT_THREAD =
190
191    # LIBS += $$LIBS_FWBUILDER
192    LIBS += -lxml2 -lz
193    LIBS += -lpthread
194
195}
196
197
198FWB_SIG = $$(FWB_SIG)
199if (isEmpty(FWB_SIG)) { FWB_SIG=26932 }
200DEFINES += FWB_SIG=$$FWB_SIG
201
202QMAKE_CXXFLAGS_DEBUG += -D__STDC_FORMAT_MACROS
203QMAKE_CXXFLAGS_RELEASE += -D__STDC_FORMAT_MACROS
204
205exists(qmake2.inc) {
206  include(qmake2.inc)
207}
208
209INSTALLS += target
210