Thu, 03 Oct 2024 18:52:51 +0200
improve pathbar visuals
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 | |
44
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
75 | --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|motif) |
0
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 | } |
44
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
511 | dependency_error_libadwaita() |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
512 | { |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
513 | print_check_msg "$dep_checked_libadwaita" "checking for libadwaita... " |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
514 | # dependency libadwaita |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
515 | while true |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
516 | do |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
517 | if [ -z "$PKG_CONFIG" ]; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
518 | break |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
519 | fi |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
520 | if test_pkg_config "libadwaita-1" "" "" "" ; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
521 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libadwaita-1`" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
522 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libadwaita-1`" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
523 | else |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
524 | break |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
525 | fi |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
526 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK4 -DUI_LIBADWAITA" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
527 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
528 | print_check_msg "$dep_checked_libadwaita" "yes\n" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
529 | dep_checked_libadwaita=1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
530 | return 1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
531 | done |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
532 | |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
533 | print_check_msg "$dep_checked_libadwaita" "no\n" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
534 | dep_checked_libadwaita=1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
535 | return 0 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
536 | } |
32 | 537 | dependency_error_motif() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
538 | { |
32 | 539 | print_check_msg "$dep_checked_motif" "checking for motif... " |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
540 | # dependency motif platform="bsd" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
541 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
542 | do |
32 | 543 | if notisplatform "bsd"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
544 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
545 | fi |
32 | 546 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF -I/usr/local/include/X11" |
547 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
548 | print_check_msg "$dep_checked_motif" "yes\n" | |
549 | dep_checked_motif=1 | |
550 | return 1 | |
551 | done | |
552 | ||
553 | # dependency motif | |
554 | while true | |
555 | do | |
556 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF" | |
557 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" | |
558 | print_check_msg "$dep_checked_motif" "yes\n" | |
559 | dep_checked_motif=1 | |
560 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
561 | done |
32 | 562 | |
563 | print_check_msg "$dep_checked_motif" "no\n" | |
564 | dep_checked_motif=1 | |
565 | return 0 | |
566 | } | |
567 | dependency_error_libxml2() | |
568 | { | |
569 | print_check_msg "$dep_checked_libxml2" "checking for libxml2... " | |
570 | # dependency libxml2 platform="windows" | |
571 | while true | |
572 | do | |
573 | if notisplatform "windows"; then | |
574 | break | |
575 | fi | |
576 | if tmp_flags=`xml2-config --cflags` ; then | |
577 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
578 | else | |
579 | break | |
580 | fi | |
581 | if tmp_flags=`xml2-config --libs` ; then | |
582 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
583 | else | |
584 | break | |
585 | fi | |
586 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
587 | dep_checked_libxml2=1 | |
588 | return 1 | |
589 | done | |
590 | ||
591 | # dependency libxml2 platform="macos" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
592 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
593 | do |
32 | 594 | if notisplatform "macos"; then |
595 | break | |
596 | fi | |
597 | if tmp_flags=`xml2-config --cflags` ; then | |
598 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
599 | else | |
600 | break | |
601 | fi | |
602 | if tmp_flags=`xml2-config --libs` ; then | |
603 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
604 | else | |
605 | break | |
606 | fi | |
607 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
608 | dep_checked_libxml2=1 | |
609 | return 1 | |
610 | done | |
611 | ||
612 | # dependency libxml2 | |
613 | while true | |
614 | do | |
615 | if [ -z "$PKG_CONFIG" ]; then | |
616 | break | |
617 | fi | |
618 | if test_pkg_config "libxml-2.0" "" "" "" ; then | |
619 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | |
620 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`" | |
621 | else | |
622 | break | |
623 | fi | |
624 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
625 | dep_checked_libxml2=1 | |
626 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
627 | done |
32 | 628 | |
629 | # dependency libxml2 | |
630 | while true | |
631 | do | |
632 | if tmp_flags=`xml2-config --cflags` ; then | |
633 | TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags" | |
634 | else | |
635 | break | |
636 | fi | |
637 | if tmp_flags=`xml2-config --libs` ; then | |
638 | TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags" | |
639 | else | |
640 | break | |
641 | fi | |
642 | print_check_msg "$dep_checked_libxml2" "yes\n" | |
643 | dep_checked_libxml2=1 | |
644 | return 1 | |
645 | done | |
646 | ||
647 | print_check_msg "$dep_checked_libxml2" "no\n" | |
648 | dep_checked_libxml2=1 | |
649 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
650 | } |
32 | 651 | dependency_error_cocoa() |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
652 | { |
32 | 653 | print_check_msg "$dep_checked_cocoa" "checking for cocoa... " |
654 | # dependency cocoa platform="macos" | |
655 | while true | |
656 | do | |
657 | if notisplatform "macos"; then | |
658 | break | |
659 | fi | |
660 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_COCOA" | |
661 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lobjc -framework Cocoa" | |
662 | print_check_msg "$dep_checked_cocoa" "yes\n" | |
663 | dep_checked_cocoa=1 | |
664 | return 1 | |
665 | done | |
666 | ||
667 | print_check_msg "$dep_checked_cocoa" "no\n" | |
668 | dep_checked_cocoa=1 | |
669 | return 0 | |
670 | } | |
671 | dependency_error_winui() | |
672 | { | |
673 | print_check_msg "$dep_checked_winui" "checking for winui... " | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
674 | # dependency winui platform="windows" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
675 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
676 | do |
32 | 677 | if notisplatform "windows"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
678 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
679 | fi |
32 | 680 | TEMP_CFLAGS="$TEMP_CFLAGS -DUI_WINUI" |
681 | print_check_msg "$dep_checked_winui" "yes\n" | |
682 | dep_checked_winui=1 | |
683 | return 1 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
684 | done |
32 | 685 | |
686 | print_check_msg "$dep_checked_winui" "no\n" | |
687 | dep_checked_winui=1 | |
688 | return 0 | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
689 | } |
32 | 690 | |
691 | # start collecting dependency information | |
692 | echo > "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
693 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
694 | DEPENDENCIES_FAILED= |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
695 | ERROR=0 |
32 | 696 | # unnamed dependencies |
697 | TEMP_CFLAGS= | |
698 | TEMP_CXXFLAGS= | |
699 | TEMP_LDFLAGS= | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
700 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
701 | do |
32 | 702 | while true |
703 | do | |
704 | if [ -z "$lang_c" ] ; then | |
705 | ERROR=1 | |
706 | break | |
707 | fi | |
708 | ||
709 | break | |
710 | done | |
711 | break | |
712 | done | |
713 | while true | |
714 | do | |
715 | if notisplatform "macos"; then | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
716 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
717 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
718 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
719 | do |
32 | 720 | |
721 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
722 | OBJ_EXT = o | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
723 | LIB_EXT = .a |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
724 | PACKAGE_SCRIPT = package_osx.sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
725 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
726 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
727 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
728 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
729 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
730 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
731 | do |
32 | 732 | if notisplatform "unix"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
733 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
734 | fi |
32 | 735 | if isplatform "macos" || istoolchain "macos"; then |
0
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 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
738 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
739 | do |
32 | 740 | |
741 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
742 | OBJ_EXT = o | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
743 | LIB_EXT = .a |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
744 | PACKAGE_SCRIPT = package_unix.sh |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
745 | __EOF__ |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
746 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
747 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
748 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
749 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
750 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
751 | do |
32 | 752 | if notisplatform "bsd"; then |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
753 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
754 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
755 | while true |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
756 | do |
32 | 757 | |
758 | TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include" | |
759 | TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
760 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
761 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
762 | break |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
763 | done |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
764 | |
32 | 765 | # add general dependency flags to flags.mk |
766 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
767 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then | |
768 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
769 | fi |
32 | 770 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
771 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
772 | fi |
32 | 773 | if [ -n "${TEMP_LDFLAGS}" ]; then |
774 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
775 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
776 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
777 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
778 | # OPTION VALUES |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
779 | # |
44
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
780 | checkopt_toolkit_libadwaita() |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
781 | { |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
782 | VERR=0 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
783 | if dependency_error_libadwaita ; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
784 | VERR=1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
785 | fi |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
786 | if [ $VERR -ne 0 ]; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
787 | return 1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
788 | fi |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
789 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
790 | TOOLKIT = gtk |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
791 | GTKOBJ = draw_cairo.o |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
792 | __EOF__ |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
793 | return 0 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
794 | } |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
795 | checkopt_toolkit_gtk4() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
796 | { |
32 | 797 | VERR=0 |
798 | if dependency_error_gtk4 ; then | |
799 | VERR=1 | |
800 | fi | |
801 | if [ $VERR -ne 0 ]; then | |
802 | return 1 | |
803 | fi | |
804 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
805 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
806 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
807 | __EOF__ |
32 | 808 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
809 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
810 | checkopt_toolkit_gtk3() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
811 | { |
32 | 812 | VERR=0 |
813 | if dependency_error_gtk3 ; then | |
814 | VERR=1 | |
815 | fi | |
816 | if [ $VERR -ne 0 ]; then | |
817 | return 1 | |
818 | fi | |
819 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
820 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
821 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
822 | __EOF__ |
32 | 823 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
824 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
825 | checkopt_toolkit_gtk2() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
826 | { |
32 | 827 | VERR=0 |
828 | if dependency_error_gtk2 ; then | |
829 | VERR=1 | |
830 | fi | |
831 | if [ $VERR -ne 0 ]; then | |
832 | return 1 | |
833 | fi | |
834 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
835 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
836 | GTKOBJ = draw_cairo.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
837 | __EOF__ |
32 | 838 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
839 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
840 | checkopt_toolkit_gtk2legacy() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
841 | { |
32 | 842 | VERR=0 |
843 | if dependency_error_gtk2legacy ; then | |
844 | VERR=1 | |
845 | fi | |
846 | if [ $VERR -ne 0 ]; then | |
847 | return 1 | |
848 | fi | |
849 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
850 | TOOLKIT = gtk |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
851 | GTKOBJ = draw_gdk.o |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
852 | __EOF__ |
32 | 853 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
854 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
855 | checkopt_toolkit_qt5() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
856 | { |
32 | 857 | VERR=0 |
858 | if dependency_error_qt5 ; then | |
859 | VERR=1 | |
860 | fi | |
861 | if [ $VERR -ne 0 ]; then | |
862 | return 1 | |
863 | fi | |
864 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
865 | TOOLKIT = qt |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
866 | LD = $(CXX) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
867 | __EOF__ |
32 | 868 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
869 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
870 | checkopt_toolkit_qt4() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
871 | { |
32 | 872 | VERR=0 |
873 | if dependency_error_qt4 ; then | |
874 | VERR=1 | |
875 | fi | |
876 | if [ $VERR -ne 0 ]; then | |
877 | return 1 | |
878 | fi | |
879 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
880 | TOOLKIT = qt |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
881 | LD = $(CXX) |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
882 | __EOF__ |
32 | 883 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
884 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
885 | checkopt_toolkit_motif() |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
886 | { |
32 | 887 | VERR=0 |
888 | if dependency_error_motif ; then | |
889 | VERR=1 | |
890 | fi | |
891 | if [ $VERR -ne 0 ]; then | |
892 | return 1 | |
893 | fi | |
894 | cat >> "$TEMP_DIR/make.mk" << __EOF__ | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
895 | TOOLKIT = motif |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
896 | __EOF__ |
32 | 897 | return 0 |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
898 | } |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
899 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
900 | # |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
901 | # TARGETS |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
902 | # |
32 | 903 | |
904 | echo >> "$TEMP_DIR/flags.mk" | |
905 | echo "configuring target: dav" | |
906 | echo "# flags for target dav" >> "$TEMP_DIR/flags.mk" | |
907 | TEMP_CFLAGS= | |
908 | TEMP_CXXFLAGS= | |
909 | TEMP_LDFLAGS= | |
910 | ||
911 | if dependency_error_curl; then | |
912 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " | |
913 | ERROR=1 | |
914 | fi | |
915 | if dependency_error_libxml2; then | |
916 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " | |
917 | ERROR=1 | |
918 | fi | |
919 | if dependency_error_openssl; then | |
920 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " | |
921 | ERROR=1 | |
922 | fi | |
923 | ||
924 | # Features | |
925 | ||
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
926 | |
32 | 927 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
928 | echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
929 | fi | |
930 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
931 | echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
932 | fi | |
933 | if [ "$BUILD_TYPE" = "debug" ]; then | |
934 | if [ -n "$lang_c" ]; then | |
935 | echo 'DAV_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
936 | fi | |
937 | if [ -n "$lang_cpp" ]; then | |
938 | echo 'DAV_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
939 | fi | |
940 | fi | |
941 | if [ "$BUILD_TYPE" = "release" ]; then | |
942 | if [ -n "$lang_c" ]; then | |
943 | echo 'DAV_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
944 | fi | |
945 | if [ -n "$lang_cpp" ]; then | |
946 | echo 'DAV_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
947 | fi | |
948 | fi | |
949 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
950 | echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
951 | fi | |
952 | ||
953 | echo >> "$TEMP_DIR/flags.mk" | |
954 | echo "configuring target: tk" | |
955 | echo "# flags for target tk" >> "$TEMP_DIR/flags.mk" | |
956 | TEMP_CFLAGS= | |
957 | TEMP_CXXFLAGS= | |
958 | TEMP_LDFLAGS= | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
959 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
960 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
961 | # Features |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
962 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
963 | # Option: --toolkit |
32 | 964 | if [ -z "$OPT_TOOLKIT" ]; then |
965 | echo "auto-detecting option 'toolkit'" | |
966 | SAVED_ERROR="$ERROR" | |
967 | SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" | |
968 | ERROR=1 | |
969 | while true | |
970 | do | |
971 | if isplatform "windows"; then | |
972 | if checkopt_toolkit_winui ; then | |
973 | echo " toolkit: winui" >> "$TEMP_DIR/options" | |
974 | ERROR=0 | |
975 | break | |
976 | fi | |
977 | fi | |
978 | if isplatform "macos"; then | |
979 | if checkopt_toolkit_cocoa ; then | |
980 | echo " toolkit: cocoa" >> "$TEMP_DIR/options" | |
981 | ERROR=0 | |
982 | break | |
983 | fi | |
984 | fi | |
985 | if checkopt_toolkit_gtk3 ; then | |
986 | echo " toolkit: gtk3" >> "$TEMP_DIR/options" | |
987 | ERROR=0 | |
988 | break | |
989 | fi | |
990 | if checkopt_toolkit_qt5 ; then | |
991 | echo " toolkit: qt5" >> "$TEMP_DIR/options" | |
992 | ERROR=0 | |
993 | break | |
994 | fi | |
995 | if checkopt_toolkit_gtk2 ; then | |
996 | echo " toolkit: gtk2" >> "$TEMP_DIR/options" | |
997 | ERROR=0 | |
998 | break | |
999 | fi | |
1000 | if checkopt_toolkit_qt4 ; then | |
1001 | echo " toolkit: qt4" >> "$TEMP_DIR/options" | |
1002 | ERROR=0 | |
1003 | break | |
1004 | fi | |
1005 | if checkopt_toolkit_motif ; then | |
1006 | echo " toolkit: motif" >> "$TEMP_DIR/options" | |
1007 | ERROR=0 | |
1008 | break | |
1009 | fi | |
1010 | break | |
1011 | done | |
1012 | if [ $ERROR -ne 0 ]; then | |
1013 | SAVED_ERROR=1 | |
1014 | SAVED_DEPENDENCIES_FAILED="option 'toolkit' $SAVED_DEPENDENCIES_FAILED" | |
1015 | fi | |
1016 | ERROR="$SAVED_ERROR" | |
1017 | DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1018 | else |
32 | 1019 | echo "checking option toolkit = $OPT_TOOLKIT" |
1020 | if false; then | |
1021 | false | |
44
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1022 | elif [ "$OPT_TOOLKIT" = "libadwaita" ]; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1023 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1024 | if checkopt_toolkit_libadwaita ; then |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1025 | : |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1026 | else |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1027 | ERROR=1 |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1028 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" |
473954dc6b74
update toolkit: gtk4 improvements
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
32
diff
changeset
|
1029 | fi |
32 | 1030 | elif [ "$OPT_TOOLKIT" = "gtk4" ]; then |
1031 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1032 | if checkopt_toolkit_gtk4 ; then | |
1033 | : | |
1034 | else | |
1035 | ERROR=1 | |
1036 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1037 | fi | |
1038 | elif [ "$OPT_TOOLKIT" = "gtk3" ]; then | |
1039 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1040 | if checkopt_toolkit_gtk3 ; then | |
1041 | : | |
1042 | else | |
1043 | ERROR=1 | |
1044 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1045 | fi | |
1046 | elif [ "$OPT_TOOLKIT" = "gtk2" ]; then | |
1047 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1048 | if checkopt_toolkit_gtk2 ; then | |
1049 | : | |
1050 | else | |
1051 | ERROR=1 | |
1052 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1053 | fi | |
1054 | elif [ "$OPT_TOOLKIT" = "gtk2legacy" ]; then | |
1055 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1056 | if checkopt_toolkit_gtk2legacy ; then | |
1057 | : | |
1058 | else | |
1059 | ERROR=1 | |
1060 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1061 | fi | |
1062 | elif [ "$OPT_TOOLKIT" = "qt5" ]; then | |
1063 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1064 | if checkopt_toolkit_qt5 ; then | |
1065 | : | |
1066 | else | |
1067 | ERROR=1 | |
1068 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1069 | fi | |
1070 | elif [ "$OPT_TOOLKIT" = "qt4" ]; then | |
1071 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1072 | if checkopt_toolkit_qt4 ; then | |
1073 | : | |
1074 | else | |
1075 | ERROR=1 | |
1076 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1077 | fi | |
1078 | elif [ "$OPT_TOOLKIT" = "motif" ]; then | |
1079 | echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options | |
1080 | if checkopt_toolkit_motif ; then | |
1081 | : | |
1082 | else | |
1083 | ERROR=1 | |
1084 | DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED" | |
1085 | fi | |
1086 | fi | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1087 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1088 | |
32 | 1089 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
1090 | echo "TK_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | |
1091 | fi | |
1092 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then | |
1093 | echo "TK_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1094 | fi |
32 | 1095 | if [ "$BUILD_TYPE" = "debug" ]; then |
1096 | if [ -n "$lang_c" ]; then | |
1097 | echo 'TK_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1098 | fi | |
1099 | if [ -n "$lang_cpp" ]; then | |
1100 | echo 'TK_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1101 | fi | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1102 | fi |
32 | 1103 | if [ "$BUILD_TYPE" = "release" ]; then |
1104 | if [ -n "$lang_c" ]; then | |
1105 | echo 'TK_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1106 | fi | |
1107 | if [ -n "$lang_cpp" ]; then | |
1108 | echo 'TK_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" | |
1109 | fi | |
1110 | fi | |
1111 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
1112 | echo "TK_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1113 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1114 | |
32 | 1115 | |
1116 | # final result | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1117 | if [ $ERROR -ne 0 ]; then |
32 | 1118 | echo |
1119 | echo "Error: Unresolved dependencies" | |
1120 | echo "$DEPENDENCIES_FAILED" | |
1121 | abort_configure | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1122 | fi |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1123 | |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1124 | echo "configure finished" |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1125 | echo |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1126 | echo "Build Config:" |
32 | 1127 | echo " PREFIX: $prefix" |
1128 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1129 | echo "Options:" |
32 | 1130 | cat "$TEMP_DIR/options" |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1131 | echo |
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1132 | |
32 | 1133 | # generate the config.mk file |
1134 | cat > "$TEMP_DIR/config.mk" << __EOF__ | |
1135 | # | |
1136 | # config.mk generated by configure | |
1137 | # | |
0
2483f517c562
add existing toolkit code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1138 | |
32 | 1139 | __EOF__ |
1140 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
1141 | cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk | |
1142 | rm -Rf "$TEMP_DIR" |