Sun, 13 Oct 2024 21:28:09 +0200
add minimally working image viewer (GTK)
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 | |
277 | 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" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
15 | |
277 | 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 | 34 | |
277 | 35 | # custom variables |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
36 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
37 | # features |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
38 | |
277 | 39 | # clean abort |
40 | abort_configure() | |
41 | { | |
42 | rm -Rf "$TEMP_DIR" | |
43 | exit 1 | |
44 | } | |
45 | ||
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
46 | # help text |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
47 | printhelp() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
48 | { |
277 | 49 | echo "Usage: $0 [OPTIONS]..." |
50 | cat << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
51 | Installation directories: |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
52 | --prefix=PREFIX path prefix for architecture-independent files |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
53 | [/usr] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
54 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
55 | [PREFIX] |
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 | --bindir=DIR user executables [EPREFIX/bin] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
58 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
59 | --libexecdir=DIR program executables [EPREFIX/libexec] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
60 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
61 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
62 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
277 | 63 | --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
64 | --libdir=DIR object code libraries [EPREFIX/lib] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
65 | --includedir=DIR C header files [PREFIX/include] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
66 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
67 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
68 | --infodir=DIR info documentation [DATAROOTDIR/info] |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
69 | --mandir=DIR man documentation [DATAROOTDIR/man] |
277 | 70 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
71 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
72 | Options: |
277 | 73 | --debug add extra compile flags for debug builds |
74 | --release add extra compile flags for release builds | |
302
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
75 | --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|motif) |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
76 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
77 | __EOF__ |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
78 | } |
0 | 79 | |
80 | # | |
277 | 81 | # parse arguments |
0 | 82 | # |
277 | 83 | BUILD_TYPE="default" |
84 | for ARG in "$@" | |
0 | 85 | do |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
86 | case "$ARG" in |
277 | 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 | 108 | done |
109 | ||
277 | 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 | 145 | fi |
146 | ||
277 | 147 | # Test for availability of pkg-config |
148 | PKG_CONFIG=`command -v pkg-config` | |
149 | : ${PKG_CONFIG:="false"} | |
0 | 150 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
151 | # Simple uname based platform detection |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
152 | # $PLATFORM is used for platform dependent dependency selection |
277 | 153 | OS=`uname -s` |
154 | OS_VERSION=`uname -r` | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
155 | printf "detect platform... " |
277 | 156 | if [ "$OS" = "SunOS" ]; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
157 | PLATFORM="solaris sunos unix svr4" |
277 | 158 | elif [ "$OS" = "Linux" ]; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
159 | PLATFORM="linux unix" |
277 | 160 | elif [ "$OS" = "FreeBSD" ]; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
161 | PLATFORM="freebsd bsd unix" |
277 | 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 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
167 | PLATFORM="macos osx bsd unix" |
277 | 168 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
169 | PLATFORM="windows mingw" |
105
86d729874ff4
added FreeBSD support and fixed gtk2 build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
79
diff
changeset
|
170 | fi |
277 | 171 | : ${PLATFORM:="unix"} |
0 | 172 | |
277 | 173 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
174 | echo "$PLATFORM_NAME" | |
0 | 175 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
176 | isplatform() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
177 | { |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
178 | for p in $PLATFORM |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
179 | do |
277 | 180 | if [ "$p" = "$1" ]; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
181 | return 0 |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
182 | fi |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
183 | done |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
184 | return 1 |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
185 | } |
277 | 186 | notisplatform() |
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 | for p in $PLATFORM |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
189 | do |
277 | 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 | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
211 | return 1 |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
212 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
213 | done |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
214 | return 0 |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
215 | } |
0 | 216 | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
217 | |
277 | 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 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
236 | __EOF__ |
0 | 237 | |
277 | 238 | # toolchain detection utilities |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
239 | . make/toolchain.sh |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
240 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
241 | # |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
242 | # DEPENDENCIES |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
243 | # |
0 | 244 | |
277 | 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() | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
256 | { |
277 | 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 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
266 | } |
277 | 267 | |
268 | print_check_msg() | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
269 | { |
277 | 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 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
280 | while true |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
281 | do |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
282 | if [ -z "$PKG_CONFIG" ]; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
283 | break |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
284 | fi |
277 | 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`" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
288 | else |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
289 | break |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
290 | fi |
277 | 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_gtk2() | |
303 | { | |
304 | print_check_msg "$dep_checked_gtk2" "checking for gtk2... " | |
305 | # dependency gtk2 | |
306 | while true | |
307 | do | |
308 | if [ -z "$PKG_CONFIG" ]; then | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
309 | break |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
310 | fi |
277 | 311 | if pkg-config --atleast-version=2.20 gtk+-2.0 > /dev/null ; then |
312 | : | |
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 |
277 | 316 | if test_pkg_config "gtk+-2.0" "" "" "" ; then |
317 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-2.0`" | |
318 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-2.0`" | |
319 | else | |
320 | break | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
321 | fi |
277 | 322 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK2" |
323 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
324 | print_check_msg "$dep_checked_gtk2" "yes\n" | |
325 | dep_checked_gtk2=1 | |
326 | return 1 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
327 | done |
277 | 328 | |
329 | print_check_msg "$dep_checked_gtk2" "no\n" | |
330 | dep_checked_gtk2=1 | |
331 | return 0 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
332 | } |
277 | 333 | dependency_error_gtk3() |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
334 | { |
277 | 335 | print_check_msg "$dep_checked_gtk3" "checking for gtk3... " |
336 | # dependency gtk3 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
337 | while true |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
338 | do |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
339 | if [ -z "$PKG_CONFIG" ]; then |
277 | 340 | break |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
341 | fi |
277 | 342 | if test_pkg_config "gtk+-3.0" "" "" "" ; then |
343 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-3.0`" | |
344 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-3.0`" | |
345 | else | |
156
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 |
277 | 348 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3" |
349 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" | |
350 | print_check_msg "$dep_checked_gtk3" "yes\n" | |
351 | dep_checked_gtk3=1 | |
352 | return 1 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
353 | done |
277 | 354 | |
355 | print_check_msg "$dep_checked_gtk3" "no\n" | |
356 | dep_checked_gtk3=1 | |
357 | return 0 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
358 | } |
277 | 359 | dependency_error_gtk4() |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
360 | { |
277 | 361 | print_check_msg "$dep_checked_gtk4" "checking for gtk4... " |
362 | # dependency gtk4 | |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
363 | while true |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
364 | do |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
365 | if [ -z "$PKG_CONFIG" ]; then |
277 | 366 | break |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
367 | fi |
292
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
368 | if test_pkg_config "gtk4" "" "" "" ; then |
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
369 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk4`" |
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
370 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk4`" |
277 | 371 | else |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
372 | break |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
373 | fi |
292
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
374 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK4" |
277 | 375 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" |
376 | print_check_msg "$dep_checked_gtk4" "yes\n" | |
377 | dep_checked_gtk4=1 | |
378 | return 1 | |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
379 | done |
277 | 380 | |
381 | print_check_msg "$dep_checked_gtk4" "no\n" | |
382 | dep_checked_gtk4=1 | |
383 | return 0 | |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
384 | } |
302
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
385 | dependency_error_libadwaita() |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
386 | { |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
387 | print_check_msg "$dep_checked_libadwaita" "checking for libadwaita... " |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
388 | # dependency libadwaita |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
389 | while true |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
390 | do |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
391 | if [ -z "$PKG_CONFIG" ]; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
392 | break |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
393 | fi |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
394 | if test_pkg_config "libadwaita-1" "" "" "" ; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
395 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libadwaita-1`" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
396 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libadwaita-1`" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
397 | else |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
398 | break |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
399 | fi |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
400 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK4 -DUI_LIBADWAITA" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
401 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
402 | print_check_msg "$dep_checked_libadwaita" "yes\n" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
403 | dep_checked_libadwaita=1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
404 | return 1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
405 | done |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
406 | |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
407 | print_check_msg "$dep_checked_libadwaita" "no\n" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
408 | dep_checked_libadwaita=1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
409 | return 0 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
410 | } |
277 | 411 | dependency_error_motif() |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
412 | { |
277 | 413 | print_check_msg "$dep_checked_motif" "checking for motif... " |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
414 | # dependency motif platform="bsd" |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
415 | while true |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
416 | do |
277 | 417 | if notisplatform "bsd"; then |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
418 | break |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
419 | fi |
277 | 420 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF -I/usr/local/include/X11" |
421 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
422 | print_check_msg "$dep_checked_motif" "yes\n" | |
423 | dep_checked_motif=1 | |
424 | return 1 | |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
425 | done |
277 | 426 | |
427 | # dependency motif | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
428 | while true |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
429 | do |
277 | 430 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF" |
431 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
432 | print_check_msg "$dep_checked_motif" "yes\n" | |
433 | dep_checked_motif=1 | |
434 | return 1 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
435 | done |
277 | 436 | |
437 | print_check_msg "$dep_checked_motif" "no\n" | |
438 | dep_checked_motif=1 | |
439 | return 0 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
440 | } |
277 | 441 | dependency_error_cocoa() |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
442 | { |
277 | 443 | print_check_msg "$dep_checked_cocoa" "checking for cocoa... " |
444 | # dependency cocoa platform="macos" | |
445 | while true | |
446 | do | |
447 | if notisplatform "macos"; then | |
448 | break | |
449 | fi | |
450 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_COCOA" | |
451 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lobjc -framework Cocoa" | |
452 | print_check_msg "$dep_checked_cocoa" "yes\n" | |
453 | dep_checked_cocoa=1 | |
454 | return 1 | |
455 | done | |
456 | ||
457 | print_check_msg "$dep_checked_cocoa" "no\n" | |
458 | dep_checked_cocoa=1 | |
459 | return 0 | |
460 | } | |
461 | dependency_error_winui() | |
462 | { | |
463 | print_check_msg "$dep_checked_winui" "checking for winui... " | |
171
5065d0d52680
replace wpf with winui in the configure script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
170
diff
changeset
|
464 | # dependency winui platform="windows" |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
465 | while true |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
466 | do |
277 | 467 | if notisplatform "windows"; then |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
468 | break |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
469 | fi |
277 | 470 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_WINUI" |
471 | print_check_msg "$dep_checked_winui" "yes\n" | |
472 | dep_checked_winui=1 | |
473 | return 1 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
474 | done |
277 | 475 | |
476 | print_check_msg "$dep_checked_winui" "no\n" | |
477 | dep_checked_winui=1 | |
478 | return 0 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
479 | } |
277 | 480 | |
481 | # start collecting dependency information | |
482 | echo > "$TEMP_DIR/flags.mk" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
483 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
484 | DEPENDENCIES_FAILED= |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
485 | ERROR=0 |
277 | 486 | # unnamed dependencies |
487 | TEMP_CFLAGS= | |
488 | TEMP_CXXFLAGS= | |
489 | TEMP_LDFLAGS= | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
490 | while true |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
491 | do |
277 | 492 | while true |
493 | do | |
494 | if [ -z "$lang_c" ] ; then | |
495 | ERROR=1 | |
496 | break | |
497 | fi | |
498 | ||
499 | break | |
500 | done | |
501 | break | |
502 | done | |
503 | while true | |
504 | do | |
505 | if notisplatform "macos"; then | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
506 | break |
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 | while true |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
509 | do |
277 | 510 | |
511 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
174 | 512 | OBJ_EXT = .o |
513 | LIB_EXT = .a | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
514 | PACKAGE_SCRIPT = package_osx.sh |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
515 | __EOF__ |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
516 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
517 | done |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
518 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
519 | done |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
520 | while true |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
521 | do |
277 | 522 | if notisplatform "unix"; then |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
523 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
524 | fi |
277 | 525 | if isplatform "macos" || istoolchain "macos"; then |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
526 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
527 | fi |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
528 | while true |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
529 | do |
277 | 530 | |
531 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
174 | 532 | OBJ_EXT = .o |
533 | LIB_EXT = .a | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
534 | PACKAGE_SCRIPT = package_unix.sh |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
535 | __EOF__ |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
536 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
537 | done |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
538 | break |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
539 | done |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
540 | while true |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
541 | do |
277 | 542 | if notisplatform "bsd"; then |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
543 | break |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
544 | fi |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
545 | while true |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
546 | do |
277 | 547 | |
548 | TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include" | |
549 | TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib" | |
176
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
550 | break |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
551 | done |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
552 | break |
bc63cb601f6d
port motif code to ucx 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
174
diff
changeset
|
553 | done |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
554 | |
277 | 555 | # add general dependency flags to flags.mk |
556 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
557 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
558 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
559 | fi |
277 | 560 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
561 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
562 | fi |
277 | 563 | if [ -n "${TEMP_LDFLAGS}" ]; then |
564 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
565 | fi |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
566 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
567 | # |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
568 | # OPTION VALUES |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
569 | # |
302
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
570 | checkopt_toolkit_libadwaita() |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
571 | { |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
572 | VERR=0 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
573 | if dependency_error_libadwaita ; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
574 | VERR=1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
575 | fi |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
576 | if [ $VERR -ne 0 ]; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
577 | return 1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
578 | fi |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
579 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
580 | TOOLKIT = gtk |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
581 | GTKOBJ = draw_cairo.o |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
582 | __EOF__ |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
583 | return 0 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
584 | } |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
585 | checkopt_toolkit_gtk4() |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
586 | { |
277 | 587 | VERR=0 |
588 | if dependency_error_gtk4 ; then | |
589 | VERR=1 | |
590 | fi | |
591 | if [ $VERR -ne 0 ]; then | |
592 | return 1 | |
593 | fi | |
594 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
595 | TOOLKIT = gtk |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
596 | GTKOBJ = draw_cairo.o |
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
597 | __EOF__ |
277 | 598 | return 0 |
170
ad9edb497857
enable gtk4 configure option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
159
diff
changeset
|
599 | } |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
600 | checkopt_toolkit_gtk3() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
601 | { |
277 | 602 | VERR=0 |
603 | if dependency_error_gtk3 ; then | |
604 | VERR=1 | |
605 | fi | |
606 | if [ $VERR -ne 0 ]; then | |
607 | return 1 | |
608 | fi | |
609 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
610 | TOOLKIT = gtk |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
611 | GTKOBJ = draw_cairo.o |
0 | 612 | __EOF__ |
277 | 613 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
614 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
615 | checkopt_toolkit_gtk2() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
616 | { |
277 | 617 | VERR=0 |
618 | if dependency_error_gtk2 ; then | |
619 | VERR=1 | |
620 | fi | |
621 | if [ $VERR -ne 0 ]; then | |
622 | return 1 | |
623 | fi | |
624 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
625 | TOOLKIT = gtk |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
626 | GTKOBJ = draw_cairo.o |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
627 | __EOF__ |
277 | 628 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
629 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
630 | checkopt_toolkit_gtk2legacy() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
631 | { |
277 | 632 | VERR=0 |
633 | if dependency_error_gtk2legacy ; then | |
634 | VERR=1 | |
635 | fi | |
636 | if [ $VERR -ne 0 ]; then | |
637 | return 1 | |
638 | fi | |
639 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
640 | TOOLKIT = gtk |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
641 | GTKOBJ = draw_gdk.o |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
642 | __EOF__ |
277 | 643 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
644 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
645 | checkopt_toolkit_qt5() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
646 | { |
277 | 647 | VERR=0 |
648 | if dependency_error_qt5 ; then | |
649 | VERR=1 | |
650 | fi | |
651 | if [ $VERR -ne 0 ]; then | |
652 | return 1 | |
653 | fi | |
654 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
655 | TOOLKIT = qt |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
656 | LD = $(CXX) |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
657 | __EOF__ |
277 | 658 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
659 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
660 | checkopt_toolkit_qt4() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
661 | { |
277 | 662 | VERR=0 |
663 | if dependency_error_qt4 ; then | |
664 | VERR=1 | |
665 | fi | |
666 | if [ $VERR -ne 0 ]; then | |
667 | return 1 | |
668 | fi | |
669 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
670 | TOOLKIT = qt |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
671 | LD = $(CXX) |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
672 | __EOF__ |
277 | 673 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
674 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
675 | checkopt_toolkit_motif() |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
676 | { |
277 | 677 | VERR=0 |
678 | if dependency_error_motif ; then | |
679 | VERR=1 | |
680 | fi | |
681 | if [ $VERR -ne 0 ]; then | |
682 | return 1 | |
683 | fi | |
684 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
685 | TOOLKIT = motif |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
686 | __EOF__ |
277 | 687 | return 0 |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
688 | } |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
689 | |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
690 | # |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
691 | # TARGETS |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
692 | # |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
693 | |
277 | 694 | echo >> "$TEMP_DIR/flags.mk" |
695 | echo "configuring target: tk" | |
696 | echo "# flags for target tk" >> "$TEMP_DIR/flags.mk" | |
697 | TEMP_CFLAGS= | |
698 | TEMP_CXXFLAGS= | |
699 | TEMP_LDFLAGS= | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
700 | |
0 | 701 | |
158
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
702 | # Features |
4bde241c49b1
update build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
156
diff
changeset
|
703 | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
704 | # Option: --toolkit |
277 | 705 | if [ -z "$OPT_TOOLKIT" ]; then |
706 | echo "auto-detecting option 'toolkit'" | |
707 | SAVED_ERROR="$ERROR" | |
708 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" | |
709 | ERROR=1 | |
710 | while true | |
711 | do | |
712 | if isplatform "windows"; then | |
713 | if checkopt_toolkit_winui ; then | |
714 | echo " toolkit: winui" >> "$TEMP_DIR/options" | |
715 | ERROR=0 | |
716 | break | |
717 | fi | |
718 | fi | |
719 | if isplatform "macos"; then | |
720 | if checkopt_toolkit_cocoa ; then | |
721 | echo " toolkit: cocoa" >> "$TEMP_DIR/options" | |
722 | ERROR=0 | |
723 | break | |
724 | fi | |
725 | fi | |
292
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
726 | if checkopt_toolkit_gtk4 ; then |
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
727 | echo " toolkit: gtk4" >> "$TEMP_DIR/options" |
277 | 728 | ERROR=0 |
729 | break | |
730 | fi | |
292
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
731 | if checkopt_toolkit_gtk3 ; then |
8e5e7adf5372
add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
277
diff
changeset
|
732 | echo " toolkit: gtk3" >> "$TEMP_DIR/options" |
277 | 733 | ERROR=0 |
734 | break | |
735 | fi | |
736 | if checkopt_toolkit_gtk2 ; then | |
737 | echo " toolkit: gtk2" >> "$TEMP_DIR/options" | |
738 | ERROR=0 | |
739 | break | |
740 | fi | |
741 | if checkopt_toolkit_qt4 ; then | |
742 | echo " toolkit: qt4" >> "$TEMP_DIR/options" | |
743 | ERROR=0 | |
744 | break | |
745 | fi | |
746 | if checkopt_toolkit_motif ; then | |
747 | echo " toolkit: motif" >> "$TEMP_DIR/options" | |
748 | ERROR=0 | |
749 | break | |
750 | fi | |
751 | break | |
752 | done | |
753 | if [ $ERROR -ne 0 ]; then | |
754 | SAVED_ERROR=1 | |
755 | SAVED_DEPENDENCIES_FAILED="option 'toolkit' $SAVED_DEPENDENCIES_FAILED" | |
756 | fi | |
757 | ERROR="$SAVED_ERROR" | |
758 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
759 | else |
277 | 760 | echo "checking option toolkit = $OPT_TOOLKIT" |
761 | if false; then | |
762 | false | |
302
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
763 | elif [ "$OPT_TOOLKIT" = "libadwaita" ]; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
764 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
765 | if checkopt_toolkit_libadwaita ; then |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
766 | : |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
767 | else |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
768 | ERROR=1 |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
769 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" |
b00cbbfeec7a
add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
292
diff
changeset
|
770 | fi |
277 | 771 | elif [ "$OPT_TOOLKIT" = "gtk4" ]; then |
772 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
773 | if checkopt_toolkit_gtk4 ; then | |
774 | : | |
775 | else | |
776 | ERROR=1 | |
777 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
778 | fi | |
779 | elif [ "$OPT_TOOLKIT" = "gtk3" ]; then | |
780 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
781 | if checkopt_toolkit_gtk3 ; then | |
782 | : | |
783 | else | |
784 | ERROR=1 | |
785 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
786 | fi | |
787 | elif [ "$OPT_TOOLKIT" = "gtk2" ]; then | |
788 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
789 | if checkopt_toolkit_gtk2 ; then | |
790 | : | |
791 | else | |
792 | ERROR=1 | |
793 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
794 | fi | |
795 | elif [ "$OPT_TOOLKIT" = "gtk2legacy" ]; then | |
796 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
797 | if checkopt_toolkit_gtk2legacy ; then | |
798 | : | |
799 | else | |
800 | ERROR=1 | |
801 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
802 | fi | |
803 | elif [ "$OPT_TOOLKIT" = "qt5" ]; then | |
804 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
805 | if checkopt_toolkit_qt5 ; then | |
806 | : | |
807 | else | |
808 | ERROR=1 | |
809 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
810 | fi | |
811 | elif [ "$OPT_TOOLKIT" = "qt4" ]; then | |
812 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
813 | if checkopt_toolkit_qt4 ; then | |
814 | : | |
815 | else | |
816 | ERROR=1 | |
817 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
818 | fi | |
819 | elif [ "$OPT_TOOLKIT" = "motif" ]; then | |
820 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
821 | if checkopt_toolkit_motif ; then | |
822 | : | |
823 | else | |
824 | ERROR=1 | |
825 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
826 | fi | |
827 | fi | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
828 | fi |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
829 | |
277 | 830 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
831 | echo "TK_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
832 | fi | |
833 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
834 | echo "TK_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
835 | fi |
277 | 836 | if [ "$BUILD_TYPE" = "debug" ]; then |
837 | if [ -n "$lang_c" ]; then | |
838 | echo 'TK_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
839 | fi | |
840 | if [ -n "$lang_cpp" ]; then | |
841 | echo 'TK_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
842 | fi | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
843 | fi |
277 | 844 | if [ "$BUILD_TYPE" = "release" ]; then |
845 | if [ -n "$lang_c" ]; then | |
846 | echo 'TK_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
847 | fi | |
848 | if [ -n "$lang_cpp" ]; then | |
849 | echo 'TK_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
850 | fi | |
851 | fi | |
852 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
853 | echo "TK_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
854 | fi |
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
855 | |
277 | 856 | |
857 | # final result | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
858 | if [ $ERROR -ne 0 ]; then |
277 | 859 | echo |
860 | echo "Error: Unresolved dependencies" | |
861 | echo "$DEPENDENCIES_FAILED" | |
862 | abort_configure | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
863 | fi |
0 | 864 | |
865 | echo "configure finished" | |
866 | echo | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
867 | echo "Build Config:" |
277 | 868 | echo " PREFIX: $prefix" |
869 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
870 | echo "Options:" |
277 | 871 | cat "$TEMP_DIR/options" |
0 | 872 | echo |
873 | ||
277 | 874 | # generate the config.mk file |
875 | cat > "$TEMP_DIR/config.mk" << __EOF__ | |
876 | # | |
877 | # config.mk generated by configure | |
878 | # | |
156
62f1a55535e7
new build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
105
diff
changeset
|
879 | |
277 | 880 | __EOF__ |
881 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
882 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk | |
883 | rm -Rf "$TEMP_DIR" |