forked from mrichards42/xword
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-wxwidgets.sh
executable file
·68 lines (60 loc) · 2.22 KB
/
build-wxwidgets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Script to build and install wxWidgets, with our custom tweaks patch.
set -e
WX_VERSION=$1
CONFIGURATION=$2
if [[ -z "$WX_VERSION" ]]; then
echo "First argument must be set to the wxWindows version"
exit 1
fi
INSTALL_PATH="$HOME/wxWidgets-$WX_VERSION"
mkdir -p $INSTALL_PATH
WX_CONFIGURE_FLAGS="\
--disable-shared \
--enable-compat28"
if [[ "$OSTYPE" == "darwin"* ]]; then
WX_CONFIGURE_FLAGS="$WX_CONFIGURE_FLAGS \
--with-macosx-version-min=10.10 \
--with-libpng=builtin \
--with-libjpeg=builtin \
--with-libtiff=builtin \
--with-liblzma=builtin \
CFLAGS=-fvisibility-inlines-hidden \
CXXFLAGS='-fvisibility-inlines-hidden -stdlib=libc++' \
CPPFLAGS='-fvisibility-inlines-hidden -stdlib=libc++' \
OBJCFLAGS=-fvisibility-inlines-hidden \
OBJCXXFLAGS='-fvisibility-inlines-hidden -stdlib=libc++' \
LDFLAGS=-stdlib=libc++"
fi
WX_MAKE_FLAGS="SHARED=0"
if [[ "$CONFIGURATION" == "Debug" ]]; then
WX_CONFIGURE_FLAGS="$WX_CONFIGURE_FLAGS --enable-debug"
WX_MAKE_FLAGS="$WX_MAKE_FLAGS BUILD=debug"
elif [[ "$CONFIGURATION" == "Release" ]]; then
WX_MAKE_FLAGS="$WX_MAKE_FLAGS BUILD=release"
else
echo "Unsupported configuration: $CONFIGURATION"
echo "Please use one of Debug or Release"
exit 1
fi
echo "Building wxWidgets version $WX_VERSION for configuration: $CONFIGURATION"
mkdir -p $INSTALL_PATH
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "linux"* ]]; then
# Mac OS X / Linux
BUILD_COMMAND="./configure --prefix=$INSTALL_PATH $WX_CONFIGURE_FLAGS && make -j 4 && make install"
else
# Windows
BUILD_COMMAND="sed -e 's/WXWIN_COMPATIBILITY_2_8 0/WXWIN_COMPATIBILITY_2_8 1/' -i include/wx/msw/setup.h"
BUILD_COMMAND="$BUILD_COMMAND && cd build/msw && nmake.exe -f makefile.vc $WX_MAKE_FLAGS"
BUILD_COMMAND="$BUILD_COMMAND && cp -a ../../lib ../../include $INSTALL_PATH"
fi
# Check to see if the cache directory is empty
if [ ! -d "$INSTALL_PATH/lib" ]; then
curl -fsSL -o wxWidgets-$WX_VERSION.tar.bz2 https://github.com/wxWidgets/wxWidgets/releases/download/v$WX_VERSION/wxWidgets-$WX_VERSION.tar.bz2
tar -xjf wxWidgets-$WX_VERSION.tar.bz2
cd wxWidgets-$WX_VERSION
patch -p1 -i ../wxaui-tweaks.patch
eval $BUILD_COMMAND
else
echo "Using cached directory."
fi