| 244 : ${mandir:='${datarootdir}/man'} |
244 : ${mandir:='${datarootdir}/man'} |
| 245 : ${localedir:='${datarootdir}/locale'} |
245 : ${localedir:='${datarootdir}/locale'} |
| 246 |
246 |
| 247 |
247 |
| 248 # check if a config.site exists and load it |
248 # check if a config.site exists and load it |
| |
249 CONFIG_SITE_OK=0 |
| 249 if [ -n "$CONFIG_SITE" ]; then |
250 if [ -n "$CONFIG_SITE" ]; then |
| 250 # CONFIG_SITE may contain space separated file names |
251 # CONFIG_SITE may contain space separated file names |
| 251 for cs in $CONFIG_SITE; do |
252 for cs in $CONFIG_SITE; do |
| 252 printf "loading defaults from $cs... " |
253 printf "loading defaults from $cs... " |
| 253 . "$cs" |
254 if [ -f "$cs" ]; then |
| 254 echo ok |
255 . "$cs" |
| |
256 echo ok |
| |
257 CONFIG_SITE_OK=1 |
| |
258 break |
| |
259 else |
| |
260 echo "not found" |
| |
261 fi |
| 255 done |
262 done |
| 256 elif [ -f "$prefix/share/config.site" ]; then |
263 elif [ -f "$prefix/share/config.site" ]; then |
| 257 printf "loading site defaults... " |
264 printf "loading site defaults... " |
| 258 . "$prefix/share/config.site" |
265 . "$prefix/share/config.site" |
| 259 echo ok |
266 echo ok |
| |
267 CONFIG_SITE_OK=1 |
| 260 elif [ -f "$prefix/etc/config.site" ]; then |
268 elif [ -f "$prefix/etc/config.site" ]; then |
| 261 printf "loading site defaults... " |
269 printf "loading site defaults... " |
| 262 . "$prefix/etc/config.site" |
270 . "$prefix/etc/config.site" |
| 263 echo ok |
271 echo ok |
| 264 else |
272 CONFIG_SITE_OK=1 |
| |
273 fi |
| |
274 |
| |
275 if [ $CONFIG_SITE_OK -eq 0 ]; then |
| 265 # try to detect the correct libdir on our own, except it was changed by the user |
276 # try to detect the correct libdir on our own, except it was changed by the user |
| 266 if test "$libdir" = '${exec_prefix}/lib'; then |
277 if [ "$libdir" = '${exec_prefix}/lib' ] ; then |
| 267 if [ "$OS" = "SunOS" ]; then |
278 if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then |
| 268 test -d "${exec_prefix}/lib/64" && test "$TOOLCHAIN_WSIZE" = "64" && libdir='${exec_prefix}/lib/64' |
279 if [ "$OS" = "SunOS" ]; then |
| 269 else |
280 [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64' |
| 270 # check if the standard libdir even exists |
|
| 271 if test -d "${exec_prefix}/lib" ; then |
|
| 272 : |
|
| 273 else |
281 else |
| 274 # if it does not, maybe a lib32 exists |
282 [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64' |
| 275 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
|
| 276 fi |
283 fi |
| 277 if [ "$TOOLCHAIN_WSIZE" = "64" ]; then |
284 elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then |
| 278 # now check if there is a special 64bit libdir that we should use |
285 if [ "$OS" = "SunOS" ]; then |
| 279 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
286 [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32' |
| 280 if [ $ARCH = $i ]; then |
287 else |
| 281 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
288 [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32' |
| 282 break |
|
| 283 fi |
|
| 284 done |
|
| 285 fi |
289 fi |
| 286 fi |
290 fi |
| 287 fi |
291 fi |
| 288 fi |
292 fi |
| 289 |
293 |