configure

Sat, 15 Apr 2023 15:40:31 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 15 Apr 2023 15:40:31 +0200
branch
newapi
changeset 170
ad9edb497857
parent 159
84a6e7a7b457
child 171
5065d0d52680
permissions
-rwxr-xr-x

enable gtk4 configure option

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:
170
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
58 --toolkit=(gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|motif)
156
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 }
170
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
379 dependency_gtk4()
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
380 {
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
381 printf "checking for gtk4... "
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
382 # dependency gtk4
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
383 while true
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
384 do
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
385 if [ -z "$PKG_CONFIG" ]; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
386 break
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
387 fi
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
388 $PKG_CONFIG gtk+-4.0
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
389 if [ $? -ne 0 ] ; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
390 break
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
391 fi
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
392 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-4.0`"
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
393 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-4.0`"
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
394 CFLAGS="$CFLAGS -DUI_GTK3"
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
395 LDFLAGS="$LDFLAGS -lpthread"
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
396 echo yes
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
397 return 0
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
398 done
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
399
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
400 echo no
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
401 return 1
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
402 }
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
403 dependency_motif()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
404 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
405 printf "checking for motif... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
406 # dependency motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
407 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
408 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
409 CFLAGS="$CFLAGS -DUI_MOTIF"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
410 LDFLAGS="$LDFLAGS -lXm -lXt -lX11 -lpthread"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
411 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
412 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
413 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
414
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
415 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
416 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
417 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
418 dependency_wpf()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
419 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
420 printf "checking for wpf... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
421 # dependency wpf platform="windows"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
422 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
423 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
424 if isnotplatform "windows"; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
425 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
426 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
427 CFLAGS="$CFLAGS -DUI_WPF"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
428 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
429 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
430 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
431
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
432 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
433 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
434 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
435 dependency_cocoa()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
436 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
437 printf "checking for cocoa... "
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
438 # dependency cocoa platform="macos"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
439 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
440 do
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
441 if isnotplatform "macos"; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
442 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
443 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
444 CFLAGS="$CFLAGS -DUI_COCOA"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
445 LDFLAGS="$LDFLAGS -lobjc -framework Cocoa"
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
446 echo yes
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
447 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
448 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
449
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
450 echo no
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
451 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
452 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
453
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
454 DEPENDENCIES_FAILED=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
455 ERROR=0
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
456 # general dependencies
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
457 CFLAGS=
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
458 LDFLAGS=
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
459 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
460 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
461 if isnotplatform "macos"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
462 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
463 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
464 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
465 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
466
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
467 cat >> $TEMP_DIR/make.mk << __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
468 OBJ_EXT = o
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
469 LIB_EXT = a
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
470 PACKAGE_SCRIPT = package_osx.sh
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
471
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
472 __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
473
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
474 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
475 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
476
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
477 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
478 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
479 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
480 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
481 if isnotplatform "unix"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
482 break
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 isplatform "macos"; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
485 break
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 while true
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
488 do
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
489
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
490 cat >> $TEMP_DIR/make.mk << __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
491 OBJ_EXT = o
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
492 LIB_EXT = a
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
493 PACKAGE_SCRIPT = package_unix.sh
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
494
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
495 __EOF__
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
496
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
497 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
498 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
499
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
500 break
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
501 done
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
502
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
503 # add general dependency flags to config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
504 echo >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
505 if [ ! -z "${CFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
506 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
507 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
508 if [ ! -z "${CXXFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
509 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
510 fi
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
511 if [ ! -z "${LDFLAGS}" ]; then
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
512 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
513 fi
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
514
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
515 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
516 # OPTION VALUES
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
517 #
170
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
518 checkopt_toolkit_gtk4()
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
519 {
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
520 VERR=0
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
521 dependency_gtk4
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
522 if [ $? -ne 0 ]; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
523 VERR=1
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
524 fi
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
525 if [ $VERR -ne 0 ]; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
526 return 1
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
527 fi
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
528 cat >> $TEMP_DIR/make.mk << __EOF__
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
529 TOOLKIT = gtk
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
530 GTKOBJ = draw_cairo.o
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
531
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
532 __EOF__
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
533 return 0
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
534 }
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
535 checkopt_toolkit_gtk3()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
536 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
537 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
538 dependency_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
539 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
540 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
541 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
542 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
543 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
544 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
545 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
546 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
547 GTKOBJ = draw_cairo.o
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
548
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
549 __EOF__
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
550 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
551 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
552 checkopt_toolkit_gtk2()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
553 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
554 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
555 dependency_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
556 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
557 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
558 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
559 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
560 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
561 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
562 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
563 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
564 GTKOBJ = draw_cairo.o
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
565
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
566 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
567 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
568 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
569 checkopt_toolkit_gtk2legacy()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
570 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
571 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
572 dependency_gtk2legacy
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
573 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
574 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
575 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
576 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
577 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
578 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
579 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
580 TOOLKIT = gtk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
581 GTKOBJ = draw_gdk.o
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
582
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
583 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
584 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
585 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
586 checkopt_toolkit_qt5()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
587 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
588 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
589 dependency_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
590 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
591 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
592 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
593 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
594 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
595 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
596 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
597 TOOLKIT = qt
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
598 LD = $(CXX)
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
599
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
600 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
601 return 0
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 checkopt_toolkit_qt4()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
604 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
605 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
606 dependency_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
607 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
608 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
609 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
610 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
611 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
612 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
613 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
614 TOOLKIT = qt
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
615 LD = $(CXX)
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
616
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
617 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
618 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
619 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
620 checkopt_toolkit_motif()
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
621 {
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
622 VERR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
623 dependency_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
624 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
625 VERR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
626 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
627 if [ $VERR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
628 return 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
629 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
630 cat >> $TEMP_DIR/make.mk << __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
631 TOOLKIT = motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
632
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
633 __EOF__
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
634 return 0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
635 }
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
636
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
637 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
638 # TARGETS
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
639 #
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
640 CFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
641 CXXFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
642 LDFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
643
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
644 # Target: tk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
645 CFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
646 LDFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
647 CXXFLAGS=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
648
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
649
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
650 # Features
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
651
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
652 # Option: --toolkit
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
653 if [ -z $OPT_TOOLKIT ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
654 SAVED_ERROR=$ERROR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
655 SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
656 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
657 while true
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
658 do
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
659 if isplatform "windows"; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
660 checkopt_toolkit_wpf
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
661 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
662 echo " toolkit: wpf" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
663 ERROR=0
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 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
666 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
667 if isplatform "macos"; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
668 checkopt_toolkit_cocoa
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
669 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
670 echo " toolkit: cocoa" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
671 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
672 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
673 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
674 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
675 checkopt_toolkit_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
676 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
677 echo " toolkit: gtk3" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
678 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
679 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
680 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
681 checkopt_toolkit_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
682 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
683 echo " toolkit: qt5" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
684 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
685 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
686 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
687 checkopt_toolkit_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
688 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
689 echo " toolkit: gtk2" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
690 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
691 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
692 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
693 checkopt_toolkit_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
694 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
695 echo " toolkit: qt4" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
696 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
697 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
698 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
699 checkopt_toolkit_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
700 if [ $? -eq 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
701 echo " toolkit: motif" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
702 ERROR=0
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
703 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
704 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
705 break
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
706 done
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
707 if [ $ERROR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
708 SAVED_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 ERROR=$SAVED_ERROR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
711 DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED=
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
712 else
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
713 if false; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
714 false
170
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
715 elif [ $OPT_TOOLKIT = "gtk4" ]; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
716 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
717 checkopt_toolkit_gtk4
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
718 if [ $? -ne 0 ]; then
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
719 ERROR=1
ad9edb497857 enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 159
diff changeset
720 fi
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
721 elif [ $OPT_TOOLKIT = "gtk3" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
722 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
723 checkopt_toolkit_gtk3
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
724 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
725 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
726 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
727 elif [ $OPT_TOOLKIT = "gtk2" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
728 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
729 checkopt_toolkit_gtk2
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
730 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
731 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
732 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
733 elif [ $OPT_TOOLKIT = "gtk2legacy" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
734 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
735 checkopt_toolkit_gtk2legacy
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
736 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
737 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
738 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
739 elif [ $OPT_TOOLKIT = "qt5" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
740 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
741 checkopt_toolkit_qt5
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
742 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
743 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
744 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
745 elif [ $OPT_TOOLKIT = "qt4" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
746 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
747 checkopt_toolkit_qt4
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
748 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
749 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
750 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
751 elif [ $OPT_TOOLKIT = "motif" ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
752 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
753 checkopt_toolkit_motif
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
754 if [ $? -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
755 ERROR=1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
756 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
757 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
758 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
759
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
760 echo >> $TEMP_DIR/config.mk
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
761 if [ ! -z "${CFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
762 echo "TK_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
763 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
764 if [ ! -z "${CXXFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
765 echo "TK_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
766 fi
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
767 if [ ! -z "${LDFLAGS}" ]; then
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
768 echo "TK_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
769 fi
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
770
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
771 if [ $ERROR -ne 0 ]; then
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
772 echo
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
773 echo "Error: Unresolved dependencies"
158
4bde241c49b1 update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 156
diff changeset
774 echo $DEPENDENCIES_FAILED
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
775 rm -Rf $TEMP_DIR
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
776 exit 1
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
777 fi
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
778
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
779 echo "configure finished"
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
780 echo
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
781 echo "Build Config:"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
782 echo " PREFIX: $PREFIX"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
783 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
784 echo "Options:"
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
785 cat $TEMP_DIR/options
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
786 echo
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
787 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
788 rm -Rf $TEMP_DIR
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
789
156
62f1a55535e7 new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 105
diff changeset
790

mercurial