| 83 |
83 |
| 84 # help text |
84 # help text |
| 85 printhelp() |
85 printhelp() |
| 86 { |
86 { |
| 87 echo "Usage: $0 [OPTIONS]..." |
87 echo "Usage: $0 [OPTIONS]..." |
| 88 cat << __EOF__ |
88 echo 'Configuration:' |
| 89 Installation directories: |
89 cat << '__EOF__' |
| 90 --prefix=PREFIX path prefix for architecture-independent files |
|
| 91 [$prefix] |
|
| 92 --exec-prefix=EPREFIX path prefix for architecture-dependent files |
|
| 93 [PREFIX] |
|
| 94 |
|
| 95 --bindir=DIR user executables [EPREFIX/bin] |
|
| 96 --sbindir=DIR system admin executables [EPREFIX/sbin] |
|
| 97 --libexecdir=DIR program executables [EPREFIX/libexec] |
|
| 98 --sysconfdir=DIR system configuration files [PREFIX/etc] |
|
| 99 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
|
| 100 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
|
| 101 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run] |
|
| 102 --libdir=DIR object code libraries [EPREFIX/lib] |
|
| 103 --includedir=DIR C header files [PREFIX/include] |
|
| 104 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
|
| 105 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
|
| 106 --infodir=DIR info documentation [DATAROOTDIR/info] |
|
| 107 --mandir=DIR man documentation [DATAROOTDIR/man] |
|
| 108 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
|
| 109 |
90 |
| 110 Build Types: |
91 Build Types: |
| 111 --debug add extra compile flags for debug builds |
92 --debug add extra compile flags for debug builds |
| 112 --release add extra compile flags for release builds |
93 --release add extra compile flags for release builds |
| 113 |
94 |
| 114 Options: |
95 Options: |
| 115 --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif) |
96 --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif|server) |
| 116 |
97 |
| 117 Optional Features: |
98 Optional Features: |
| 118 --enable-client |
99 --enable-client |
| 119 |
100 |
| 120 __EOF__ |
101 __EOF__ |
| |
102 abort_configure |
| 121 } |
103 } |
| 122 |
104 |
| 123 # create temporary directory |
105 # create temporary directory |
| 124 TEMP_DIR=".tmp-`uname -n`" |
106 TEMP_DIR=".tmp-`uname -n`" |
| 125 rm -Rf "$TEMP_DIR" |
107 rm -Rf "$TEMP_DIR" |
| 131 exit 1 |
113 exit 1 |
| 132 fi |
114 fi |
| 133 touch "$TEMP_DIR/options" |
115 touch "$TEMP_DIR/options" |
| 134 touch "$TEMP_DIR/features" |
116 touch "$TEMP_DIR/features" |
| 135 |
117 |
| 136 # define standard variables |
118 # config variables |
| 137 # also define standard prefix (this is where we will search for config.site) |
|
| 138 prefix=/usr |
|
| 139 exec_prefix= |
|
| 140 bindir= |
|
| 141 sbindir= |
|
| 142 libdir= |
|
| 143 libexecdir= |
|
| 144 datarootdir= |
|
| 145 datadir= |
|
| 146 sysconfdir= |
|
| 147 sharedstatedir= |
|
| 148 localstatedir= |
|
| 149 runstatedir= |
|
| 150 includedir= |
|
| 151 infodir= |
|
| 152 localedir= |
|
| 153 mandir= |
|
| 154 |
|
| 155 # custom variables |
|
| 156 |
119 |
| 157 # features |
120 # features |
| 158 |
121 |
| 159 # |
122 # |
| 160 # parse arguments |
123 # parse arguments |
| 161 # |
124 # |
| 162 BUILD_TYPE="default" |
125 BUILD_TYPE="default" |
| 163 for ARG in "$@" |
126 for ARG in "$@" |
| 164 do |
127 do |
| 165 case "$ARG" in |
128 case "$ARG" in |
| 166 "--prefix="*) prefix=${ARG#--prefix=} ;; |
129 "--help"*) printhelp ;; |
| 167 "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;; |
130 "--debug") BUILD_TYPE="debug" ;; |
| 168 "--bindir="*) bindir=${ARG#----bindir=} ;; |
131 "--release") BUILD_TYPE="release" ;; |
| 169 "--sbindir="*) sbindir=${ARG#--sbindir=} ;; |
|
| 170 "--libdir="*) libdir=${ARG#--libdir=} ;; |
|
| 171 "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;; |
|
| 172 "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;; |
|
| 173 "--datadir="*) datadir=${ARG#--datadir=} ;; |
|
| 174 "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;; |
|
| 175 "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;; |
|
| 176 "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;; |
|
| 177 "--includedir="*) includedir=${ARG#--includedir=} ;; |
|
| 178 "--infodir="*) infodir=${ARG#--infodir=} ;; |
|
| 179 "--mandir"*) mandir=${ARG#--mandir} ;; |
|
| 180 "--localedir"*) localedir=${ARG#--localedir} ;; |
|
| 181 "--help"*) printhelp; abort_configure ;; |
|
| 182 "--debug") BUILD_TYPE="debug" ;; |
|
| 183 "--release") BUILD_TYPE="release" ;; |
|
| 184 "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; |
132 "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; |
| 185 "--toolkit") echo "option '$ARG' needs a value:"; echo " $ARG=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif)"; abort_configure ;; |
133 "--toolkit") echo "option '$ARG' needs a value:"; echo " $ARG=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif|server)"; abort_configure ;; |
| 186 "--enable-client") FEATURE_CLIENT=on ;; |
134 "--enable-client") FEATURE_CLIENT=on ;; |
| 187 "--disable-client") unset FEATURE_CLIENT ;; |
135 "--disable-client") unset FEATURE_CLIENT ;; |
| 188 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
136 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
| 189 esac |
137 esac |
| 190 done |
138 done |
| |
139 |
| |
140 # toolchain detection utilities |
| |
141 . make/toolchain.sh |
| |
142 |
| |
143 # check languages |
| |
144 lang_c= |
| |
145 lang_cpp= |
| |
146 if detect_cpp_compiler ; then |
| |
147 lang_cpp=1 |
| |
148 fi |
| |
149 if detect_c_compiler ; then |
| |
150 lang_c=1 |
| |
151 fi |
| 191 |
152 |
| 192 |
153 |
| 193 |
154 |
| 194 # set defaults for dir variables |
155 # set defaults for dir variables |
| 195 : ${exec_prefix:="$prefix"} |
156 : ${exec_prefix:="$prefix"} |
| 197 : ${sbindir:='${exec_prefix}/sbin'} |
158 : ${sbindir:='${exec_prefix}/sbin'} |
| 198 : ${libdir:='${exec_prefix}/lib'} |
159 : ${libdir:='${exec_prefix}/lib'} |
| 199 : ${libexecdir:='${exec_prefix}/libexec'} |
160 : ${libexecdir:='${exec_prefix}/libexec'} |
| 200 : ${datarootdir:='${prefix}/share'} |
161 : ${datarootdir:='${prefix}/share'} |
| 201 : ${datadir:='${datarootdir}'} |
162 : ${datadir:='${datarootdir}'} |
| 202 : ${sysconfdir:='${prefix}/etc'} |
|
| 203 : ${sharedstatedir:='${prefix}/com'} |
163 : ${sharedstatedir:='${prefix}/com'} |
| 204 : ${localstatedir:='${prefix}/var'} |
164 if [ -z "$sysconfdir" ]; then |
| 205 : ${runstatedir:='${localstatedir}/run'} |
165 if [ "$prefix" = '/usr' ]; then |
| |
166 sysconfdir='/etc' |
| |
167 else |
| |
168 sysconfdir='${prefix}/etc' |
| |
169 fi |
| |
170 fi |
| |
171 if [ -z "$localstatedir" ]; then |
| |
172 if [ "$prefix" = '/usr' ]; then |
| |
173 localstatedir='/var' |
| |
174 else |
| |
175 localstatedir='${prefix}/var' |
| |
176 fi |
| |
177 fi |
| |
178 if [ -z "$runstatedir" ]; then |
| |
179 if [ "$prefix" = '/usr' ]; then |
| |
180 runstatedir='/var/run' |
| |
181 else |
| |
182 runstatedir='${prefix}/var' |
| |
183 fi |
| |
184 fi |
| 206 : ${includedir:='${prefix}/include'} |
185 : ${includedir:='${prefix}/include'} |
| 207 : ${infodir:='${datarootdir}/info'} |
186 : ${infodir:='${datarootdir}/info'} |
| 208 : ${mandir:='${datarootdir}/man'} |
187 : ${mandir:='${datarootdir}/man'} |
| 209 : ${localedir:='${datarootdir}/locale'} |
188 : ${localedir:='${datarootdir}/locale'} |
| 210 |
189 |
| 211 # remember the above values and compare them later |
|
| 212 orig_bindir="$bindir" |
|
| 213 orig_sbindir="$sbindir" |
|
| 214 orig_libdir="$libdir" |
|
| 215 orig_libexecdir="$libexecdir" |
|
| 216 orig_datarootdir="$datarootdir" |
|
| 217 orig_datadir="$datadir" |
|
| 218 orig_sysconfdir="$sysconfdir" |
|
| 219 orig_sharedstatedir="$sharedstatedir" |
|
| 220 orig_localstatedir="$localstatedir" |
|
| 221 orig_runstatedir="$runstatedir" |
|
| 222 orig_includedir="$includedir" |
|
| 223 orig_infodir="$infodir" |
|
| 224 orig_mandir="$mandir" |
|
| 225 orig_localedir="$localedir" |
|
| 226 |
190 |
| 227 # check if a config.site exists and load it |
191 # check if a config.site exists and load it |
| |
192 CONFIG_SITE_OK=0 |
| 228 if [ -n "$CONFIG_SITE" ]; then |
193 if [ -n "$CONFIG_SITE" ]; then |
| 229 # CONFIG_SITE may contain space separated file names |
194 # CONFIG_SITE may contain space separated file names |
| 230 for cs in $CONFIG_SITE; do |
195 for cs in $CONFIG_SITE; do |
| 231 printf "loading defaults from $cs... " |
196 printf "loading defaults from $cs... " |
| 232 . "$cs" |
197 if [ -f "$cs" ]; then |
| 233 echo ok |
198 . "$cs" |
| |
199 echo ok |
| |
200 CONFIG_SITE_OK=1 |
| |
201 break |
| |
202 else |
| |
203 echo "not found" |
| |
204 fi |
| 234 done |
205 done |
| 235 elif [ -f "$prefix/share/config.site" ]; then |
206 elif [ -f "$prefix/share/config.site" ]; then |
| 236 printf "loading site defaults... " |
207 printf "loading site defaults... " |
| 237 . "$prefix/share/config.site" |
208 . "$prefix/share/config.site" |
| 238 echo ok |
209 echo ok |
| |
210 CONFIG_SITE_OK=1 |
| 239 elif [ -f "$prefix/etc/config.site" ]; then |
211 elif [ -f "$prefix/etc/config.site" ]; then |
| 240 printf "loading site defaults... " |
212 printf "loading site defaults... " |
| 241 . "$prefix/etc/config.site" |
213 . "$prefix/etc/config.site" |
| 242 echo ok |
214 echo ok |
| 243 else |
215 CONFIG_SITE_OK=1 |
| |
216 fi |
| |
217 |
| |
218 if [ $CONFIG_SITE_OK -eq 0 ]; then |
| 244 # try to detect the correct libdir on our own, except it was changed by the user |
219 # try to detect the correct libdir on our own, except it was changed by the user |
| 245 if test "$libdir" = '${exec_prefix}/lib'; then |
220 if [ "$libdir" = '${exec_prefix}/lib' ] ; then |
| 246 if [ "$OS" = "SunOS" ]; then |
221 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then |
| 247 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64' |
222 if [ "$OS" = "SunOS" ]; then |
| 248 else |
223 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64' |
| 249 # check if the standard libdir even exists |
|
| 250 if test -d "${exec_prefix}/lib" ; then |
|
| 251 : |
|
| 252 else |
224 else |
| 253 # if it does not, maybe a lib32 exists |
225 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64' |
| 254 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
|
| 255 fi |
226 fi |
| 256 # now check if there is a special 64bit libdir that we should use |
227 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then |
| 257 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
228 if [ "$OS" = "SunOS" ]; then |
| 258 if [ $ARCH = $i ]; then |
229 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32' |
| 259 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
230 else |
| 260 break |
231 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32' |
| 261 fi |
232 fi |
| 262 done |
|
| 263 fi |
233 fi |
| 264 fi |
234 fi |
| 265 fi |
235 fi |
| 266 |
236 |
| 267 |
237 |
| 268 # generate vars.mk |
238 # generate vars.mk |
| 269 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
239 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
| 270 prefix=$prefix |
240 __EOF__ |
| 271 exec_prefix=$exec_prefix |
241 |
| 272 bindir=$bindir |
|
| 273 sbindir=$sbindir |
|
| 274 libdir=$libdir |
|
| 275 libexecdir=$libexecdir |
|
| 276 datarootdir=$datarootdir |
|
| 277 datadir=$datadir |
|
| 278 sysconfdir=$sysconfdir |
|
| 279 sharedstatedir=$sharedstatedir |
|
| 280 localstatedir=$localstatedir |
|
| 281 runstatedir=$runstatedir |
|
| 282 includedir=$includedir |
|
| 283 infodir=$infodir |
|
| 284 mandir=$mandir |
|
| 285 localedir=$localedir |
|
| 286 __EOF__ |
|
| 287 |
|
| 288 # toolchain detection utilities |
|
| 289 . make/toolchain.sh |
|
| 290 |
242 |
| 291 # |
243 # |
| 292 # DEPENDENCIES |
244 # DEPENDENCIES |
| 293 # |
245 # |
| 294 |
246 |
| 295 # check languages |
247 |
| 296 lang_c= |
|
| 297 lang_cpp= |
|
| 298 if detect_cpp_compiler ; then |
|
| 299 lang_cpp=1 |
|
| 300 fi |
|
| 301 if detect_c_compiler ; then |
|
| 302 lang_c=1 |
|
| 303 fi |
|
| 304 |
248 |
| 305 # create buffer for make variables required by dependencies |
249 # create buffer for make variables required by dependencies |
| 306 echo > "$TEMP_DIR/make.mk" |
250 echo > "$TEMP_DIR/make.mk" |
| 307 |
251 |
| 308 test_pkg_config() |
252 test_pkg_config() |
| 1166 fi |
1148 fi |
| 1167 if [ -n "$TOOLCHAIN_CSTD" ]; then |
1149 if [ -n "$TOOLCHAIN_CSTD" ]; then |
| 1168 echo " default C std: $TOOLCHAIN_CSTD" |
1150 echo " default C std: $TOOLCHAIN_CSTD" |
| 1169 fi |
1151 fi |
| 1170 echo |
1152 echo |
| 1171 echo "Build Config:" |
1153 echo "Config:" |
| 1172 echo " prefix: $prefix" |
|
| 1173 echo " exec_prefix: $exec_prefix" |
|
| 1174 if [ "$orig_bindir" != "$bindir" ]; then |
|
| 1175 echo " bindir: $bindir" |
|
| 1176 fi |
|
| 1177 if [ "$orig_sbindir" != "$sbindir" ]; then |
|
| 1178 echo " sbindir: $sbindir" |
|
| 1179 fi |
|
| 1180 if [ "$orig_libdir" != "$libdir" ]; then |
|
| 1181 echo " libdir: $libdir" |
|
| 1182 fi |
|
| 1183 if [ "$orig_libexecdir" != "$libexecdir" ]; then |
|
| 1184 echo " libexecdir: $libexecdir" |
|
| 1185 fi |
|
| 1186 if [ "$orig_datarootdir" != "$datarootdir" ]; then |
|
| 1187 echo " datarootdir: $datarootdir" |
|
| 1188 fi |
|
| 1189 if [ "$orig_datadir" != "$datadir" ]; then |
|
| 1190 echo " datadir: $datadir" |
|
| 1191 fi |
|
| 1192 if [ "$orig_sysconfdir" != "$sysconfdir" ]; then |
|
| 1193 echo " sysconfdir: $sysconfdir" |
|
| 1194 fi |
|
| 1195 if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then |
|
| 1196 echo " sharedstatedir: $sharedstatedir" |
|
| 1197 fi |
|
| 1198 if [ "$orig_localstatedir" != "$localstatedir" ]; then |
|
| 1199 echo " localstatedir: $localstatedir" |
|
| 1200 fi |
|
| 1201 if [ "$orig_runstatedir" != "$runstatedir" ]; then |
|
| 1202 echo " runstatedir: $runstatedir" |
|
| 1203 fi |
|
| 1204 if [ "$orig_includedir" != "$includedir" ]; then |
|
| 1205 echo " includedir: $includedir" |
|
| 1206 fi |
|
| 1207 if [ "$orig_infodir" != "$infodir" ]; then |
|
| 1208 echo " infodir: $infodir" |
|
| 1209 fi |
|
| 1210 if [ "$orig_mandir" != "$mandir" ]; then |
|
| 1211 echo " mandir: $mandir" |
|
| 1212 fi |
|
| 1213 if [ "$orig_localedir" != "$localedir" ]; then |
|
| 1214 echo " localedir: $localedir" |
|
| 1215 fi |
|
| 1216 echo |
1154 echo |
| 1217 echo "Options:" |
1155 echo "Options:" |
| 1218 cat "$TEMP_DIR/options" |
1156 cat "$TEMP_DIR/options" |
| 1219 echo |
1157 echo |
| 1220 echo "Features:" |
1158 echo "Features:" |
| |
1159 printf ' %-16s' 'client:' |
| 1221 if [ -n "$FEATURE_CLIENT" ]; then |
1160 if [ -n "$FEATURE_CLIENT" ]; then |
| 1222 echo " client: on" |
1161 echo 'on' |
| 1223 else |
1162 else |
| 1224 echo " client: off" |
1163 echo 'off' |
| 1225 fi |
1164 fi |
| 1226 echo |
1165 echo |
| 1227 |
1166 |
| 1228 # generate the config.mk file |
1167 # generate the config.mk file |
| 1229 pwd=`pwd` |
1168 pwd=`pwd` |