Sun, 16 Jun 2024 11:36:27 +0200
update toolkit
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | #!/bin/sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | |
32 | 3 | # create temporary directory |
4 | TEMP_DIR=".tmp-`uname -n`" | |
5 | rm -Rf "$TEMP_DIR" | |
6 | if mkdir -p "$TEMP_DIR"; then | |
7 | : | |
8 | else | |
9 | echo "Cannot create tmp dir $TEMP_DIR" | |
10 | echo "Abort" | |
11 | exit 1 | |
12 | fi | |
13 | touch "$TEMP_DIR/options" | |
14 | touch "$TEMP_DIR/features" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | |
32 | 16 | # define standard variables |
17 | # also define standard prefix (this is where we will search for config.site) | |
18 | prefix=/usr | |
19 | exec_prefix= | |
20 | bindir= | |
21 | sbindir= | |
22 | libdir= | |
23 | libexecdir= | |
24 | datarootdir= | |
25 | datadir= | |
26 | sysconfdir= | |
27 | sharedstatedir= | |
28 | localstatedir= | |
29 | runstatedir= | |
30 | includedir= | |
31 | infodir= | |
32 | localedir= | |
33 | mandir= | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | |
32 | 35 | # custom variables |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | # features |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | |
32 | 39 | # clean abort |
40 | abort_configure() | |
41 | { | |
42 | rm -Rf "$TEMP_DIR" | |
43 | exit 1 | |
44 | } | |
45 | ||
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | # help text |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | printhelp() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | { |
32 | 49 | echo "Usage: $0 [OPTIONS]..." |
50 | cat << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | Installation directories: |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | --prefix=PREFIX path prefix for architecture-independent files |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | [/usr] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | [PREFIX] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | --bindir=DIR user executables [EPREFIX/bin] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | --libexecdir=DIR program executables [EPREFIX/libexec] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
32 | 63 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | --libdir=DIR object code libraries [EPREFIX/lib] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | --includedir=DIR C header files [PREFIX/include] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | --infodir=DIR info documentation [DATAROOTDIR/info] |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | --mandir=DIR man documentation [DATAROOTDIR/man] |
32 | 70 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | Options: |
32 | 73 | --debug add extra compile flags for debug builds |
74 | --release add extra compile flags for release builds | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | --toolkit=(gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|motif) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | # |
32 | 81 | # parse arguments |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | # |
32 | 83 | BUILD_TYPE="default" |
84 | for ARG in "$@" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | do |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | case "$ARG" in |
32 | 87 | "--prefix="*) prefix=${ARG#--prefix=} ;; |
88 | "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; | |
89 | "--bindir="*) bindir=${ARG#----bindir=} ;; | |
90 | "--sbindir="*) sbindir=${ARG#--sbindir=} ;; | |
91 | "--libdir="*) libdir=${ARG#--libdir=} ;; | |
92 | "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; | |
93 | "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; | |
94 | "--datadir="*) datadir=${ARG#--datadir=} ;; | |
95 | "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; | |
96 | "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; | |
97 | "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; | |
98 | "--includedir="*) includedir=${ARG#--includedir=} ;; | |
99 | "--infodir="*) infodir=${ARG#--infodir=} ;; | |
100 | "--mandir"*) mandir=${ARG#--mandir} ;; | |
101 | "--localedir"*) localedir=${ARG#--localedir} ;; | |
102 | "--help"*) printhelp; abort_configure ;; | |
103 | "--debug") BUILD_TYPE="debug" ;; | |
104 | "--release") BUILD_TYPE="release" ;; | |
105 | "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; | |
106 | "-"*) echo "unknown option: $ARG"; abort_configure ;; | |
107 | esac | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | |
32 | 110 | |
111 | ||
112 | # set defaults for dir variables | |
113 | : ${exec_prefix:="$prefix"} | |
114 | : ${bindir:='${exec_prefix}/bin'} | |
115 | : ${sbindir:='${exec_prefix}/sbin'} | |
116 | : ${libdir:='${exec_prefix}/lib'} | |
117 | : ${libexecdir:='${exec_prefix}/libexec'} | |
118 | : ${datarootdir:='${prefix}/share'} | |
119 | : ${datadir:='${datarootdir}'} | |
120 | : ${sysconfdir:='${prefix}/etc'} | |
121 | : ${sharedstatedir:='${prefix}/com'} | |
122 | : ${localstatedir:='${prefix}/var'} | |
123 | : ${runstatedir:='${localstatedir}/run'} | |
124 | : ${includedir:='${prefix}/include'} | |
125 | : ${infodir:='${datarootdir}/info'} | |
126 | : ${mandir:='${datarootdir}/man'} | |
127 | : ${localedir:='${datarootdir}/locale'} | |
128 | ||
129 | # check if a config.site exists and load it | |
130 | if [ -n "$CONFIG_SITE" ]; then | |
131 | # CONFIG_SITE may contain space separated file names | |
132 | for cs in $CONFIG_SITE; do | |
133 | printf "loading defaults from $cs... " | |
134 | . "$cs" | |
135 | echo ok | |
136 | done | |
137 | elif [ -f "$prefix/share/config.site" ]; then | |
138 | printf "loading site defaults... " | |
139 | . "$prefix/share/config.site" | |
140 | echo ok | |
141 | elif [ -f "$prefix/etc/config.site" ]; then | |
142 | printf "loading site defaults... " | |
143 | . "$prefix/etc/config.site" | |
144 | echo ok | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | |
32 | 147 | # Test for availability of pkg-config |
148 | PKG_CONFIG=`command -v pkg-config` | |
149 | : ${PKG_CONFIG:="false"} | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | # Simple uname based platform detection |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | # $PLATFORM is used for platform dependent dependency selection |
32 | 153 | OS=`uname -s` |
154 | OS_VERSION=`uname -r` | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | printf "detect platform... " |
32 | 156 | if [ "$OS" = "SunOS" ]; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | PLATFORM="solaris sunos unix svr4" |
32 | 158 | elif [ "$OS" = "Linux" ]; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | PLATFORM="linux unix" |
32 | 160 | elif [ "$OS" = "FreeBSD" ]; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | PLATFORM="freebsd bsd unix" |
32 | 162 | elif [ "$OS" = "OpenBSD" ]; then |
163 | PLATFORM="openbsd bsd unix" | |
164 | elif [ "$OS" = "NetBSD" ]; then | |
165 | PLATFORM="netbsd bsd unix" | |
166 | elif [ "$OS" = "Darwin" ]; then | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | PLATFORM="macos osx bsd unix" |
32 | 168 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | PLATFORM="windows mingw" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | fi |
32 | 171 | : ${PLATFORM:="unix"} |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | |
32 | 173 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
174 | echo "$PLATFORM_NAME" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | isplatform() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | { |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | for p in $PLATFORM |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | do |
32 | 180 | if [ "$p" = "$1" ]; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | return 0 |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | return 1 |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | } |
32 | 186 | notisplatform() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187 | { |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | for p in $PLATFORM |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | do |
32 | 190 | if [ "$p" = "$1" ]; then |
191 | return 1 | |
192 | fi | |
193 | done | |
194 | return 0 | |
195 | } | |
196 | istoolchain() | |
197 | { | |
198 | for t in $TOOLCHAIN | |
199 | do | |
200 | if [ "$t" = "$1" ]; then | |
201 | return 0 | |
202 | fi | |
203 | done | |
204 | return 1 | |
205 | } | |
206 | notistoolchain() | |
207 | { | |
208 | for t in $TOOLCHAIN | |
209 | do | |
210 | if [ "$t" = "$1" ]; then | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | return 1 |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | return 0 |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | |
32 | 218 | # generate vars.mk |
219 | cat > "$TEMP_DIR/vars.mk" << __EOF__ | |
220 | prefix=$prefix | |
221 | exec_prefix=$exec_prefix | |
222 | bindir=$bindir | |
223 | sbindir=$sbindir | |
224 | libdir=$libdir | |
225 | libexecdir=$libexecdir | |
226 | datarootdir=$datarootdir | |
227 | datadir=$datadir | |
228 | sysconfdir=$sysconfdir | |
229 | sharedstatedir=$sharedstatedir | |
230 | localstatedir=$localstatedir | |
231 | runstatedir=$runstatedir | |
232 | includedir=$includedir | |
233 | infodir=$infodir | |
234 | mandir=$mandir | |
235 | localedir=$localedir | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
237 | |
32 | 238 | # toolchain detection utilities |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
239 | . make/toolchain.sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
240 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
241 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
242 | # DEPENDENCIES |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
243 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
244 | |
32 | 245 | # check languages |
246 | lang_c= | |
247 | lang_cpp= | |
248 | if detect_c_compiler ; then | |
249 | lang_c=1 | |
250 | fi | |
251 | ||
252 | # create buffer for make variables required by dependencies | |
253 | echo > "$TEMP_DIR/make.mk" | |
254 | ||
255 | test_pkg_config() | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
256 | { |
32 | 257 | if "$PKG_CONFIG" --exists "$1" ; then : |
258 | else return 1 ; fi | |
259 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : | |
260 | else return 1 ; fi | |
261 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : | |
262 | else return 1 ; fi | |
263 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | |
264 | else return 1 ; fi | |
265 | return 0 | |
266 | } | |
267 | ||
268 | print_check_msg() | |
269 | { | |
270 | if [ -z "$1" ]; then | |
271 | shift | |
272 | printf "$@" | |
273 | fi | |
274 | } | |
275 | ||
276 | dependency_error_gtk2legacy() | |
277 | { | |
278 | print_check_msg "$dep_checked_gtk2legacy" "checking for gtk2legacy... " | |
279 | # dependency gtk2legacy | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281 | do |
32 | 282 | if [ -z "$PKG_CONFIG" ]; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
283 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284 | fi |
32 | 285 | if test_pkg_config "gtk+-2.0" "" "" "" ; then |
286 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-2.0`" | |
287 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-2.0`" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | else |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
290 | fi |
32 | 291 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK2 -DUI_GTK2LEGACY" |
292 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
293 | print_check_msg "$dep_checked_gtk2legacy" "yes\n" | |
294 | dep_checked_gtk2legacy=1 | |
295 | return 1 | |
296 | done | |
297 | ||
298 | print_check_msg "$dep_checked_gtk2legacy" "no\n" | |
299 | dep_checked_gtk2legacy=1 | |
300 | return 0 | |
301 | } | |
302 | dependency_error_curl() | |
303 | { | |
304 | print_check_msg "$dep_checked_curl" "checking for curl... " | |
305 | # dependency curl platform="macos" | |
306 | while true | |
307 | do | |
308 | if notisplatform "macos"; then | |
309 | break | |
310 | fi | |
311 | if tmp_flags=`curl-config --cflags` ; then | |
312 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
313 | else |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
314 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
315 | fi |
32 | 316 | if tmp_flags=`curl-config --ldflags` ; then |
317 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
318 | else | |
319 | break | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
320 | fi |
32 | 321 | print_check_msg "$dep_checked_curl" "yes\n" |
322 | dep_checked_curl=1 | |
323 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
324 | done |
32 | 325 | |
326 | # dependency curl | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
327 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
328 | do |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
329 | if [ -z "$PKG_CONFIG" ]; then |
32 | 330 | break |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
331 | fi |
32 | 332 | if test_pkg_config "libcurl" "" "" "" ; then |
333 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libcurl`" | |
334 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libcurl`" | |
335 | else | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
336 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
337 | fi |
32 | 338 | print_check_msg "$dep_checked_curl" "yes\n" |
339 | dep_checked_curl=1 | |
340 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
341 | done |
32 | 342 | |
343 | # dependency curl | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
344 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
345 | do |
32 | 346 | if tmp_flags=`curl-config --cflags` ; then |
347 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
348 | else | |
349 | break | |
350 | fi | |
351 | if tmp_flags=`curl-config --libs` ; then | |
352 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
353 | else |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
354 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
355 | fi |
32 | 356 | print_check_msg "$dep_checked_curl" "yes\n" |
357 | dep_checked_curl=1 | |
358 | return 1 | |
359 | done | |
360 | ||
361 | print_check_msg "$dep_checked_curl" "no\n" | |
362 | dep_checked_curl=1 | |
363 | return 0 | |
364 | } | |
365 | dependency_error_gtk2() | |
366 | { | |
367 | print_check_msg "$dep_checked_gtk2" "checking for gtk2... " | |
368 | # dependency gtk2 | |
369 | while true | |
370 | do | |
371 | if [ -z "$PKG_CONFIG" ]; then | |
372 | break | |
373 | fi | |
374 | if pkg-config --atleast-version=2.20 gtk+-2.0 > /dev/null ; then | |
375 | : | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
376 | else |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
377 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
378 | fi |
32 | 379 | if test_pkg_config "gtk+-2.0" "" "" "" ; then |
380 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-2.0`" | |
381 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-2.0`" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
382 | else |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
383 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
384 | fi |
32 | 385 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK2" |
386 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
387 | print_check_msg "$dep_checked_gtk2" "yes\n" | |
388 | dep_checked_gtk2=1 | |
389 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
390 | done |
32 | 391 | |
392 | print_check_msg "$dep_checked_gtk2" "no\n" | |
393 | dep_checked_gtk2=1 | |
394 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
395 | } |
32 | 396 | dependency_error_gtk3() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
397 | { |
32 | 398 | print_check_msg "$dep_checked_gtk3" "checking for gtk3... " |
399 | # dependency gtk3 | |
400 | while true | |
401 | do | |
402 | if [ -z "$PKG_CONFIG" ]; then | |
403 | break | |
404 | fi | |
405 | if test_pkg_config "gtk+-3.0" "" "" "" ; then | |
406 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-3.0`" | |
407 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-3.0`" | |
408 | else | |
409 | break | |
410 | fi | |
411 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3" | |
412 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
413 | print_check_msg "$dep_checked_gtk3" "yes\n" | |
414 | dep_checked_gtk3=1 | |
415 | return 1 | |
416 | done | |
417 | ||
418 | print_check_msg "$dep_checked_gtk3" "no\n" | |
419 | dep_checked_gtk3=1 | |
420 | return 0 | |
421 | } | |
422 | dependency_error_gtk4() | |
423 | { | |
424 | print_check_msg "$dep_checked_gtk4" "checking for gtk4... " | |
425 | # dependency gtk4 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
426 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
427 | do |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
428 | if [ -z "$PKG_CONFIG" ]; then |
32 | 429 | break |
430 | fi | |
431 | if test_pkg_config "gtk+-4.0" "" "" "" ; then | |
432 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-4.0`" | |
433 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-4.0`" | |
434 | else | |
435 | break | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
436 | fi |
32 | 437 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3" |
438 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
439 | print_check_msg "$dep_checked_gtk4" "yes\n" | |
440 | dep_checked_gtk4=1 | |
441 | return 1 | |
442 | done | |
443 | ||
444 | print_check_msg "$dep_checked_gtk4" "no\n" | |
445 | dep_checked_gtk4=1 | |
446 | return 0 | |
447 | } | |
448 | dependency_error_openssl() | |
449 | { | |
450 | print_check_msg "$dep_checked_openssl" "checking for openssl... " | |
451 | # dependency openssl platform="windows" | |
452 | while true | |
453 | do | |
454 | if notisplatform "windows"; then | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
455 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
456 | fi |
32 | 457 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" |
458 | print_check_msg "$dep_checked_openssl" "yes\n" | |
459 | dep_checked_openssl=1 | |
460 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
461 | done |
32 | 462 | |
463 | # dependency openssl platform="macos" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
464 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
465 | do |
32 | 466 | if notisplatform "macos"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
467 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
468 | fi |
32 | 469 | TEMP_LDFLAGS="$TEMP_LDFLAGS -framework CoreFoundation" |
470 | print_check_msg "$dep_checked_openssl" "yes\n" | |
471 | dep_checked_openssl=1 | |
472 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
473 | done |
32 | 474 | |
475 | # dependency openssl platform="bsd" | |
476 | while true | |
477 | do | |
478 | if notisplatform "bsd"; then | |
479 | break | |
480 | fi | |
481 | if isplatform "macos" || istoolchain "macos"; then | |
482 | break | |
483 | fi | |
484 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" | |
485 | print_check_msg "$dep_checked_openssl" "yes\n" | |
486 | dep_checked_openssl=1 | |
487 | return 1 | |
488 | done | |
489 | ||
490 | # dependency openssl | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
491 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
492 | do |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
493 | if [ -z "$PKG_CONFIG" ]; then |
32 | 494 | break |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
495 | fi |
32 | 496 | if test_pkg_config "openssl" "" "" "" ; then |
497 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | |
498 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`" | |
499 | else | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
500 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
501 | fi |
32 | 502 | print_check_msg "$dep_checked_openssl" "yes\n" |
503 | dep_checked_openssl=1 | |
504 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
505 | done |
32 | 506 | |
507 | print_check_msg "$dep_checked_openssl" "no\n" | |
508 | dep_checked_openssl=1 | |
509 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
510 | } |
32 | 511 | dependency_error_motif() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
512 | { |
32 | 513 | print_check_msg "$dep_checked_motif" "checking for motif... " |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
514 | # dependency motif platform="bsd" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
515 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
516 | do |
32 | 517 | if notisplatform "bsd"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
518 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
519 | fi |
32 | 520 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF -I/usr/local/include/X11" |
521 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
522 | print_check_msg "$dep_checked_motif" "yes\n" | |
523 | dep_checked_motif=1 | |
524 | return 1 | |
525 | done | |
526 | ||
527 | # dependency motif | |
528 | while true | |
529 | do | |
530 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF" | |
531 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
532 | print_check_msg "$dep_checked_motif" "yes\n" | |
533 | dep_checked_motif=1 | |
534 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
535 | done |
32 | 536 | |
537 | print_check_msg "$dep_checked_motif" "no\n" | |
538 | dep_checked_motif=1 | |
539 | return 0 | |
540 | } | |
541 | dependency_error_libxml2() | |
542 | { | |
543 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " | |
544 | # dependency libxml2 platform="windows" | |
545 | while true | |
546 | do | |
547 | if notisplatform "windows"; then | |
548 | break | |
549 | fi | |
550 | if tmp_flags=`xml2-config --cflags` ; then | |
551 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
552 | else | |
553 | break | |
554 | fi | |
555 | if tmp_flags=`xml2-config --libs` ; then | |
556 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
557 | else | |
558 | break | |
559 | fi | |
560 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
561 | dep_checked_libxml2=1 | |
562 | return 1 | |
563 | done | |
564 | ||
565 | # dependency libxml2 platform="macos" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
566 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
567 | do |
32 | 568 | if notisplatform "macos"; then |
569 | break | |
570 | fi | |
571 | if tmp_flags=`xml2-config --cflags` ; then | |
572 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
573 | else | |
574 | break | |
575 | fi | |
576 | if tmp_flags=`xml2-config --libs` ; then | |
577 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
578 | else | |
579 | break | |
580 | fi | |
581 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
582 | dep_checked_libxml2=1 | |
583 | return 1 | |
584 | done | |
585 | ||
586 | # dependency libxml2 | |
587 | while true | |
588 | do | |
589 | if [ -z "$PKG_CONFIG" ]; then | |
590 | break | |
591 | fi | |
592 | if test_pkg_config "libxml-2.0" "" "" "" ; then | |
593 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | |
594 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" | |
595 | else | |
596 | break | |
597 | fi | |
598 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
599 | dep_checked_libxml2=1 | |
600 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
601 | done |
32 | 602 | |
603 | # dependency libxml2 | |
604 | while true | |
605 | do | |
606 | if tmp_flags=`xml2-config --cflags` ; then | |
607 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
608 | else | |
609 | break | |
610 | fi | |
611 | if tmp_flags=`xml2-config --libs` ; then | |
612 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
613 | else | |
614 | break | |
615 | fi | |
616 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
617 | dep_checked_libxml2=1 | |
618 | return 1 | |
619 | done | |
620 | ||
621 | print_check_msg "$dep_checked_libxml2" "no\n" | |
622 | dep_checked_libxml2=1 | |
623 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
624 | } |
32 | 625 | dependency_error_cocoa() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
626 | { |
32 | 627 | print_check_msg "$dep_checked_cocoa" "checking for cocoa... " |
628 | # dependency cocoa platform="macos" | |
629 | while true | |
630 | do | |
631 | if notisplatform "macos"; then | |
632 | break | |
633 | fi | |
634 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_COCOA" | |
635 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lobjc -framework Cocoa" | |
636 | print_check_msg "$dep_checked_cocoa" "yes\n" | |
637 | dep_checked_cocoa=1 | |
638 | return 1 | |
639 | done | |
640 | ||
641 | print_check_msg "$dep_checked_cocoa" "no\n" | |
642 | dep_checked_cocoa=1 | |
643 | return 0 | |
644 | } | |
645 | dependency_error_winui() | |
646 | { | |
647 | print_check_msg "$dep_checked_winui" "checking for winui... " | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
648 | # dependency winui platform="windows" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
649 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
650 | do |
32 | 651 | if notisplatform "windows"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
652 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
653 | fi |
32 | 654 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_WINUI" |
655 | print_check_msg "$dep_checked_winui" "yes\n" | |
656 | dep_checked_winui=1 | |
657 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
658 | done |
32 | 659 | |
660 | print_check_msg "$dep_checked_winui" "no\n" | |
661 | dep_checked_winui=1 | |
662 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
663 | } |
32 | 664 | |
665 | # start collecting dependency information | |
666 | echo > "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
667 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
668 | DEPENDENCIES_FAILED= |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
669 | ERROR=0 |
32 | 670 | # unnamed dependencies |
671 | TEMP_CFLAGS= | |
672 | TEMP_CXXFLAGS= | |
673 | TEMP_LDFLAGS= | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
674 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
675 | do |
32 | 676 | while true |
677 | do | |
678 | if [ -z "$lang_c" ] ; then | |
679 | ERROR=1 | |
680 | break | |
681 | fi | |
682 | ||
683 | break | |
684 | done | |
685 | break | |
686 | done | |
687 | while true | |
688 | do | |
689 | if notisplatform "macos"; then | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
690 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
691 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
692 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
693 | do |
32 | 694 | |
695 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
696 | OBJ_EXT = o | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
697 | LIB_EXT = .a |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
698 | PACKAGE_SCRIPT = package_osx.sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
699 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
700 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
701 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
702 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
703 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
704 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
705 | do |
32 | 706 | if notisplatform "unix"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
707 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
708 | fi |
32 | 709 | if isplatform "macos" || istoolchain "macos"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
710 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
711 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
712 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
713 | do |
32 | 714 | |
715 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
716 | OBJ_EXT = o | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
717 | LIB_EXT = .a |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
718 | PACKAGE_SCRIPT = package_unix.sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
719 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
720 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
721 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
722 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
723 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
724 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
725 | do |
32 | 726 | if notisplatform "bsd"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
727 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
728 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
729 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
730 | do |
32 | 731 | |
732 | TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include" | |
733 | TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
734 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
735 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
736 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
737 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
738 | |
32 | 739 | # add general dependency flags to flags.mk |
740 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
741 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
742 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
743 | fi |
32 | 744 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
745 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
746 | fi |
32 | 747 | if [ -n "${TEMP_LDFLAGS}" ]; then |
748 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
749 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
750 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
751 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
752 | # OPTION VALUES |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
753 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
754 | checkopt_toolkit_gtk4() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
755 | { |
32 | 756 | VERR=0 |
757 | if dependency_error_gtk4 ; then | |
758 | VERR=1 | |
759 | fi | |
760 | if [ $VERR -ne 0 ]; then | |
761 | return 1 | |
762 | fi | |
763 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
764 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
765 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
766 | __EOF__ |
32 | 767 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
768 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
769 | checkopt_toolkit_gtk3() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
770 | { |
32 | 771 | VERR=0 |
772 | if dependency_error_gtk3 ; then | |
773 | VERR=1 | |
774 | fi | |
775 | if [ $VERR -ne 0 ]; then | |
776 | return 1 | |
777 | fi | |
778 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
779 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
780 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
781 | __EOF__ |
32 | 782 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
783 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
784 | checkopt_toolkit_gtk2() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
785 | { |
32 | 786 | VERR=0 |
787 | if dependency_error_gtk2 ; then | |
788 | VERR=1 | |
789 | fi | |
790 | if [ $VERR -ne 0 ]; then | |
791 | return 1 | |
792 | fi | |
793 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
794 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
795 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
796 | __EOF__ |
32 | 797 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
798 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
799 | checkopt_toolkit_gtk2legacy() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
800 | { |
32 | 801 | VERR=0 |
802 | if dependency_error_gtk2legacy ; then | |
803 | VERR=1 | |
804 | fi | |
805 | if [ $VERR -ne 0 ]; then | |
806 | return 1 | |
807 | fi | |
808 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
809 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
810 | GTKOBJ = draw_gdk.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
811 | __EOF__ |
32 | 812 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
813 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
814 | checkopt_toolkit_qt5() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
815 | { |
32 | 816 | VERR=0 |
817 | if dependency_error_qt5 ; then | |
818 | VERR=1 | |
819 | fi | |
820 | if [ $VERR -ne 0 ]; then | |
821 | return 1 | |
822 | fi | |
823 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
824 | TOOLKIT = qt |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
825 | LD = $(CXX) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
826 | __EOF__ |
32 | 827 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
828 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
829 | checkopt_toolkit_qt4() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
830 | { |
32 | 831 | VERR=0 |
832 | if dependency_error_qt4 ; then | |
833 | VERR=1 | |
834 | fi | |
835 | if [ $VERR -ne 0 ]; then | |
836 | return 1 | |
837 | fi | |
838 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
839 | TOOLKIT = qt |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
840 | LD = $(CXX) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
841 | __EOF__ |
32 | 842 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
843 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
844 | checkopt_toolkit_motif() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
845 | { |
32 | 846 | VERR=0 |
847 | if dependency_error_motif ; then | |
848 | VERR=1 | |
849 | fi | |
850 | if [ $VERR -ne 0 ]; then | |
851 | return 1 | |
852 | fi | |
853 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
854 | TOOLKIT = motif |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
855 | __EOF__ |
32 | 856 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
857 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
858 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
859 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
860 | # TARGETS |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
861 | # |
32 | 862 | |
863 | echo >> "$TEMP_DIR/flags.mk" | |
864 | echo "configuring target: dav" | |
865 | echo "# flags for target dav" >> "$TEMP_DIR/flags.mk" | |
866 | TEMP_CFLAGS= | |
867 | TEMP_CXXFLAGS= | |
868 | TEMP_LDFLAGS= | |
869 | ||
870 | if dependency_error_curl; then | |
871 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " | |
872 | ERROR=1 | |
873 | fi | |
874 | if dependency_error_libxml2; then | |
875 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " | |
876 | ERROR=1 | |
877 | fi | |
878 | if dependency_error_openssl; then | |
879 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " | |
880 | ERROR=1 | |
881 | fi | |
882 | ||
883 | # Features | |
884 | ||
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
885 | |
32 | 886 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
887 | echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
888 | fi | |
889 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
890 | echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
891 | fi | |
892 | if [ "$BUILD_TYPE" = "debug" ]; then | |
893 | if [ -n "$lang_c" ]; then | |
894 | echo 'DAV_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
895 | fi | |
896 | if [ -n "$lang_cpp" ]; then | |
897 | echo 'DAV_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
898 | fi | |
899 | fi | |
900 | if [ "$BUILD_TYPE" = "release" ]; then | |
901 | if [ -n "$lang_c" ]; then | |
902 | echo 'DAV_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
903 | fi | |
904 | if [ -n "$lang_cpp" ]; then | |
905 | echo 'DAV_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
906 | fi | |
907 | fi | |
908 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
909 | echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
910 | fi | |
911 | ||
912 | echo >> "$TEMP_DIR/flags.mk" | |
913 | echo "configuring target: tk" | |
914 | echo "# flags for target tk" >> "$TEMP_DIR/flags.mk" | |
915 | TEMP_CFLAGS= | |
916 | TEMP_CXXFLAGS= | |
917 | TEMP_LDFLAGS= | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
918 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
919 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
920 | # Features |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
921 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
922 | # Option: --toolkit |
32 | 923 | if [ -z "$OPT_TOOLKIT" ]; then |
924 | echo "auto-detecting option 'toolkit'" | |
925 | SAVED_ERROR="$ERROR" | |
926 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" | |
927 | ERROR=1 | |
928 | while true | |
929 | do | |
930 | if isplatform "windows"; then | |
931 | if checkopt_toolkit_winui ; then | |
932 | echo " toolkit: winui" >> "$TEMP_DIR/options" | |
933 | ERROR=0 | |
934 | break | |
935 | fi | |
936 | fi | |
937 | if isplatform "macos"; then | |
938 | if checkopt_toolkit_cocoa ; then | |
939 | echo " toolkit: cocoa" >> "$TEMP_DIR/options" | |
940 | ERROR=0 | |
941 | break | |
942 | fi | |
943 | fi | |
944 | if checkopt_toolkit_gtk3 ; then | |
945 | echo " toolkit: gtk3" >> "$TEMP_DIR/options" | |
946 | ERROR=0 | |
947 | break | |
948 | fi | |
949 | if checkopt_toolkit_qt5 ; then | |
950 | echo " toolkit: qt5" >> "$TEMP_DIR/options" | |
951 | ERROR=0 | |
952 | break | |
953 | fi | |
954 | if checkopt_toolkit_gtk2 ; then | |
955 | echo " toolkit: gtk2" >> "$TEMP_DIR/options" | |
956 | ERROR=0 | |
957 | break | |
958 | fi | |
959 | if checkopt_toolkit_qt4 ; then | |
960 | echo " toolkit: qt4" >> "$TEMP_DIR/options" | |
961 | ERROR=0 | |
962 | break | |
963 | fi | |
964 | if checkopt_toolkit_motif ; then | |
965 | echo " toolkit: motif" >> "$TEMP_DIR/options" | |
966 | ERROR=0 | |
967 | break | |
968 | fi | |
969 | break | |
970 | done | |
971 | if [ $ERROR -ne 0 ]; then | |
972 | SAVED_ERROR=1 | |
973 | SAVED_DEPENDENCIES_FAILED="option 'toolkit' $SAVED_DEPENDENCIES_FAILED" | |
974 | fi | |
975 | ERROR="$SAVED_ERROR" | |
976 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
977 | else |
32 | 978 | echo "checking option toolkit = $OPT_TOOLKIT" |
979 | if false; then | |
980 | false | |
981 | elif [ "$OPT_TOOLKIT" = "gtk4" ]; then | |
982 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
983 | if checkopt_toolkit_gtk4 ; then | |
984 | : | |
985 | else | |
986 | ERROR=1 | |
987 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
988 | fi | |
989 | elif [ "$OPT_TOOLKIT" = "gtk3" ]; then | |
990 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
991 | if checkopt_toolkit_gtk3 ; then | |
992 | : | |
993 | else | |
994 | ERROR=1 | |
995 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
996 | fi | |
997 | elif [ "$OPT_TOOLKIT" = "gtk2" ]; then | |
998 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
999 | if checkopt_toolkit_gtk2 ; then | |
1000 | : | |
1001 | else | |
1002 | ERROR=1 | |
1003 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1004 | fi | |
1005 | elif [ "$OPT_TOOLKIT" = "gtk2legacy" ]; then | |
1006 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1007 | if checkopt_toolkit_gtk2legacy ; then | |
1008 | : | |
1009 | else | |
1010 | ERROR=1 | |
1011 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1012 | fi | |
1013 | elif [ "$OPT_TOOLKIT" = "qt5" ]; then | |
1014 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1015 | if checkopt_toolkit_qt5 ; then | |
1016 | : | |
1017 | else | |
1018 | ERROR=1 | |
1019 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1020 | fi | |
1021 | elif [ "$OPT_TOOLKIT" = "qt4" ]; then | |
1022 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1023 | if checkopt_toolkit_qt4 ; then | |
1024 | : | |
1025 | else | |
1026 | ERROR=1 | |
1027 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1028 | fi | |
1029 | elif [ "$OPT_TOOLKIT" = "motif" ]; then | |
1030 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1031 | if checkopt_toolkit_motif ; then | |
1032 | : | |
1033 | else | |
1034 | ERROR=1 | |
1035 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1036 | fi | |
1037 | fi | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1038 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1039 | |
32 | 1040 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
1041 | echo "TK_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
1042 | fi | |
1043 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
1044 | echo "TK_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1045 | fi |
32 | 1046 | if [ "$BUILD_TYPE" = "debug" ]; then |
1047 | if [ -n "$lang_c" ]; then | |
1048 | echo 'TK_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1049 | fi | |
1050 | if [ -n "$lang_cpp" ]; then | |
1051 | echo 'TK_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1052 | fi | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1053 | fi |
32 | 1054 | if [ "$BUILD_TYPE" = "release" ]; then |
1055 | if [ -n "$lang_c" ]; then | |
1056 | echo 'TK_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1057 | fi | |
1058 | if [ -n "$lang_cpp" ]; then | |
1059 | echo 'TK_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1060 | fi | |
1061 | fi | |
1062 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
1063 | echo "TK_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1064 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1065 | |
32 | 1066 | |
1067 | # final result | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1068 | if [ $ERROR -ne 0 ]; then |
32 | 1069 | echo |
1070 | echo "Error: Unresolved dependencies" | |
1071 | echo "$DEPENDENCIES_FAILED" | |
1072 | abort_configure | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1073 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1074 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1075 | echo "configure finished" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1076 | echo |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1077 | echo "Build Config:" |
32 | 1078 | echo " PREFIX: $prefix" |
1079 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1080 | echo "Options:" |
32 | 1081 | cat "$TEMP_DIR/options" |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1082 | echo |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1083 | |
32 | 1084 | # generate the config.mk file |
1085 | cat > "$TEMP_DIR/config.mk" << __EOF__ | |
1086 | # | |
1087 | # config.mk generated by configure | |
1088 | # | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1089 | |
32 | 1090 | __EOF__ |
1091 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
1092 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk | |
1093 | rm -Rf "$TEMP_DIR" |