Sun, 24 May 2026 17:26:24 +0200
replace glew with glad
| 0 | 1 | #!/bin/sh |
| 2 | ||
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
3 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
4 | # some utility functions |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
5 | isplatform() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
6 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
7 | for p in $PLATFORM |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
8 | do |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
9 | if [ "$p" = "$1" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
10 | return 0 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
11 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
12 | done |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
13 | return 1 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
14 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
15 | notisplatform() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
16 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
17 | for p in $PLATFORM |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
18 | do |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
19 | if [ "$p" = "$1" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
20 | return 1 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
21 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
22 | done |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
23 | return 0 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
24 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
25 | istoolchain() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
26 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
27 | for t in $TOOLCHAIN |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
28 | do |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
29 | if [ "$t" = "$1" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
30 | return 0 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
31 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
32 | done |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
33 | return 1 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
34 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
35 | notistoolchain() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
36 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
37 | for t in $TOOLCHAIN |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
38 | do |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
39 | if [ "$t" = "$1" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
40 | return 1 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
41 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
42 | done |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
43 | return 0 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
44 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
45 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
46 | # clean abort |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
47 | abort_configure() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
48 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
49 | rm -Rf "$TEMP_DIR" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
50 | exit 1 |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
51 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
52 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
53 | # Test for availability of pkg-config |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
54 | PKG_CONFIG=`command -v pkg-config` |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
55 | : ${PKG_CONFIG:="false"} |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
56 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
57 | # Simple uname based platform detection |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
58 | # $PLATFORM is used for platform dependent dependency selection |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
59 | OS=`uname -s` |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
60 | OS_VERSION=`uname -r` |
| 285 | 61 | ARCH=`uname -m` |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
62 | printf "detect platform... " |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
63 | if [ "$OS" = "SunOS" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
64 | PLATFORM="solaris sunos unix svr4" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
65 | elif [ "$OS" = "Linux" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
66 | PLATFORM="linux unix" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
67 | elif [ "$OS" = "FreeBSD" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
68 | PLATFORM="freebsd bsd unix" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
69 | elif [ "$OS" = "OpenBSD" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
70 | PLATFORM="openbsd bsd unix" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
71 | elif [ "$OS" = "NetBSD" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
72 | PLATFORM="netbsd bsd unix" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
73 | elif [ "$OS" = "Darwin" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
74 | PLATFORM="macos osx bsd unix" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
75 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
76 | PLATFORM="windows mingw" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
77 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
78 | : ${PLATFORM:="unix"} |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
79 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
80 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
81 | echo "$PLATFORM_NAME" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
82 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
83 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
84 | # help text |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
85 | printhelp() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
86 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
87 | echo "Usage: $0 [OPTIONS]..." |
| 290 | 88 | if [ $has_overridable_config_vars__ -eq 1 ] ; then |
| 89 | echo | |
| 90 | echo "Configuration:" | |
| 91 | fi | |
| 289 | 92 | if true \ |
| 93 | ; then | |
| 94 | : | |
| 290 | 95 | if [ -z "$TOOLKIT_HOME__described__" ] ; then |
| 289 | 96 | TOOLKIT_HOME__described__=1 |
| 97 | cat << '__EOF__' | |
| 98 | --toolkit-home location of the toolkit installation (default: /usr) | |
| 99 | __EOF__ | |
| 100 | fi | |
| 101 | fi | |
| 102 | cat << '__EOF__' | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
103 | |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
104 | Build Types: |
| 103 | 105 | --debug add extra compile flags for debug builds |
| 106 | --release add extra compile flags for release builds | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
107 | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
108 | Optional Features: |
|
281
95d0fe30b3fa
fix style of the descriptions for the helptext
Mike Becker <universe@uap-core.de>
parents:
280
diff
changeset
|
109 | --enable-asan enable address sanitization |
|
95d0fe30b3fa
fix style of the descriptions for the helptext
Mike Becker <universe@uap-core.de>
parents:
280
diff
changeset
|
110 | --enable-tools enable compilation of tools |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
111 | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
112 | __EOF__ |
| 289 | 113 | abort_configure |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
114 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
115 | |
| 0 | 116 | # create temporary directory |
| 117 | TEMP_DIR=".tmp-`uname -n`" | |
| 118 | rm -Rf "$TEMP_DIR" | |
| 119 | if mkdir -p "$TEMP_DIR"; then | |
| 120 | : | |
| 121 | else | |
| 122 | echo "Cannot create tmp dir $TEMP_DIR" | |
| 123 | echo "Abort" | |
| 124 | exit 1 | |
| 125 | fi | |
| 126 | touch "$TEMP_DIR/options" | |
| 127 | touch "$TEMP_DIR/features" | |
| 128 | ||
| 289 | 129 | # config variables |
| 290 | 130 | has_overridable_config_vars__=0 |
|
84
e4116b4b5774
put snake test program into separate directory
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
131 | if true \ |
|
e4116b4b5774
put snake test program into separate directory
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
132 | ; then |
| 289 | 133 | : |
| 290 | 134 | if [ -z "$srcdir__initialized__" ] ; then |
| 289 | 135 | srcdir__initialized__=1 |
| 136 | srcdir=`pwd` | |
| 137 | fi | |
| 290 | 138 | if [ -z "$TOOLKIT_HOME__initialized__" ] ; then |
| 139 | has_overridable_config_vars__=1 | |
| 289 | 140 | TOOLKIT_HOME__initialized__=1 |
| 141 | TOOLKIT_HOME='/usr' | |
| 142 | fi | |
|
84
e4116b4b5774
put snake test program into separate directory
Mike Becker <universe@uap-core.de>
parents:
76
diff
changeset
|
143 | fi |
| 0 | 144 | |
| 145 | # features | |
| 146 | ||
| 147 | # | |
| 148 | # parse arguments | |
| 149 | # | |
| 150 | BUILD_TYPE="default" | |
| 151 | for ARG in "$@" | |
| 152 | do | |
| 153 | case "$ARG" in | |
| 289 | 154 | "--toolkit-home="*) TOOLKIT_HOME=${ARG#--toolkit-home=} ;; |
| 155 | "--help"*) printhelp ;; | |
| 156 | "--debug") BUILD_TYPE="debug" ;; | |
| 157 | "--release") BUILD_TYPE="release" ;; | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
158 | "--enable-asan") FEATURE_ASAN=on ;; |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
159 | "--disable-asan") unset FEATURE_ASAN ;; |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
160 | "--enable-tools") FEATURE_TOOLS=on ;; |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
161 | "--disable-tools") unset FEATURE_TOOLS ;; |
| 0 | 162 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
| 163 | esac | |
| 164 | done | |
| 165 | ||
| 289 | 166 | # toolchain detection utilities |
| 167 | . make/toolchain.sh | |
| 168 | ||
| 169 | # check languages | |
| 170 | lang_c= | |
| 171 | lang_cpp= | |
| 172 | if detect_c_compiler ; then | |
| 173 | lang_c=1 | |
| 174 | fi | |
| 175 | ||
| 0 | 176 | |
| 1 | 177 | |
| 178 | # set defaults for dir variables | |
| 179 | : ${exec_prefix:="$prefix"} | |
| 180 | : ${bindir:='${exec_prefix}/bin'} | |
| 181 | : ${sbindir:='${exec_prefix}/sbin'} | |
| 182 | : ${libdir:='${exec_prefix}/lib'} | |
| 183 | : ${libexecdir:='${exec_prefix}/libexec'} | |
| 184 | : ${datarootdir:='${prefix}/share'} | |
| 185 | : ${datadir:='${datarootdir}'} | |
| 186 | : ${sharedstatedir:='${prefix}/com'} | |
| 285 | 187 | if [ -z "$sysconfdir" ]; then |
| 188 | if [ "$prefix" = '/usr' ]; then | |
| 189 | sysconfdir='/etc' | |
| 190 | else | |
| 191 | sysconfdir='${prefix}/etc' | |
| 192 | fi | |
| 193 | fi | |
| 194 | if [ -z "$localstatedir" ]; then | |
| 195 | if [ "$prefix" = '/usr' ]; then | |
| 196 | localstatedir='/var' | |
| 197 | else | |
| 198 | localstatedir='${prefix}/var' | |
| 199 | fi | |
| 200 | fi | |
| 201 | if [ -z "$runstatedir" ]; then | |
| 202 | if [ "$prefix" = '/usr' ]; then | |
| 203 | runstatedir='/var/run' | |
| 204 | else | |
| 205 | runstatedir='${prefix}/var' | |
| 206 | fi | |
| 207 | fi | |
| 1 | 208 | : ${includedir:='${prefix}/include'} |
| 209 | : ${infodir:='${datarootdir}/info'} | |
| 210 | : ${mandir:='${datarootdir}/man'} | |
| 211 | : ${localedir:='${datarootdir}/locale'} | |
| 212 | ||
| 103 | 213 | |
| 1 | 214 | # check if a config.site exists and load it |
| 289 | 215 | CONFIG_SITE_OK=0 |
| 1 | 216 | if [ -n "$CONFIG_SITE" ]; then |
| 217 | # CONFIG_SITE may contain space separated file names | |
| 218 | for cs in $CONFIG_SITE; do | |
| 219 | printf "loading defaults from $cs... " | |
| 289 | 220 | if [ -f "$cs" ]; then |
| 221 | . "$cs" | |
| 222 | echo ok | |
| 223 | CONFIG_SITE_OK=1 | |
| 224 | break | |
| 225 | else | |
| 226 | echo "not found" | |
| 227 | fi | |
| 1 | 228 | done |
| 229 | elif [ -f "$prefix/share/config.site" ]; then | |
| 230 | printf "loading site defaults... " | |
| 231 | . "$prefix/share/config.site" | |
| 232 | echo ok | |
| 289 | 233 | CONFIG_SITE_OK=1 |
| 1 | 234 | elif [ -f "$prefix/etc/config.site" ]; then |
| 235 | printf "loading site defaults... " | |
| 236 | . "$prefix/etc/config.site" | |
| 237 | echo ok | |
| 289 | 238 | CONFIG_SITE_OK=1 |
| 239 | fi | |
| 240 | ||
| 241 | if [ $CONFIG_SITE_OK -eq 0 ]; then | |
| 285 | 242 | # try to detect the correct libdir on our own, except it was changed by the user |
| 289 | 243 | if [ "$libdir" = '${exec_prefix}/lib' ] ; then |
| 244 | if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then | |
| 245 | if [ "$OS" = "SunOS" ]; then | |
| 246 | [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64' | |
| 285 | 247 | else |
| 289 | 248 | [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64' |
| 285 | 249 | fi |
| 289 | 250 | elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then |
| 251 | if [ "$OS" = "SunOS" ]; then | |
| 252 | [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32' | |
| 253 | else | |
| 254 | [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32' | |
| 255 | fi | |
| 285 | 256 | fi |
| 257 | fi | |
| 1 | 258 | fi |
| 0 | 259 | |
| 260 | ||
| 261 | # generate vars.mk | |
| 290 | 262 | echo '# configuration' > "$TEMP_DIR/vars.mk" |
| 263 | echo "srcdir=$srcdir" >> "$TEMP_DIR/vars.mk" | |
| 264 | echo "TOOLKIT_HOME=$TOOLKIT_HOME" >> "$TEMP_DIR/vars.mk" | |
| 265 | echo >> "$TEMP_DIR/vars.mk" | |
| 0 | 266 | |
| 267 | # | |
| 268 | # DEPENDENCIES | |
| 269 | # | |
| 270 | ||
| 271 | # create buffer for make variables required by dependencies | |
| 272 | echo > "$TEMP_DIR/make.mk" | |
| 273 | ||
| 274 | test_pkg_config() | |
| 275 | { | |
| 276 | if "$PKG_CONFIG" --exists "$1" ; then : | |
| 277 | else return 1 ; fi | |
| 278 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : | |
| 279 | else return 1 ; fi | |
| 280 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : | |
| 281 | else return 1 ; fi | |
| 282 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | |
| 283 | else return 1 ; fi | |
| 284 | return 0 | |
| 285 | } | |
| 286 | ||
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
287 | print_check_msg() |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
288 | { |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
289 | if [ -z "$1" ]; then |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
290 | shift |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
291 | printf "$@" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
292 | fi |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
293 | } |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
294 | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
295 | dependency_error_asan() |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
296 | { |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
297 | print_check_msg "$dep_checked_asan" "checking for asan... " |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
298 | # dependency asan toolchain="gnuc" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
299 | while true |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
300 | do |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
301 | if notistoolchain "gnuc"; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
302 | break |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
303 | fi |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
304 | TEMP_CFLAGS="$TEMP_CFLAGS -fsanitize=address" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
305 | TEMP_LDFLAGS="$TEMP_LDFLAGS -fsanitize=address" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
306 | print_check_msg "$dep_checked_asan" "yes\n" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
307 | dep_checked_asan=1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
308 | return 1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
309 | done |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
310 | |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
311 | print_check_msg "$dep_checked_asan" "no\n" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
312 | dep_checked_asan=1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
313 | return 0 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
314 | } |
| 253 | 315 | dependency_error_sdl3_ttf() |
| 0 | 316 | { |
| 253 | 317 | print_check_msg "$dep_checked_sdl3_ttf" "checking for sdl3_ttf... " |
| 318 | # dependency sdl3_ttf | |
| 0 | 319 | while true |
| 320 | do | |
| 321 | if [ -z "$PKG_CONFIG" ]; then | |
| 322 | break | |
| 323 | fi | |
| 253 | 324 | if test_pkg_config "sdl3-ttf" "" "" "" ; then |
| 325 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags sdl3-ttf`" | |
| 326 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs sdl3-ttf`" | |
| 0 | 327 | else |
| 328 | break | |
| 329 | fi | |
| 253 | 330 | print_check_msg "$dep_checked_sdl3_ttf" "yes\n" |
| 331 | dep_checked_sdl3_ttf=1 | |
| 0 | 332 | return 1 |
| 333 | done | |
| 334 | ||
| 253 | 335 | print_check_msg "$dep_checked_sdl3_ttf" "no\n" |
| 336 | dep_checked_sdl3_ttf=1 | |
|
88
6234b7ea48f3
add support for 2d textures in sprite shader - fixes #386
Mike Becker <universe@uap-core.de>
parents:
84
diff
changeset
|
337 | return 0 |
|
6234b7ea48f3
add support for 2d textures in sprite shader - fixes #386
Mike Becker <universe@uap-core.de>
parents:
84
diff
changeset
|
338 | } |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
339 | dependency_error_toolkit() |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
340 | { |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
341 | print_check_msg "$dep_checked_toolkit" "checking for toolkit... " |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
342 | # dependency toolkit |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
343 | while true |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
344 | do |
| 285 | 345 | if test -n "$TOOLKIT_HOME" > /dev/null 2>&1 ; then |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
346 | : |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
347 | else |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
348 | break |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
349 | fi |
|
310
9212be32d7a2
tools: make use of toolkit independent of specific backend
Mike Becker <universe@uap-core.de>
parents:
290
diff
changeset
|
350 | if test -f "$TOOLKIT_HOME/lib/libuitk.so" > /dev/null 2>&1 ; then |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
351 | : |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
352 | else |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
353 | break |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
354 | fi |
| 285 | 355 | if test -f "$TOOLKIT_HOME/include/ui/ui.h" > /dev/null 2>&1 ; then |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
356 | : |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
357 | else |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
358 | break |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
359 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
360 | TEMP_CFLAGS="$TEMP_CFLAGS -I$TOOLKIT_HOME/include" |
|
310
9212be32d7a2
tools: make use of toolkit independent of specific backend
Mike Becker <universe@uap-core.de>
parents:
290
diff
changeset
|
361 | TEMP_LDFLAGS="$TEMP_LDFLAGS -L $TOOLKIT_HOME/lib/ -luitk" |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
362 | print_check_msg "$dep_checked_toolkit" "yes\n" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
363 | dep_checked_toolkit=1 |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
364 | return 1 |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
365 | done |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
366 | |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
367 | print_check_msg "$dep_checked_toolkit" "no\n" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
368 | dep_checked_toolkit=1 |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
369 | return 0 |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
370 | } |
| 311 | 371 | dependency_error_glad() |
| 0 | 372 | { |
| 311 | 373 | print_check_msg "$dep_checked_glad" "checking for glad... " |
| 374 | # dependency glad | |
| 0 | 375 | while true |
| 376 | do | |
| 377 | if [ -z "$PKG_CONFIG" ]; then | |
| 378 | break | |
| 379 | fi | |
| 311 | 380 | if test_pkg_config "glad" "" "" "" ; then |
| 381 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags glad`" | |
| 382 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs glad`" | |
| 0 | 383 | else |
| 384 | break | |
| 385 | fi | |
| 311 | 386 | print_check_msg "$dep_checked_glad" "yes\n" |
| 387 | dep_checked_glad=1 | |
| 0 | 388 | return 1 |
| 389 | done | |
| 390 | ||
| 311 | 391 | print_check_msg "$dep_checked_glad" "no\n" |
| 392 | dep_checked_glad=1 | |
| 0 | 393 | return 0 |
| 394 | } | |
| 253 | 395 | dependency_error_sdl3_image() |
| 396 | { | |
| 397 | print_check_msg "$dep_checked_sdl3_image" "checking for sdl3_image... " | |
| 398 | # dependency sdl3_image | |
| 399 | while true | |
| 400 | do | |
| 401 | if [ -z "$PKG_CONFIG" ]; then | |
| 402 | break | |
| 403 | fi | |
| 404 | if test_pkg_config "sdl3-image" "" "" "" ; then | |
| 405 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags sdl3-image`" | |
| 406 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs sdl3-image`" | |
| 407 | else | |
| 408 | break | |
| 409 | fi | |
| 410 | print_check_msg "$dep_checked_sdl3_image" "yes\n" | |
| 411 | dep_checked_sdl3_image=1 | |
| 412 | return 1 | |
| 413 | done | |
| 414 | ||
| 415 | print_check_msg "$dep_checked_sdl3_image" "no\n" | |
| 416 | dep_checked_sdl3_image=1 | |
| 417 | return 0 | |
| 418 | } | |
| 0 | 419 | dependency_error_ucx() |
| 420 | { | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
421 | print_check_msg "$dep_checked_ucx" "checking for ucx... " |
| 0 | 422 | # dependency ucx |
| 423 | while true | |
| 424 | do | |
|
283
a53a04d1da97
update to newest UCX 3.2 snapshot
Mike Becker <universe@uap-core.de>
parents:
282
diff
changeset
|
425 | if [ -z "$PKG_CONFIG" ]; then |
|
a53a04d1da97
update to newest UCX 3.2 snapshot
Mike Becker <universe@uap-core.de>
parents:
282
diff
changeset
|
426 | break |
|
a53a04d1da97
update to newest UCX 3.2 snapshot
Mike Becker <universe@uap-core.de>
parents:
282
diff
changeset
|
427 | fi |
| 290 | 428 | if test_pkg_config "ucx" "4.0" "" "" ; then |
|
283
a53a04d1da97
update to newest UCX 3.2 snapshot
Mike Becker <universe@uap-core.de>
parents:
282
diff
changeset
|
429 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags ucx`" |
|
a53a04d1da97
update to newest UCX 3.2 snapshot
Mike Becker <universe@uap-core.de>
parents:
282
diff
changeset
|
430 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs ucx`" |
| 0 | 431 | else |
| 432 | break | |
| 433 | fi | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
434 | print_check_msg "$dep_checked_ucx" "yes\n" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
435 | dep_checked_ucx=1 |
| 0 | 436 | return 1 |
| 437 | done | |
| 438 | ||
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
439 | print_check_msg "$dep_checked_ucx" "no\n" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
440 | dep_checked_ucx=1 |
| 0 | 441 | return 0 |
| 442 | } | |
| 253 | 443 | dependency_error_sdl3() |
| 444 | { | |
| 445 | print_check_msg "$dep_checked_sdl3" "checking for sdl3... " | |
| 446 | # dependency sdl3 | |
| 447 | while true | |
| 448 | do | |
| 449 | if [ -z "$PKG_CONFIG" ]; then | |
| 450 | break | |
| 451 | fi | |
| 452 | if test_pkg_config "sdl3" "" "" "" ; then | |
| 453 | TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags sdl3`" | |
| 454 | TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs sdl3`" | |
| 455 | else | |
| 456 | break | |
| 457 | fi | |
| 458 | print_check_msg "$dep_checked_sdl3" "yes\n" | |
| 459 | dep_checked_sdl3=1 | |
| 460 | return 1 | |
| 461 | done | |
| 462 | ||
| 463 | print_check_msg "$dep_checked_sdl3" "no\n" | |
| 464 | dep_checked_sdl3=1 | |
| 465 | return 0 | |
| 466 | } | |
| 0 | 467 | |
| 468 | # start collecting dependency information | |
| 469 | echo > "$TEMP_DIR/flags.mk" | |
| 470 | ||
| 471 | DEPENDENCIES_FAILED= | |
| 472 | ERROR=0 | |
| 473 | # unnamed dependencies | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
474 | TEMP_CFLAGS="$CFLAGS" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
475 | TEMP_CXXFLAGS="$CXXFLAGS" |
|
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
476 | TEMP_LDFLAGS="$LDFLAGS" |
| 0 | 477 | while true |
| 478 | do | |
| 479 | while true | |
| 480 | do | |
| 481 | if [ -z "$lang_c" ] ; then | |
| 482 | ERROR=1 | |
| 483 | break | |
| 484 | fi | |
| 485 | ||
| 128 | 486 | TEMP_LDFLAGS="$TEMP_LDFLAGS -lm" |
| 0 | 487 | break |
| 488 | done | |
| 489 | break | |
| 490 | done | |
| 491 | ||
| 103 | 492 | # build type |
| 493 | if [ "$BUILD_TYPE" = "debug" ]; then | |
| 285 | 494 | TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" |
| 495 | TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 103 | 496 | fi |
| 497 | if [ "$BUILD_TYPE" = "release" ]; then | |
| 285 | 498 | TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" |
| 499 | TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" | |
| 103 | 500 | fi |
| 501 | ||
| 0 | 502 | # add general dependency flags to flags.mk |
| 503 | echo "# general flags" >> "$TEMP_DIR/flags.mk" | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
504 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 0 | 505 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
| 506 | fi | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
507 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
| 0 | 508 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
| 509 | fi | |
| 510 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
| 511 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 512 | fi | |
| 513 | ||
| 514 | # | |
| 515 | # OPTION VALUES | |
| 516 | # | |
| 517 | ||
| 518 | # | |
| 519 | # TARGETS | |
| 520 | # | |
| 521 | ||
| 522 | echo >> "$TEMP_DIR/flags.mk" | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
523 | echo "configuring global target" |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
524 | echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" |
| 0 | 525 | TEMP_CFLAGS= |
| 526 | TEMP_CXXFLAGS= | |
| 527 | TEMP_LDFLAGS= | |
| 528 | ||
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
529 | if dependency_error_ucx; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
530 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ucx " |
| 0 | 531 | ERROR=1 |
| 532 | fi | |
| 253 | 533 | if dependency_error_sdl3; then |
| 534 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sdl3 " | |
| 0 | 535 | ERROR=1 |
| 536 | fi | |
| 253 | 537 | if dependency_error_sdl3_ttf; then |
| 538 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sdl3_ttf " | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
539 | ERROR=1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
540 | fi |
| 253 | 541 | if dependency_error_sdl3_image; then |
| 542 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sdl3_image " | |
|
88
6234b7ea48f3
add support for 2d textures in sprite shader - fixes #386
Mike Becker <universe@uap-core.de>
parents:
84
diff
changeset
|
543 | ERROR=1 |
|
6234b7ea48f3
add support for 2d textures in sprite shader - fixes #386
Mike Becker <universe@uap-core.de>
parents:
84
diff
changeset
|
544 | fi |
| 0 | 545 | |
| 546 | # Features | |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
547 | if [ -n "$FEATURE_ASAN" ]; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
548 | # check dependency |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
549 | if dependency_error_asan ; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
550 | # "auto" features can fail and are just disabled in this case |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
551 | if [ "$FEATURE_ASAN" = "auto" ]; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
552 | DISABLE_FEATURE_ASAN=1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
553 | else |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
554 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED asan " |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
555 | ERROR=1 |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
556 | fi |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
557 | fi |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
558 | if [ -n "$DISABLE_FEATURE_ASAN" ]; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
559 | unset FEATURE_ASAN |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
560 | fi |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
561 | fi |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
562 | if [ -n "$FEATURE_ASAN" ]; then |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
563 | : |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
564 | else |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
565 | : |
|
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
566 | fi |
| 0 | 567 | |
| 568 | ||
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
569 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 0 | 570 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
| 571 | fi | |
|
76
eb16be99b0ad
update to newest versions of uwproj and ucx
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
572 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
| 0 | 573 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
| 574 | fi | |
| 575 | if [ -n "${TEMP_LDFLAGS}" ]; then | |
| 576 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" | |
| 577 | fi | |
| 578 | ||
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
579 | echo >> "$TEMP_DIR/flags.mk" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
580 | echo "configuring target: tools" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
581 | echo "# flags for target tools" >> "$TEMP_DIR/flags.mk" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
582 | TEMP_CFLAGS= |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
583 | TEMP_CXXFLAGS= |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
584 | TEMP_LDFLAGS= |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
585 | |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
586 | |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
587 | # Features |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
588 | if [ -n "$FEATURE_TOOLS" ]; then |
|
282
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
589 | # check dependency |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
590 | if dependency_error_toolkit ; then |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
591 | # "auto" features can fail and are just disabled in this case |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
592 | if [ "$FEATURE_TOOLS" = "auto" ]; then |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
593 | DISABLE_FEATURE_TOOLS=1 |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
594 | else |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
595 | DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED toolkit " |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
596 | ERROR=1 |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
597 | fi |
|
8c5540b31087
fix that dependencies for tools are always checked
Mike Becker <universe@uap-core.de>
parents:
281
diff
changeset
|
598 | fi |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
599 | if [ -n "$DISABLE_FEATURE_TOOLS" ]; then |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
600 | unset FEATURE_TOOLS |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
601 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
602 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
603 | if [ -n "$FEATURE_TOOLS" ]; then |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
604 | : |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
605 | else |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
606 | : |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
607 | cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
608 | NO_TOOLS=1 |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
609 | __EOF__ |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
610 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
611 | |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
612 | |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
613 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
614 | echo "TOOLS_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
615 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
616 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
617 | echo "TOOLS_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
618 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
619 | if [ -n "${TEMP_LDFLAGS}" ]; then |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
620 | echo "TOOLS_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
621 | fi |
|
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
622 | |
| 0 | 623 | |
| 624 | # final result | |
| 625 | if [ $ERROR -ne 0 ]; then | |
| 626 | echo | |
| 627 | echo "Error: Unresolved dependencies" | |
| 628 | echo "$DEPENDENCIES_FAILED" | |
| 629 | abort_configure | |
| 630 | fi | |
| 631 | ||
| 632 | echo "configure finished" | |
| 633 | echo | |
| 289 | 634 | echo "Toolchain:" |
| 103 | 635 | echo " name: $TOOLCHAIN_NAME" |
| 636 | if [ -n "$TOOLCHAIN_CC" ]; then | |
| 637 | echo " cc: $TOOLCHAIN_CC" | |
| 638 | fi | |
| 639 | if [ -n "$TOOLCHAIN_CXX" ]; then | |
| 640 | echo " cxx: $TOOLCHAIN_CXX" | |
| 641 | fi | |
| 642 | if [ -n "$TOOLCHAIN_WSIZE" ]; then | |
| 643 | echo " word size: $TOOLCHAIN_WSIZE bit" | |
| 644 | fi | |
| 645 | if [ -n "$TOOLCHAIN_CSTD" ]; then | |
| 646 | echo " default C std: $TOOLCHAIN_CSTD" | |
| 647 | fi | |
| 290 | 648 | if [ $has_overridable_config_vars__ -eq 1 ]; then |
| 649 | echo | |
| 650 | echo "Config:" | |
| 651 | if [ -n "$TOOLKIT_HOME__initialized__" ]; then | |
| 652 | printf ' %-16s' 'toolkit-home:' | |
| 653 | echo "$TOOLKIT_HOME" | |
| 654 | fi | |
| 655 | fi | |
| 0 | 656 | echo |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
657 | echo "Features:" |
| 289 | 658 | printf ' %-16s' 'asan:' |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
659 | if [ -n "$FEATURE_ASAN" ]; then |
| 289 | 660 | echo 'on' |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
661 | else |
| 289 | 662 | echo 'off' |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
663 | fi |
| 289 | 664 | printf ' %-16s' 'tools:' |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
665 | if [ -n "$FEATURE_TOOLS" ]; then |
| 289 | 666 | echo 'on' |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
667 | else |
| 289 | 668 | echo 'off' |
|
280
7845f5872bed
start a sub-project to implement a texture atlas editor
Mike Becker <universe@uap-core.de>
parents:
253
diff
changeset
|
669 | fi |
|
138
2ceb0368b02d
add option to enable ASan
Mike Becker <universe@uap-core.de>
parents:
128
diff
changeset
|
670 | echo |
| 0 | 671 | |
| 672 | # generate the config.mk file | |
| 103 | 673 | pwd=`pwd` |
| 0 | 674 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
| 675 | # | |
| 103 | 676 | # config.mk generated by: |
| 677 | # pwd: $pwd | |
| 678 | # $0 $@ | |
| 0 | 679 | # |
| 680 | ||
| 681 | __EOF__ | |
| 682 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" | |
| 103 | 683 | cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
| 0 | 684 | rm -Rf "$TEMP_DIR" |