test/configure2

changeset 169
a85cb6c4275d
parent 168
4cd9757c1ad9
child 171
9e4fd0d54ade
equal deleted inserted replaced
168:4cd9757c1ad9 169:a85cb6c4275d
280 : ${mandir:='${datarootdir}/man'} 280 : ${mandir:='${datarootdir}/man'}
281 : ${localedir:='${datarootdir}/locale'} 281 : ${localedir:='${datarootdir}/locale'}
282 282
283 283
284 # check if a config.site exists and load it 284 # check if a config.site exists and load it
285 CONFIG_SITE_OK=0
285 if [ -n "$CONFIG_SITE" ]; then 286 if [ -n "$CONFIG_SITE" ]; then
286 # CONFIG_SITE may contain space separated file names 287 # CONFIG_SITE may contain space separated file names
287 for cs in $CONFIG_SITE; do 288 for cs in $CONFIG_SITE; do
288 printf "loading defaults from $cs... " 289 printf "loading defaults from $cs... "
289 . "$cs" 290 if [ -f "$cs" ]; then
290 echo ok 291 . "$cs"
292 echo ok
293 CONFIG_SITE_OK=1
294 break
295 else
296 echo "not found"
297 fi
291 done 298 done
292 elif [ -f "$prefix/share/config.site" ]; then 299 elif [ -f "$prefix/share/config.site" ]; then
293 printf "loading site defaults... " 300 printf "loading site defaults... "
294 . "$prefix/share/config.site" 301 . "$prefix/share/config.site"
295 echo ok 302 echo ok
303 CONFIG_SITE_OK=1
296 elif [ -f "$prefix/etc/config.site" ]; then 304 elif [ -f "$prefix/etc/config.site" ]; then
297 printf "loading site defaults... " 305 printf "loading site defaults... "
298 . "$prefix/etc/config.site" 306 . "$prefix/etc/config.site"
299 echo ok 307 echo ok
300 else 308 CONFIG_SITE_OK=1
309 fi
310
311 if [ $CONFIG_SITE_OK -eq 0 ]; then
301 # try to detect the correct libdir on our own, except it was changed by the user 312 # try to detect the correct libdir on our own, except it was changed by the user
302 if test "$libdir" = '${exec_prefix}/lib'; then 313 if [ "$libdir" = '${exec_prefix}/lib' ] ; then
303 if [ "$OS" = "SunOS" ]; then 314 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then
304 test -d "${exec_prefix}/lib/64" && test "$TOOLCHAIN_WSIZE" = "64" && libdir='${exec_prefix}/lib/64' 315 if [ "$OS" = "SunOS" ]; then
305 else 316 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64'
306 # check if the standard libdir even exists
307 if test -d "${exec_prefix}/lib" ; then
308 :
309 else 317 else
310 # if it does not, maybe a lib32 exists 318 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64'
311 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
312 fi 319 fi
313 if [ "$TOOLCHAIN_WSIZE" = "64" ]; then 320 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then
314 # now check if there is a special 64bit libdir that we should use 321 if [ "$OS" = "SunOS" ]; then
315 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do 322 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32'
316 if [ $ARCH = $i ]; then 323 else
317 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' 324 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32'
318 break
319 fi
320 done
321 fi 325 fi
322 fi 326 fi
323 fi 327 fi
324 fi 328 fi
325 329

mercurial