configure

Sat, 14 Nov 2020 21:11:35 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 14 Nov 2020 21:11:35 +0100
changeset 159
84a6e7a7b457
parent 158
4bde241c49b1
child 170
ad9edb497857
permissions
-rwxr-xr-x

fix configure target options

156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
1 #!/bin/sh
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
2
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
3
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
4 PREFIX=/usr
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
5 EPREFIX=$PREFIX
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
6
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
7 BINDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
8 SBINDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
9 LIBDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
10 LIBEXECDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
11 DATADIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
12 SYSCONFDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
13 SHAREDSTATEDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
14 LOCALSTATEDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
15 INCLUDEDIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
16 INFODIR=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
17 MANDIR=
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 OS=`uname -s`
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 OS_VERSION=`uname -r`
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
21
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
22 TEMP_DIR=".tmp-`uname -n`"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
23 mkdir -p $TEMP_DIR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
24 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
25 echo "Cannot create tmp dir"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
26 echo "Abort"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
27 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
28 touch $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
29 touch $TEMP_DIR/features
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
30
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
31 # features
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
32
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
33 # help text
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
34 printhelp()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
35 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
36 echo "Usage: $0 [OPTIONS]..."
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
37 cat << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
38 Installation directories:
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
39 --prefix=PREFIX path prefix for architecture-independent files
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
40 [/usr]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
41 --exec-prefix=EPREFIX path prefix for architecture-dependent files
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
42 [PREFIX]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
43
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
44 --bindir=DIR user executables [EPREFIX/bin]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
45 --sbindir=DIR system admin executables [EPREFIX/sbin]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
46 --libexecdir=DIR program executables [EPREFIX/libexec]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
47 --sysconfdir=DIR system configuration files [PREFIX/etc]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
48 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
49 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
50 --libdir=DIR object code libraries [EPREFIX/lib]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
51 --includedir=DIR C header files [PREFIX/include]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
52 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
53 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
54 --infodir=DIR info documentation [DATAROOTDIR/info]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
55 --mandir=DIR man documentation [DATAROOTDIR/man]
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
56
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
57 Options:
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
58 --toolkit=(gtk3|gtk2|gtk2legacy|qt5|qt4|motif)
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
59
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
60 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
61 }
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 #
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
64 # parse arguments
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 #
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 for ARG in $@
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
68 case "$ARG" in
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
69 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
70 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
71 "--bindir="*) BINDIR=${ARG#----bindir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
72 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
73 "--libdir="*) LIBDIR=${ARG#--libdir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
74 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
75 "--datadir="*) DATADIR=${ARG#--datadir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
76 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
77 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
78 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
79 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
80 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
81 "--mandir"*) MANDIR=${ARG#--mandir} ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
82 "--help"*) printhelp; exit 1 ;;
159
84a6e7a7b457 fix configure target options
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 158
diff changeset
83 "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;;
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
84 "-"*) echo "unknown option: $ARG"; exit 1 ;;
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
85 esac
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 done
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
88 # set dir variables
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
89 if [ -z "$BINDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
90 BINDIR=$EPREFIX/bin
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
91 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
92 if [ -z "$SBINDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
93 SBINDIR=$EPREFIX/sbin
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
94 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
95 if [ -z "$LIBDIR" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
96 LIBDIR=$EPREFIX/lib
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
97 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
98 if [ -z "$LIBEXEC" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
99 LIBEXECDIR=$EPREFIX/libexec
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
100 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
101 if [ -z "$DATADIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
102 DATADIR=$PREFIX/share
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
103 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
104 if [ -z "$SYSCONFDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
105 SYSCONFDIR=$PREFIX/etc
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
106 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
107 if [ -z "$SHAREDSTATEDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
108 SHAREDSTATEDIR=$PREFIX/com
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
109 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
110 if [ -z "$LOCALSTATEDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
111 LOCALSTATEDIR=$PREFIX/var
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
112 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
113 if [ -z "$INCLUDEDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
114 INCLUDEDIR=$PREFIX/include
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
115 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
116 if [ -z "$INFODIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
117 INFODIR=$PREFIX/info
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
118 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
119 if [ -z "$MANDIR" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
120 MANDIR=$PREFIX/man
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 fi
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
123 which pkg-config > /dev/null
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
124 if [ $? -eq 0 ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
125 PKG_CONFIG=pkg-config
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
126 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
127 PKG_CONFIG=false
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 fi
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
130 # Simple uname based platform detection
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
131 # $PLATFORM is used for platform dependent dependency selection
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
132 printf "detect platform... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
133 if [ $OS = SunOS ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
134 PLATFORM="solaris sunos unix svr4"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
135 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
136 if [ $OS = Linux ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
137 PLATFORM="linux unix"
79
052224670baf configure script updated
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
138 fi
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
139 if [ $OS = FreeBSD ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
140 PLATFORM="freebsd bsd unix"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
141 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
142 if [ $OS = Darwin ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
143 PLATFORM="macos osx bsd unix"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
144 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
145 echo $OS | grep "MINGW" > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
146 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
147 PLATFORM="windows mingw"
105
86d729874ff4 added FreeBSD support and fixed gtk2 build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 79
diff changeset
148 fi
86d729874ff4 added FreeBSD support and fixed gtk2 build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 79
diff changeset
149
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
150 if [ -z "$PLATFORM" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
151 PLATFORM="unix"
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 fi
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
154 for p in $PLATFORM
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
155 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
156 PLATFORM_NAME=$p
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
157 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
158 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
159 echo $PLATFORM_NAME
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
161 isplatform()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
162 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
163 for p in $PLATFORM
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
164 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
165 if [ $p = $1 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
166 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
167 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
168 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
169 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
170 }
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
171 isnotplatform()
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
172 {
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
173 for p in $PLATFORM
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
174 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
175 if [ $p = $1 ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
176 return 1
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
177 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
178 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
179 return 0
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
180 }
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
182 # generate config.mk and config.h
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
183 cat > $TEMP_DIR/config.mk << __EOF__
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 #
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 # config.mk generated by configure
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 #
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
187
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
188 # general vars
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
189
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
190 PREFIX=$PREFIX
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
191 EPREFIX=$EPREFIX
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
192
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
193 BINDIR=$BINDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
194 SBINDIR=$SBINDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
195 LIBDIR=$LIBDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
196 LIBEXECDIR=$LIBEXECDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
197 DATADIR=$DATADIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
198 SYSCONFDIR=$SYSCONFDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
199 SHAREDSTATEDIR=$SHAREDSTATEDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
200 LOCALSTATEDIR=$LOCALSTATEDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
201 INCLUDEDIR=$INCLUDEDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
202 INFODIR=$INFODIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
203 MANDIR=$MANDIR
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
204
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
205 __EOF__
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
207 echo > $TEMP_DIR/make.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
208
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
209 ENV_CFLAGS=$CFLAGS
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
210 ENV_LDFLAGS=$LDFLAGS
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
211 ENV_CXXFLAGS=$CXXFLAGS
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
212
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
213 # Toolchain detection
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
214 # this will insert make vars to config.mk
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
215 . make/toolchain.sh
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
216
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
217 # add user specified flags to config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
218 echo >> $TEMP_DIR/config.mk
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
219 if [ ! -z "${ENV_CFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
220 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
221 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
222 if [ ! -z "${ENV_CXXFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
223 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
224 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
225 if [ ! -z "${ENV_LDFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
226 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
227 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
228
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
229 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
230 # DEPENDENCIES
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
231 #
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
233 dependency_qt4()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
234 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
235 printf "checking for qt4... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
236 # dependency qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
237 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
238 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
239 qmake-qt4 -o - /dev/null | grep DEFINES\ > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
240 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
241 CFLAGS="$CFLAGS `qmake-qt4 -o - /dev/null | grep DEFINES\ `"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
242 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
243 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
244 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
245 qmake-qt4 -o - /dev/null | grep INCPATH\ > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
246 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
247 CFLAGS="$CFLAGS `qmake-qt4 -o - /dev/null | grep INCPATH\ `"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
248 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
249 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
250 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
251 > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
252 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
253 LDFLAGS="$LDFLAGS ``"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
254 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
255 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
256 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
257 which qmake-qt4 > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
258 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
259 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
260 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
261 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
262 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
263 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
264
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
265 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
266 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
267 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
268 dependency_gtk2legacy()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
269 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
270 printf "checking for gtk2legacy... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
271 # dependency gtk2legacy
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
272 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
273 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
274 if [ -z "$PKG_CONFIG" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
275 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
276 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
277 $PKG_CONFIG gtk+-2.0
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
278 if [ $? -ne 0 ] ; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
279 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
280 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
281 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-2.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
282 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-2.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
283 CFLAGS="$CFLAGS -DUI_GTK2 -DUI_GTK2LEGACY"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
284 LDFLAGS="$LDFLAGS -lpthread"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
285 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
286 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
287 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
288
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
289 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
290 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
291 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
292 dependency_qt5()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
293 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
294 printf "checking for qt5... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
295 # dependency qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
296 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
297 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
298 qmake-qt5 -o - /dev/null | grep DEFINES\ > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
299 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
300 CFLAGS="$CFLAGS `qmake-qt5 -o - /dev/null | grep DEFINES\ `"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
301 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
302 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
303 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
304 qmake-qt5 -o - /dev/null | grep INCPATH\ > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
305 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
306 CFLAGS="$CFLAGS `qmake-qt5 -o - /dev/null | grep INCPATH\ `"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
307 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
308 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
309 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
310 > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
311 if [ $? -eq 0 ]; then
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
312 LDFLAGS="$LDFLAGS ``"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
313 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
314 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
315 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
316 which qmake-qt5 > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
317 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
318 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
319 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
320 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
321 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
322 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
323
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
324 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
325 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
326 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
327 dependency_gtk2()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
328 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
329 printf "checking for gtk2... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
330 # dependency gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
331 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
332 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
333 if [ -z "$PKG_CONFIG" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
334 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
335 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
336 $PKG_CONFIG gtk+-2.0
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
337 if [ $? -ne 0 ] ; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
338 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
339 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
340 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-2.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
341 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-2.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
342 CFLAGS="$CFLAGS -DUI_GTK2"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
343 LDFLAGS="$LDFLAGS -lpthread"
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
344 pkg-config --atleast-version=2.20 gtk+-2.0 > /dev/null
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
345 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
346 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
347 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
348 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
349 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
350 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
351
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
352 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
353 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
354 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
355 dependency_gtk3()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
356 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
357 printf "checking for gtk3... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
358 # dependency gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
359 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
360 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
361 if [ -z "$PKG_CONFIG" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
362 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
363 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
364 $PKG_CONFIG gtk+-3.0
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
365 if [ $? -ne 0 ] ; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
366 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
367 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
368 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-3.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
369 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-3.0`"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
370 CFLAGS="$CFLAGS -DUI_GTK3"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
371 LDFLAGS="$LDFLAGS -lpthread"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
372 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
373 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
374 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
375
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
376 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
377 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
378 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
379 dependency_motif()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
380 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
381 printf "checking for motif... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
382 # dependency motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
383 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
384 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
385 CFLAGS="$CFLAGS -DUI_MOTIF"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
386 LDFLAGS="$LDFLAGS -lXm -lXt -lX11 -lpthread"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
387 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
388 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
389 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
390
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
391 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
392 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
393 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
394 dependency_wpf()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
395 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
396 printf "checking for wpf... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
397 # dependency wpf platform="windows"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
398 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
399 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
400 if isnotplatform "windows"; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
401 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
402 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
403 CFLAGS="$CFLAGS -DUI_WPF"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
404 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
405 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
406 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
407
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
408 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
409 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
410 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
411 dependency_cocoa()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
412 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
413 printf "checking for cocoa... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
414 # dependency cocoa platform="macos"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
415 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
416 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
417 if isnotplatform "macos"; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
418 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
419 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
420 CFLAGS="$CFLAGS -DUI_COCOA"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
421 LDFLAGS="$LDFLAGS -lobjc -framework Cocoa"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
422 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
423 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
424 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
425
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
426 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
427 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
428 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
429
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
430 DEPENDENCIES_FAILED=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
431 ERROR=0
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
432 # general dependencies
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
433 CFLAGS=
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
434 LDFLAGS=
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
435 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
436 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
437 if isnotplatform "macos"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
438 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
439 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
440 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
441 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
442
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
443 cat >> $TEMP_DIR/make.mk << __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
444 OBJ_EXT = o
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
445 LIB_EXT = a
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
446 PACKAGE_SCRIPT = package_osx.sh
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
447
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
448 __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
449
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
450 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
451 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
452
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
453 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
454 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
455 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
456 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
457 if isnotplatform "unix"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
458 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
459 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
460 if isplatform "macos"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
461 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
462 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
463 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
464 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
465
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
466 cat >> $TEMP_DIR/make.mk << __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
467 OBJ_EXT = o
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
468 LIB_EXT = a
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
469 PACKAGE_SCRIPT = package_unix.sh
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
470
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
471 __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
472
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
473 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
474 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
475
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
476 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
477 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
478
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
479 # add general dependency flags to config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
480 echo >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
481 if [ ! -z "${CFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
482 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
483 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
484 if [ ! -z "${CXXFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
485 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
486 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
487 if [ ! -z "${LDFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
488 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
489 fi
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
490
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
491 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
492 # OPTION VALUES
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
493 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
494 checkopt_toolkit_gtk3()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
495 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
496 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
497 dependency_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
498 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
499 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
500 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
501 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
502 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
503 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
504 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
505 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
506 GTKOBJ = draw_cairo.o
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
507
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
508 __EOF__
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
509 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
510 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
511 checkopt_toolkit_gtk2()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
512 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
513 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
514 dependency_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
515 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
516 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
517 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
518 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
519 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
520 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
521 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
522 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
523 GTKOBJ = draw_cairo.o
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
524
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
525 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
526 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
527 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
528 checkopt_toolkit_gtk2legacy()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
529 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
530 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
531 dependency_gtk2legacy
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
532 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
533 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
534 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
535 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
536 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
537 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
538 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
539 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
540 GTKOBJ = draw_gdk.o
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
541
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
542 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
543 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
544 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
545 checkopt_toolkit_qt5()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
546 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
547 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
548 dependency_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
549 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
550 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
551 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
552 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
553 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
554 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
555 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
556 TOOLKIT = qt
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
557 LD = $(CXX)
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
558
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
559 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
560 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
561 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
562 checkopt_toolkit_qt4()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
563 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
564 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
565 dependency_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
566 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
567 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
568 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
569 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
570 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
571 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
572 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
573 TOOLKIT = qt
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
574 LD = $(CXX)
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
575
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
576 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
577 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
578 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
579 checkopt_toolkit_motif()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
580 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
581 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
582 dependency_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
583 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
584 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
585 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
586 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
587 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
588 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
589 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
590 TOOLKIT = motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
591
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
592 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
593 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
594 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
595
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
596 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
597 # TARGETS
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
598 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
599 CFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
600 CXXFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
601 LDFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
602
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
603 # Target: tk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
604 CFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
605 LDFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
606 CXXFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
607
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
608
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
609 # Features
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
610
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
611 # Option: --toolkit
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
612 if [ -z $OPT_TOOLKIT ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
613 SAVED_ERROR=$ERROR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
614 SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
615 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
616 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
617 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
618 if isplatform "windows"; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
619 checkopt_toolkit_wpf
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
620 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
621 echo " toolkit: wpf" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
622 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
623 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
624 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
625 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
626 if isplatform "macos"; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
627 checkopt_toolkit_cocoa
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
628 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
629 echo " toolkit: cocoa" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
630 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
631 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
632 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
633 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
634 checkopt_toolkit_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
635 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
636 echo " toolkit: gtk3" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
637 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
638 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
639 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
640 checkopt_toolkit_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
641 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
642 echo " toolkit: qt5" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
643 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
644 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
645 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
646 checkopt_toolkit_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
647 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
648 echo " toolkit: gtk2" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
649 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
650 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
651 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
652 checkopt_toolkit_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
653 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
654 echo " toolkit: qt4" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
655 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
656 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
657 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
658 checkopt_toolkit_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
659 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
660 echo " toolkit: motif" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
661 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
662 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
663 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
664 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
665 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
666 if [ $ERROR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
667 SAVED_ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
668 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
669 ERROR=$SAVED_ERROR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
670 DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
671 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
672 if false; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
673 false
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
674 elif [ $OPT_TOOLKIT = "gtk3" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
675 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
676 checkopt_toolkit_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
677 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
678 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
679 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
680 elif [ $OPT_TOOLKIT = "gtk2" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
681 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
682 checkopt_toolkit_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
683 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
684 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
685 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
686 elif [ $OPT_TOOLKIT = "gtk2legacy" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
687 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
688 checkopt_toolkit_gtk2legacy
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
689 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
690 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
691 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
692 elif [ $OPT_TOOLKIT = "qt5" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
693 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
694 checkopt_toolkit_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
695 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
696 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
697 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
698 elif [ $OPT_TOOLKIT = "qt4" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
699 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
700 checkopt_toolkit_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
701 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
702 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
703 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
704 elif [ $OPT_TOOLKIT = "motif" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
705 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
706 checkopt_toolkit_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
707 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
708 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
709 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
710 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
711 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
712
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
713 echo >> $TEMP_DIR/config.mk
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
714 if [ ! -z "${CFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
715 echo "TK_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
716 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
717 if [ ! -z "${CXXFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
718 echo "TK_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
719 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
720 if [ ! -z "${LDFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
721 echo "TK_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
722 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
723
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
724 if [ $ERROR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
725 echo
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
726 echo "Error: Unresolved dependencies"
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
727 echo $DEPENDENCIES_FAILED
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
728 rm -Rf $TEMP_DIR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
729 exit 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
730 fi
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
731
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
732 echo "configure finished"
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
733 echo
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
734 echo "Build Config:"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
735 echo " PREFIX: $PREFIX"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
736 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
737 echo "Options:"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
738 cat $TEMP_DIR/options
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
739 echo
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
740 cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
741 rm -Rf $TEMP_DIR
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
742
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
743

mercurial