Sun, 30 Nov 2025 22:22:12 +0100
update uwproj and fix echos in Makefile
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | #!/bin/sh |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | |
| 85 | 3 | |
| 4 | # some utility functions | |
| 5 | isplatform() | |
| 6 | { | |
| 7 | for p in $PLATFORM | |
| 8 | do | |
| 9 | if [ "$p" = "$1" ]; then | |
| 10 | return 0 | |
| 11 | fi | |
| 12 | done | |
| 13 | return 1 | |
| 14 | } | |
| 15 | notisplatform() | |
| 16 | { | |
| 17 | for p in $PLATFORM | |
| 18 | do | |
| 19 | if [ "$p" = "$1" ]; then | |
| 20 | return 1 | |
| 21 | fi | |
| 22 | done | |
| 23 | return 0 | |
| 24 | } | |
| 25 | istoolchain() | |
| 26 | { | |
| 27 | for t in $TOOLCHAIN | |
| 28 | do | |
| 29 | if [ "$t" = "$1" ]; then | |
| 30 | return 0 | |
| 31 | fi | |
| 32 | done | |
| 33 | return 1 | |
| 34 | } | |
| 35 | notistoolchain() | |
| 36 | { | |
| 37 | for t in $TOOLCHAIN | |
| 38 | do | |
| 39 | if [ "$t" = "$1" ]; then | |
| 40 | return 1 | |
| 41 | fi | |
| 42 | done | |
| 43 | return 0 | |
| 44 | } | |
| 45 | ||
| 46 | # clean abort | |
| 47 | abort_configure() | |
| 48 | { | |
| 49 | rm -Rf "$TEMP_DIR" | |
| 50 | exit 1 | |
| 51 | } | |
| 52 | ||
| 53 | # Test for availability of pkg-config | |
| 54 | PKG_CONFIG=`command -v pkg-config` | |
| 55 | : ${PKG_CONFIG:="false"} | |
| 56 | ||
| 57 | # Simple uname based platform detection | |
| 58 | # $PLATFORM is used for platform dependent dependency selection | |
| 59 | OS=`uname -s` | |
| 60 | OS_VERSION=`uname -r` | |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
61 | ARCH=`uname -m` |
| 85 | 62 | printf "detect platform... " |
| 63 | if [ "$OS" = "SunOS" ]; then | |
| 64 | PLATFORM="solaris sunos unix svr4" | |
| 65 | elif [ "$OS" = "Linux" ]; then | |
| 66 | PLATFORM="linux unix" | |
| 67 | elif [ "$OS" = "FreeBSD" ]; then | |
| 68 | PLATFORM="freebsd bsd unix" | |
| 69 | elif [ "$OS" = "OpenBSD" ]; then | |
| 70 | PLATFORM="openbsd bsd unix" | |
| 71 | elif [ "$OS" = "NetBSD" ]; then | |
| 72 | PLATFORM="netbsd bsd unix" | |
| 73 | elif [ "$OS" = "Darwin" ]; then | |
| 74 | PLATFORM="macos osx bsd unix" | |
| 75 | elif echo "$OS" | grep -i "MINGW" > /dev/null; then | |
| 76 | PLATFORM="windows mingw" | |
| 77 | fi | |
| 78 | : ${PLATFORM:="unix"} | |
| 79 | ||
| 80 | PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` | |
| 81 | echo "$PLATFORM_NAME" | |
| 82 | ||
| 83 | ||
| 84 | # help text | |
| 85 | printhelp() | |
| 86 | { | |
| 87 | echo "Usage: $0 [OPTIONS]..." | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
88 | echo 'Configuration:' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
89 | cat << '__EOF__' |
| 85 | 90 | |
| 91 | Build Types: | |
| 92 | --debug add extra compile flags for debug builds | |
| 93 | --release add extra compile flags for release builds | |
| 94 | ||
| 95 | __EOF__ | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
96 | abort_configure |
| 85 | 97 | } |
| 98 | ||
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
99 | # create temporary directory |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
100 | TEMP_DIR=".tmp-`uname -n`" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
101 | rm -Rf "$TEMP_DIR" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
102 | if mkdir -p "$TEMP_DIR"; then |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
103 | : |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
104 | else |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
105 | echo "Cannot create tmp dir $TEMP_DIR" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
106 | echo "Abort" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
107 | exit 1 |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
108 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
109 | touch "$TEMP_DIR/options" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
110 | touch "$TEMP_DIR/features" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
111 | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
112 | # config variables |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
113 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
114 | # features |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
115 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
116 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
117 | # parse arguments |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
118 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
119 | BUILD_TYPE="default" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
120 | for ARG in "$@" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
121 | do |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
122 | case "$ARG" in |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
123 | "--help"*) printhelp ;; |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
124 | "--debug") BUILD_TYPE="debug" ;; |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
125 | "--release") BUILD_TYPE="release" ;; |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
126 | "-"*) echo "unknown option: $ARG"; abort_configure ;; |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
127 | esac |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
128 | done |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
129 | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
130 | # toolchain detection utilities |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
131 | . make/toolchain.sh |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
132 | |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
133 | # check languages |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
134 | lang_c= |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
135 | lang_cpp= |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
136 | if detect_c_compiler ; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
137 | lang_c=1 |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
138 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
139 | |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
140 | |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
141 | |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
142 | # set defaults for dir variables |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
143 | : ${exec_prefix:="$prefix"} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
144 | : ${bindir:='${exec_prefix}/bin'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
145 | : ${sbindir:='${exec_prefix}/sbin'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
146 | : ${libdir:='${exec_prefix}/lib'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
147 | : ${libexecdir:='${exec_prefix}/libexec'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
148 | : ${datarootdir:='${prefix}/share'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
149 | : ${datadir:='${datarootdir}'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
150 | : ${sharedstatedir:='${prefix}/com'} |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
151 | if [ -z "$sysconfdir" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
152 | if [ "$prefix" = '/usr' ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
153 | sysconfdir='/etc' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
154 | else |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
155 | sysconfdir='${prefix}/etc' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
156 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
157 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
158 | if [ -z "$localstatedir" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
159 | if [ "$prefix" = '/usr' ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
160 | localstatedir='/var' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
161 | else |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
162 | localstatedir='${prefix}/var' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
163 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
164 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
165 | if [ -z "$runstatedir" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
166 | if [ "$prefix" = '/usr' ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
167 | runstatedir='/var/run' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
168 | else |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
169 | runstatedir='${prefix}/var' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
170 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
171 | fi |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
172 | : ${includedir:='${prefix}/include'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
173 | : ${infodir:='${datarootdir}/info'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
174 | : ${mandir:='${datarootdir}/man'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
175 | : ${localedir:='${datarootdir}/locale'} |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
176 | |
| 85 | 177 | |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
178 | # check if a config.site exists and load it |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
179 | CONFIG_SITE_OK=0 |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
180 | if [ -n "$CONFIG_SITE" ]; then |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
181 | # CONFIG_SITE may contain space separated file names |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
182 | for cs in $CONFIG_SITE; do |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
183 | printf "loading defaults from $cs... " |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
184 | if [ -f "$cs" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
185 | . "$cs" |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
186 | echo ok |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
187 | CONFIG_SITE_OK=1 |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
188 | break |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
189 | else |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
190 | echo "not found" |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
191 | fi |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
192 | done |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
193 | elif [ -f "$prefix/share/config.site" ]; then |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
194 | printf "loading site defaults... " |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
195 | . "$prefix/share/config.site" |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
196 | echo ok |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
197 | CONFIG_SITE_OK=1 |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
198 | elif [ -f "$prefix/etc/config.site" ]; then |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
199 | printf "loading site defaults... " |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
200 | . "$prefix/etc/config.site" |
|
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
201 | echo ok |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
202 | CONFIG_SITE_OK=1 |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
203 | fi |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
204 | |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
205 | if [ $CONFIG_SITE_OK -eq 0 ]; then |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
206 | # try to detect the correct libdir on our own, except it was changed by the user |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
207 | if [ "$libdir" = '${exec_prefix}/lib' ] ; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
208 | if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
209 | if [ "$OS" = "SunOS" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
210 | [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64' |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
211 | else |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
212 | [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64' |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
213 | fi |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
214 | elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
215 | if [ "$OS" = "SunOS" ]; then |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
216 | [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
217 | else |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
218 | [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32' |
|
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
219 | fi |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
220 | fi |
|
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
221 | fi |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
222 | fi |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
223 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
224 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
225 | # generate vars.mk |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
226 | cat > "$TEMP_DIR/vars.mk" << __EOF__ |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
227 | __EOF__ |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
228 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
229 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
230 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
231 | # DEPENDENCIES |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
232 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
233 | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
234 | |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
235 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
236 | # create buffer for make variables required by dependencies |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
237 | echo > "$TEMP_DIR/make.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
238 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
239 | test_pkg_config() |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
240 | { |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
241 | if "$PKG_CONFIG" --exists "$1" ; then : |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
242 | else return 1 ; fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
243 | if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
244 | else return 1 ; fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
245 | if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then : |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
246 | else return 1 ; fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
247 | if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
248 | else return 1 ; fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
249 | return 0 |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
250 | } |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
251 | |
| 85 | 252 | print_check_msg() |
| 253 | { | |
| 254 | if [ -z "$1" ]; then | |
| 255 | shift | |
| 256 | printf "$@" | |
| 257 | fi | |
| 258 | } | |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
259 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
260 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
261 | # start collecting dependency information |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
262 | echo > "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
263 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
264 | DEPENDENCIES_FAILED= |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
265 | ERROR=0 |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
266 | # unnamed dependencies |
| 85 | 267 | TEMP_CFLAGS="$CFLAGS" |
| 268 | TEMP_CXXFLAGS="$CXXFLAGS" | |
| 269 | TEMP_LDFLAGS="$LDFLAGS" | |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
270 | while true |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
271 | do |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
272 | while true |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
273 | do |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
274 | if [ -z "$lang_c" ] ; then |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
275 | ERROR=1 |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
276 | break |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
277 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
278 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
279 | break |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
280 | done |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
281 | break |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
282 | done |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
283 | |
| 85 | 284 | # build type |
| 285 | if [ "$BUILD_TYPE" = "debug" ]; then | |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
286 | TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" |
|
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
287 | TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" |
| 85 | 288 | fi |
| 289 | if [ "$BUILD_TYPE" = "release" ]; then | |
|
86
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
290 | TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" |
|
db21aab20169
update uwproj (fixes various configure bugs)
Mike Becker <universe@uap-core.de>
parents:
85
diff
changeset
|
291 | TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" |
| 85 | 292 | fi |
| 293 | ||
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
294 | # add general dependency flags to flags.mk |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
295 | echo "# general flags" >> "$TEMP_DIR/flags.mk" |
| 85 | 296 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
297 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
298 | fi |
| 85 | 299 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
300 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
301 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
302 | if [ -n "${TEMP_LDFLAGS}" ]; then |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
303 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
304 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
305 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
306 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
307 | # OPTION VALUES |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
308 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
309 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
310 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
311 | # TARGETS |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
312 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
313 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
314 | echo >> "$TEMP_DIR/flags.mk" |
|
74
ed9a5ffd1f13
update uwproj (adds support for config.site)
Mike Becker <universe@uap-core.de>
parents:
68
diff
changeset
|
315 | echo "configuring target: default" |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
316 | echo "# flags for target default" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
317 | TEMP_CFLAGS= |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
318 | TEMP_CXXFLAGS= |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
319 | TEMP_LDFLAGS= |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
320 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
321 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
322 | # Features |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
323 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
324 | |
| 85 | 325 | if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
326 | echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
327 | fi |
| 85 | 328 | if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
329 | echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
330 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
331 | if [ -n "${TEMP_LDFLAGS}" ]; then |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
332 | echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
333 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
334 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
335 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
336 | # final result |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
337 | if [ $ERROR -ne 0 ]; then |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
338 | echo |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
339 | echo "Error: Unresolved dependencies" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
340 | echo "$DEPENDENCIES_FAILED" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
341 | abort_configure |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
342 | fi |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
343 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
344 | echo "configure finished" |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
345 | echo |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
346 | echo "Toolchain:" |
| 85 | 347 | echo " name: $TOOLCHAIN_NAME" |
| 348 | if [ -n "$TOOLCHAIN_CC" ]; then | |
| 349 | echo " cc: $TOOLCHAIN_CC" | |
| 350 | fi | |
| 351 | if [ -n "$TOOLCHAIN_CXX" ]; then | |
| 352 | echo " cxx: $TOOLCHAIN_CXX" | |
| 353 | fi | |
| 354 | if [ -n "$TOOLCHAIN_WSIZE" ]; then | |
| 355 | echo " word size: $TOOLCHAIN_WSIZE bit" | |
| 356 | fi | |
| 357 | if [ -n "$TOOLCHAIN_CSTD" ]; then | |
| 358 | echo " default C std: $TOOLCHAIN_CSTD" | |
| 359 | fi | |
| 360 | echo | |
|
87
84f94d476934
update uwproj and fix echos in Makefile
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
361 | echo "Config:" |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
362 | echo |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
363 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
364 | # generate the config.mk file |
| 85 | 365 | pwd=`pwd` |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
366 | cat > "$TEMP_DIR/config.mk" << __EOF__ |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
367 | # |
| 85 | 368 | # config.mk generated by: |
| 369 | # pwd: $pwd | |
| 370 | # $0 $@ | |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
371 | # |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
372 | |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
373 | __EOF__ |
|
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
374 | write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
| 85 | 375 | cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
|
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
376 | rm -Rf "$TEMP_DIR" |