mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-05-05 00:35:03 +02:00
Fix: Building on OSX and Windows
* build_mac.sh OSX build script * Read doc/README.osx for instructions * Updated fwbuilder.nsi.in, and qmake.inc.in for Windows * Read doc/README.windows for instructions
This commit is contained in:
parent
96268831a2
commit
ce8584e847
55
build_mac.sh
Normal file
55
build_mac.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
export QMAKE_MAC_SDK=$(xcodebuild -sdk macosx -version | grep "^Path" | awk '{ print $2 }')
|
||||
export QMAKESPEC="macx-llvm"
|
||||
export QMAKE_MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
|
||||
./autogen.sh
|
||||
|
||||
echo "==> Compiling"
|
||||
export JOBS=$(sysctl -n hw.ncpu | awk '{ print $1 + 1 }')
|
||||
make -j${JOBS}
|
||||
|
||||
APP_VERSION=$(cat VERSION.h | grep VERSION | awk '{ print $3 }' | tr -d '"')
|
||||
QT_VERSION_MAJOR=$(qmake -version | awk '/Using Qt version/ { ver=4; print $ver }' | awk -F. '{ major=1; print $major }')
|
||||
|
||||
FWBUILDER_ROOT_DIR=$(pwd)
|
||||
TMP_BUNDLE_DIR=$(ls -d ${FWBUILDER_ROOT_DIR}/src/gui/*.app)
|
||||
test -z "$TMP_BUNDLE_DIR" && {
|
||||
echo "Cannot find GUI bundle. My best guess was in ${FWBUILDER_ROOT_DIR}/src/gui/"
|
||||
exit 1
|
||||
}
|
||||
|
||||
TMP_BUNDLE=$(basename $TMP_BUNDLE_DIR)
|
||||
rm -rf $TMP_BUNDLE
|
||||
|
||||
echo "==> Copying base bundle"
|
||||
cp -R ${FWBUILDER_ROOT_DIR}/src/gui/$TMP_BUNDLE .
|
||||
|
||||
echo "==> Copying resources and libraries into bundle"
|
||||
mkdir -p ${TMP_BUNDLE}/Contents/Resources/os
|
||||
mkdir -p ${TMP_BUNDLE}/Contents/Resources/platform
|
||||
mkdir -p ${TMP_BUNDLE}/Contents/Resources/help
|
||||
mkdir -p ${TMP_BUNDLE}/Contents/Resources/configlets
|
||||
mkdir -p ${TMP_BUNDLE}/Contents/Resources/migration
|
||||
cp -R ${FWBUILDER_ROOT_DIR}/src/res/{*.xml,os,platform,help,configlets} ${TMP_BUNDLE}/Contents/Resources/
|
||||
cp ${FWBUILDER_ROOT_DIR}/src/libfwbuilder/etc/fwbuilder.dtd ${TMP_BUNDLE}/Contents/Resources/
|
||||
cp ${FWBUILDER_ROOT_DIR}/src/libfwbuilder/migration/*.xslt ${TMP_BUNDLE}/Contents/Resources/migration/
|
||||
|
||||
echo "==> Copying binaries into bundle"
|
||||
cp ${FWBUILDER_ROOT_DIR}/src/fwbedit/fwbedit.app/Contents/MacOS/fwbedit ${TMP_BUNDLE}/Contents/MacOS/
|
||||
for binary in ipt pf ipf ipfw iosacl nxosacl pix procurve_acl
|
||||
do
|
||||
cp ${FWBUILDER_ROOT_DIR}/src/$binary/fwb_$binary.app/Contents/MacOS/fwb_$binary ${TMP_BUNDLE}/Contents/MacOS/
|
||||
done
|
||||
|
||||
BIN=${TMP_BUNDLE}/Contents/MacOS
|
||||
chmod +x ${BIN}/fwb*
|
||||
|
||||
echo "==> Stripping binaries"
|
||||
strip ${BIN}/*
|
||||
|
||||
echo "==> Running macdeployqt"
|
||||
macdeployqt ${TMP_BUNDLE} -executable=${BIN}/fwbedit -executable=${BIN}/fwb_ipt -executable=${BIN}/fwb_pf -executable=${BIN}/fwb_ipf -executable=${BIN}/fwb_ipfw -executable=${BIN}/fwb_iosacl -executable=${BIN}/fwb_nxosacl -executable=${BIN}/fwb_pix -executable=${BIN}/fwb_procurve_acl
|
||||
|
||||
echo "==> Done"
|
||||
echo "# open ${TMP_BUNDLE}/"
|
||||
15
doc/README.osx
Normal file
15
doc/README.osx
Normal file
@ -0,0 +1,15 @@
|
||||
Requirements:
|
||||
* XCode + Command Line Tools
|
||||
* Qt 4.6+ http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-mac-opensource-4.8.5.dmg
|
||||
* autoconf, automake, libtool, net-snmp
|
||||
|
||||
Easy install with Homebrew:
|
||||
$ brew install autoconf automake libtool net-snmp
|
||||
|
||||
Fix permissions
|
||||
$ sudo chmod -R u+w /usr/local/Cellar/net-snmp
|
||||
|
||||
Clone repository and
|
||||
$ cd fwbuilder && chmod +x build_mac.sh && ./build_mac.sh
|
||||
|
||||
$ open fwbuilder.app/
|
||||
120
doc/README.windows
Normal file
120
doc/README.windows
Normal file
@ -0,0 +1,120 @@
|
||||
* Set up development directory: c:\dev
|
||||
|
||||
* Install MinGW-get in c:\dev\mingw
|
||||
+ Select C compiler, C++ Compiler, MSYS Basic System and MinGW Developer ToolKit
|
||||
|
||||
* Compile Qt OpenSource 4.8.5
|
||||
+ Download and unpack into c:\dev\qt\4.8.5
|
||||
+ Run cmd.exe
|
||||
+ SET PATH=c:\dev\MinGW\bin;%PATH%
|
||||
+ cd dev\qt\4.8.5
|
||||
+ configure -opensource -confirm-license -platform win32-g++ -release -no-qt3support -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -nomake demos -nomake examples
|
||||
+ mingw32-make
|
||||
|
||||
* Open MinGW shell
|
||||
+ mingw-get install msys-wget
|
||||
+ mingw-get install msys-unzip
|
||||
+ mingw-get install libtool
|
||||
|
||||
* Compile libiconv
|
||||
+ cd /c/dev/libs
|
||||
+ wget "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz"
|
||||
+ tar xzf libiconv-1.14.tar.gz
|
||||
+ cd libiconv-1.14
|
||||
+ ./configure
|
||||
+ make
|
||||
+ make install-strip
|
||||
|
||||
* Compile zlib
|
||||
+ cd /c/dev/libs
|
||||
+ wget "zlib.net/zlib128.zip"
|
||||
+ unzip zlib128.zip
|
||||
+ cd zlib-1.2.8
|
||||
+ make -f win32/Makefile.gcc
|
||||
+ cp zlib1.dll /usr/local/bin
|
||||
+ cp zconf.h zlib.h /usr/local/include
|
||||
+ cp libz.a libz.dll.a /usr/local/lib
|
||||
+ wget www.gaia-gis.it/spatialite-2.5.0/libz.la
|
||||
+ cp libz.la /usr/local/lib
|
||||
|
||||
* Compile libxml2
|
||||
+ cd /c/dev/libs
|
||||
+ wget "ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz"
|
||||
+ tar xzf libxml2-2.9.1.tar.gz
|
||||
+ cd libxml2-2.9.1
|
||||
+ export "CFLAGS=-I/usr/local/include"
|
||||
+ export "LDFLAGS=-L/usr/local/lib"
|
||||
+ ./configure --without-python
|
||||
+ make
|
||||
+ make install-strip
|
||||
|
||||
* Compile libxslt
|
||||
+ cd /c/dev/libs
|
||||
+ wget "ftp://xmlsoft.org/libxml2/libxslt-1.1.28.tar.gz"
|
||||
+ tar xzf libxslt-1.1.28.tar.gz
|
||||
+ cd libxslt-1.1.28
|
||||
+ export "CFLAGS=-I/usr/local/include"
|
||||
+ export "LDFLAGS=-L/usr/local/lib"
|
||||
+ sed 's/\sdoc\s//' Makefile.am > Makefile.am.new
|
||||
+ mv Makefile.am.new Makefile.am
|
||||
+ sed 's/\sdoc\s//' Makefile.in > Makefile.in.new
|
||||
+ mv Makefile.in.new Makefile.in
|
||||
+ ./configure --without-python
|
||||
+ make
|
||||
+ make install-strip
|
||||
|
||||
* Compile net-snmp
|
||||
+ cd /c/dev/libs
|
||||
+ wget "http://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.2/net-snmp-5.7.2.tar.gz/download"
|
||||
+ tar xzf net-snmp-5.7.2.tar.gz
|
||||
+ cd net-snmp-5.7.2
|
||||
+ ./configure --prefix="/usr/local" \
|
||||
--disable-embedded-perl \
|
||||
--without-perl-modules \
|
||||
--disable-agent \
|
||||
--disable-applications \
|
||||
--disable-manuals \
|
||||
--disable-scripts \
|
||||
--disable-mibs \
|
||||
--disable-mib-loading \
|
||||
--disable-des \
|
||||
--disable-privacy \
|
||||
--disable-md5 \
|
||||
--disable-set-support \
|
||||
--disable-snmptrapd-subagent
|
||||
+ make
|
||||
+ make install
|
||||
|
||||
* Compile fwbuilder
|
||||
+ cd /c/dev/fwbuilder
|
||||
+ export PATH=".:/c/dev/qt/4.8.5/bin:/c/dev/qt/mingw/bin:$PATH"
|
||||
+ export QMAKESPEC="win32-g++"
|
||||
+ export "CFLAGS=-I/usr/local/include"
|
||||
+ export "CPPFLAGS=-I/usr/local/include"
|
||||
+ export "LDFLAGS=-L/usr/local/lib"
|
||||
+ ./autogen.sh
|
||||
+ make
|
||||
|
||||
|
||||
* Download and install NSIS from http://nsis.sourceforge.net/Download
|
||||
* Download and i
|
||||
|
||||
* Make install package
|
||||
+ cd /c/dev/fwbuilder
|
||||
+ mkdir windows
|
||||
+ cd windows
|
||||
+ wget "www.cs.purdue.edu/homes/trinkle/RCS/rcs57pc1.zip
|
||||
+ unzip rcs57pc1.zip
|
||||
+ cp /local/bin/* bin/
|
||||
+ cp /c/dev/MinGW/bin/pthreadGC2.dll bin/
|
||||
+ cp /c/dev/MinGW/bin/libgcc_s_dw2-1.dll bin/
|
||||
+ cp /c/dev/MinGW/bin/libstd++-6.dll bin/
|
||||
+ cp /c/dev/qt/4.8.5/lib/QtCore4.dll bin/
|
||||
+ cp /c/dev/qt/4.8.5/lib/QtGui4.dll bin/
|
||||
+ cp /c/dev/qt/4.8.5/lib/QtNetwork4.dll bin/
|
||||
+ cd bin
|
||||
+ wget "http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe"
|
||||
+ wget "http://the.earth.li/~sgtatham/putty/latest/x86/pcsp.exe"
|
||||
+ cd ../..
|
||||
+ $PATH/TO/NSIS/makesis.exe -nocd packaging/fwbuilder.nsi
|
||||
+ explorer .
|
||||
@ -241,6 +241,7 @@ Section "FWBuilder (required)"
|
||||
File "doc\README.pix"
|
||||
File "doc\README.pix_routing"
|
||||
File "doc\README.routing"
|
||||
File "doc\README.nxosacl"
|
||||
|
||||
File /oname=fwbuilder.ico "src\gui\fwbuilder-windows.ico"
|
||||
|
||||
@ -253,31 +254,32 @@ Section "FWBuilder (required)"
|
||||
File /a "src\pf\release\fwb_pf.exe"
|
||||
File /a "src\pix\release\fwb_pix.exe"
|
||||
File /a "src\procurve_acl\release\fwb_procurve_acl.exe"
|
||||
File /a "src\nxosacl\release\fwb_nxosacl.exe"
|
||||
|
||||
File "c:\MinGW\bin\libiconv-2.dll"
|
||||
File "c:\MinGW\bin\libpthread-2.dll"
|
||||
File "c:\MinGW\bin\libgcc_s_dw2-1.dll"
|
||||
File "c:\MinGW\bin\libstdc++-6.dll"
|
||||
|
||||
File "c:\local\bin\libxml2-2.dll"
|
||||
File "c:\local\bin\libxslt-1.dll"
|
||||
File "windows\bin\libiconv-2.dll"
|
||||
File "windows\bin\pthreadGC2.dll"
|
||||
File "windows\bin\libgcc_s_dw2-1.dll"
|
||||
File "windows\bin\libstdc++-6.dll"
|
||||
File "windows\bin\zlib1.dll"
|
||||
File "windows\bin\libxml2-2.dll"
|
||||
File "windows\bin\libxslt-1.dll"
|
||||
|
||||
; Install RCS for these files
|
||||
;
|
||||
File "c:\local\bin\ci.exe"
|
||||
File "c:\local\bin\co.exe"
|
||||
File "c:\local\bin\rcs.exe"
|
||||
File "c:\local\bin\rcsdiff.exe"
|
||||
File "c:\local\bin\rlog.exe"
|
||||
File "c:\local\bin\diff.exe"
|
||||
File "c:\local\bin\rcslib.dll"
|
||||
File "windows\bin\win32\ci.exe"
|
||||
File "windows\bin\win32\co.exe"
|
||||
File "windows\bin\win32\rcs.exe"
|
||||
File "windows\bin\win32\rcsdiff.exe"
|
||||
File "windows\bin\win32\rlog.exe"
|
||||
File "windows\bin\win32\diff.exe"
|
||||
File "windows\bin\win32\rcslib.dll"
|
||||
|
||||
; File "c:\local\bin\netsnmp.dll"
|
||||
|
||||
File "c:\local\qt-everywhere-commercial-src-4.7.3\bin\QtCore4.dll"
|
||||
File "c:\local\qt-everywhere-commercial-src-4.7.3\bin\QtGui4.dll"
|
||||
File "c:\local\qt-everywhere-commercial-src-4.7.3\bin\QtNetwork4.dll"
|
||||
File "c:\local\qt-everywhere-commercial-src-4.7.3\bin\QtTest4.dll"
|
||||
File "windows\bin\QtCore4.dll"
|
||||
File "windows\bin\QtGui4.dll"
|
||||
File "windows\bin\QtNetwork4.dll"
|
||||
; File "c:\local\qt-everywhere-commercial-src-4.7.3\bin\QtTest4.dll"
|
||||
|
||||
File /nonfatal /oname=resources\locale\qt_de.qm "c:\local\qt-everywhere-commercial-src-4.7.3\translations\qt_de.qm"
|
||||
File /nonfatal /oname=resources\locale\qt_fr.qm "c:\local\qt-everywhere-commercial-src-4.7.3\translations\qt_fr.qm"
|
||||
@ -285,8 +287,8 @@ Section "FWBuilder (required)"
|
||||
|
||||
|
||||
;; Starting with 4.0.2, we now package putty tools with fwbuilder
|
||||
File "c:\PuTTY\plink.exe"
|
||||
File "c:\PuTTY\pscp.exe"
|
||||
File "windows\bin\plink.exe"
|
||||
File "windows\bin\pscp.exe"
|
||||
|
||||
|
||||
; Write the installation path into the registry
|
||||
|
||||
13
qmake.inc.in
13
qmake.inc.in
@ -108,9 +108,10 @@ win32 {
|
||||
|
||||
INCLUDEPATH += "../.."
|
||||
|
||||
INCLUDEPATH += c:/local/include c:/local/include/libxml2 c:/MinGW/include
|
||||
INCLUDEPATH += /local/include /local/include/libxml2 /local/include/net-snmp /include
|
||||
|
||||
LIBS += -L "c:/local/lib"
|
||||
LIBS += -L/local/lib -L/local/bin
|
||||
# LIBS += -l xslt -l xml2 -l iconv -l pthread -l ws2_32
|
||||
LIBS += -l xslt -l xml2 -l iconv -l pthread -l netsnmp -l ws2_32
|
||||
|
||||
# workaround for QT += dbus not working atm
|
||||
@ -165,13 +166,15 @@ macx {
|
||||
# 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_MACOSX_DEPLOYMENT_TARGET = $$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
|
||||
QMAKE_CXXFLAGS += -mmacosx-version-min=$$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
|
||||
QMAKE_MAC_SDK = $$(QMAKE_MAC_SDK)
|
||||
|
||||
CONFIG += qt thread rtti stl warn_on debug # release
|
||||
|
||||
# not compiling for PPC because of problems on Snow Leopard
|
||||
CONFIG += x86
|
||||
CONFIG -= x86
|
||||
CONFIG += x86_64
|
||||
|
||||
# See http://trolltech.com/developer/task-tracker/index_html?method=entry&id=211852
|
||||
# for why ppc architecture is commented out.
|
||||
|
||||
@ -65,7 +65,7 @@ static OSErr checkAppleEventForMissingParams(const AppleEvent&
|
||||
}
|
||||
|
||||
static pascal OSErr odocHandler(const AppleEvent* inEvent, AppleEvent*
|
||||
/*reply*/, long /*refCon*/)
|
||||
/*reply*/, SRefCon /*refCon*/)
|
||||
{
|
||||
if (fwbdebug) qDebug("Handling 'odoc'\n");
|
||||
AEDescList documentList;
|
||||
|
||||
@ -65,8 +65,8 @@ win32 {
|
||||
CONFIG += staticlib
|
||||
|
||||
DEFINES += LIBXML_STATIC LIBXSLT_STATIC
|
||||
INCLUDEPATH += c:/local/include c:/local/include/libxml2 c:/MinGW/include
|
||||
LIBS += -LC:\local\lib
|
||||
INCLUDEPATH += /local/include /local/include/libxml2 /local/include/net-snmp /include
|
||||
LIBS += -L/local/lib -L/local/bin
|
||||
# LIBS += ws2_32.lib pthreadVC.lib
|
||||
LIBS += pthreadVC.lib
|
||||
LIBS += libxml2.lib libxslt_a.lib libz.a # zlib.lib
|
||||
@ -86,7 +86,8 @@ macx {
|
||||
migration.path = "$$prefix/migration"
|
||||
doc.path = "$$prefix/doc/"
|
||||
|
||||
CONFIG += x86
|
||||
CONFIG -= x86
|
||||
CONFIG += x86_64
|
||||
|
||||
# If I build on 10.6 without these, generated binary depends on
|
||||
# /usr/lib/libxml2.2.dynlib that has compatibility version 10.0.0
|
||||
@ -94,8 +95,9 @@ macx {
|
||||
# 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_MACOSX_DEPLOYMENT_TARGET = $$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
|
||||
QMAKE_CXXFLAGS += -mmacosx-version-min=$$(QMAKE_MACOSX_DEPLOYMENT_TARGET)
|
||||
QMAKE_MAC_SDK = $$(QMAKE_MAC_SDK)
|
||||
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user