#-*- mode: makefile; tab-width: 4; -*-
#
######### libfwbuilder/qmake.inc.in
#
QTDIR = $$(QTDIR)
TEMPLATE = lib
DEFINES += $$(DEFINES)
INCLUDEPATH += .. ../.. $$(INCLUDEPATH)
DEPENDPATH  += .. ../..
LANGUAGE = C++

HAVE_CPPUNIT = 
CPPUNIT_CFLAGS = 
CPPUNIT_LIBS = 

CONFIG -= qt

QMAKE_CXXFLAGS_DEBUG += -D__STDC_FORMAT_MACROS
QMAKE_CXXFLAGS_RELEASE += -D__STDC_FORMAT_MACROS


unix {
    CONFIG += warn_on debug

    UI_DIR = .ui
    MOC_DIR = .moc
    OBJECTS_DIR = .obj

    prefix = /usr/pkg

    QMAKE_CXX =   $$QMAKE_CXX

    # We put /usr/include into INCLUDEPATH to fix a problem compiling
    # fwbuilder/snmp.cpp on freebsd.
    INCLUDEPATH += /usr/include /usr/pkg/include/libxml2 /usr/include /usr/pkg/include
    LIBS +=  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lxml2 -L/usr/lib -lz -L/usr/lib -llzma -L/usr/lib -lm  -lxslt -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib/perl5/5.32.0/alpha-netbsd-thread-multi/CORE -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lnetsnmp -lcrypto -lelf -ldes -lm  -lz -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib/perl5/5.32.0/alpha-netbsd-thread-multi/CORE -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lnetsnmp -lcrypto -lelf -ldes -lm -lutil 

    QMAKE_CFLAGS_DEBUG += -Wno-unused-parameter
    QMAKE_CFLAGS_RELEASE += -Wno-unused-parameter
    QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter -O2 -mieee -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/cppunit -I/usr/pkg/qt4/include -I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/X11R7/include/libdrm
    QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter -O2 -mieee -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/cppunit -I/usr/pkg/qt4/include -I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/X11R7/include/libdrm

    exec_prefix = @EXEC_PREFIX@
    DESTDIR =

    target.path = ${exec_prefix}/lib
    dtd.path = /usr/pkg/share/fwbuilder-5.1.0.3599/
    migration.path = /usr/pkg/share/fwbuilder-5.1.0.3599/migration
    doc.path = /usr/pkg/share/doc/fwbuilder-5.1.0.3599
}

win32 {
    prefix = "c:/tmp/build_root"
    DOCDIR = "$$prefix/doc/"
    exec_prefix = "$$prefix"
    DESTDIR = ""

    target.path = "$$prefix/lib"
    dtd.path = "$$prefix/resources"
    migration.path = "$$prefix/resources/migration"
    doc.path = "$$prefix/doc/libfwbuilder"

    CONFIG -= debug
    CONFIG += thread rtti stl warn_on release
    CONFIG += staticlib

    DEFINES += LIBXML_STATIC LIBXSLT_STATIC 
    INCLUDEPATH += c:/local/include c:/local/include/libxml2 c:/MinGW/include
    LIBS += -LC:\local\lib
#    LIBS += ws2_32.lib pthreadVC.lib 
    LIBS += pthreadVC.lib 
    LIBS += libxml2.lib libxslt_a.lib libz.a  # zlib.lib
}

macx {
    prefix = "$$prefix"
    DOCDIR = "$$prefix/doc/"
    exec_prefix = "$$prefix"
    DESTDIR =

# these path definitions are not used since we do not run make install on Mac
# (see fwbuilder.def file where it is defined that we don't do that)
# But I need to assign these variables some value to make qmake happy.
    target.path = "$$prefix/lib"
    dtd.path = "$$prefix/"
    migration.path = "$$prefix/migration"
    doc.path = "$$prefix/doc/"

    CONFIG += x86 

# If I build on 10.6 without these, generated binary depends on
# /usr/lib/libxml2.2.dynlib that has compatibility version 10.0.0
# which does not work on 10.5 where its compatibility version is
# 9.0.0. Chances are, the same thing may be happening with other
# dependency libraries. Building on 10.6 with deployment target 10.5
# should solve the problem
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
    QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk

    QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
}


INSTALLS += target
