| 1 | # $MirOS: src/gnu/usr.bin/perl/hints/mirbsd.sh,v 1.3 2007/05/07 20:32:09 tg Exp $ |
| 2 | # |
| 3 | # hints file for MirOS by Thorsten Glaser <tg@mirbsd.de> |
| 4 | # based upon hints for OpenBSD |
| 5 | |
| 6 | [ -z "$cc" ] && cc="${CC:-mgcc}" |
| 7 | |
| 8 | # MirOS has a better malloc than perl... |
| 9 | usemymalloc='n' |
| 10 | |
| 11 | # Added by bingos. |
| 12 | loclibpth="/usr/mpkg/lib /usr/local/lib" |
| 13 | locincpath="/usr/mpkg/include /usr/local/include" |
| 14 | ccflags="$ccflags -fhonour-copts -I/usr/mpkg/include" |
| 15 | cppflags="$cppflags -fhonour-copts -I/usr/mpkg/include" |
| 16 | |
| 17 | # Currently, vfork(2) is not a real win over fork(2). |
| 18 | usevfork="$undef" |
| 19 | |
| 20 | test -z "$usedl" && usedl=$define |
| 21 | # We use -fPIC here because -fpic is *NOT* enough for some of the |
| 22 | # extensions like Tk on some platforms (ie: sparc) |
| 23 | cccdlflags="-DPIC -fPIC $cccdlflags" |
| 24 | ld=$cc |
| 25 | lddlflags="-shared -fPIC $lddlflags" |
| 26 | libswanted=$(echo $libswanted | sed 's/ dl / /') |
| 27 | |
| 28 | # We need to force ld to export symbols on ELF platforms. |
| 29 | # Without this, dlopen() is crippled. All platforms are ELF. |
| 30 | ldflags="-Wl,-E $ldflags" |
| 31 | |
| 32 | # malloc wrap works |
| 33 | case "$usemallocwrap" in |
| 34 | '') usemallocwrap='define' ;; |
| 35 | esac |
| 36 | |
| 37 | # MirOS doesn't need libcrypt |
| 38 | libswanted=$(echo $libswanted | sed 's/ crypt / /') |
| 39 | |
| 40 | # Configure can't figure this out non-interactively |
| 41 | d_suidsafe=$define |
| 42 | |
| 43 | # cc is gcc so we can do better than -O |
| 44 | # Allow a command-line override, such as -Doptimize=-g |
| 45 | test "$optimize" || optimize='-O2' |
| 46 | |
| 47 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
| 48 | # after it has prompted the user for whether to use threads. |
| 49 | cat > UU/usethreads.cbu <<'EOCBU' |
| 50 | case "$usethreads" in |
| 51 | $define|true|[yY]*) |
| 52 | ccflags="-pthread $ccflags" |
| 53 | ldflags="-pthread $ldflags" |
| 54 | esac |
| 55 | EOCBU |
| 56 | |
| 57 | # This script UU/use64bitint.cbu will get 'called-back' by Configure |
| 58 | # after it has prompted the user for whether to use 64-bitness. |
| 59 | cat > UU/use64bitint.cbu <<'EOCBU' |
| 60 | case "$use64bitint" in |
| 61 | $define|true|[yY]*) |
| 62 | echo " " |
| 63 | echo "Checking if your C library has broken 64-bit functions..." >&4 |
| 64 | $cat >check.c <<EOCP |
| 65 | #include <stdio.h> |
| 66 | typedef $uquadtype myULL; |
| 67 | int main (void) |
| 68 | { |
| 69 | struct { |
| 70 | double d; |
| 71 | myULL u; |
| 72 | } *p, test[] = { |
| 73 | {4294967303.15, 4294967303ULL}, |
| 74 | {4294967294.2, 4294967294ULL}, |
| 75 | {4294967295.7, 4294967295ULL}, |
| 76 | {0.0, 0ULL} |
| 77 | }; |
| 78 | for (p = test; p->u; p++) { |
| 79 | myULL x = (myULL)p->d; |
| 80 | if (x != p->u) { |
| 81 | printf("buggy\n"); |
| 82 | return 0; |
| 83 | } |
| 84 | } |
| 85 | printf("ok\n"); |
| 86 | return 0; |
| 87 | } |
| 88 | EOCP |
| 89 | set check |
| 90 | if eval $compile_ok; then |
| 91 | libcquad=$(./check) |
| 92 | echo "Your C library's 64-bit functions are $libcquad." |
| 93 | else |
| 94 | echo "(I can't seem to compile the test program.)" |
| 95 | echo "Assuming that your C library's 64-bit functions are ok." |
| 96 | libcquad="ok" |
| 97 | fi |
| 98 | $rm -f check.c check |
| 99 | |
| 100 | case "$libcquad" in |
| 101 | buggy*) |
| 102 | cat >&4 <<EOM |
| 103 | |
| 104 | *** You have a C library with broken 64-bit functions. |
| 105 | *** 64-bit support does not work reliably in this configuration. |
| 106 | *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits. |
| 107 | *** Cannot continue, aborting. |
| 108 | |
| 109 | EOM |
| 110 | exit 1 |
| 111 | ;; |
| 112 | esac |
| 113 | esac |
| 114 | EOCBU |
| 115 | |
| 116 | # When building in the MirOS tree we use different paths |
| 117 | # This is only part of the story, the rest comes from config.over |
| 118 | case "$mirbsd_distribution" in |
| 119 | ''|$undef|false) ;; |
| 120 | *) |
| 121 | # We put things in /usr, not /usr/local |
| 122 | prefix='/usr' |
| 123 | prefixexp='/usr' |
| 124 | sysman='/usr/share/man/man1' |
| 125 | libpth='/usr/lib' |
| 126 | glibpth='/usr/lib' |
| 127 | # Local things, however, do go in /usr/local |
| 128 | siteprefix='/usr/local' |
| 129 | siteprefixexp='/usr/local' |
| 130 | # Ports installs non-std libs in /usr/local/lib so look there too |
| 131 | locincpth='/usr/local/include' |
| 132 | loclibpth='/usr/local/lib' |
| 133 | # Link perl with shared libperl |
| 134 | if [ "$usedl" = "$define" -a -r shlib_version ]; then |
| 135 | useshrplib=true |
| 136 | libperl=$(. ./shlib_version; echo libperl.so.${major}.${minor}) |
| 137 | fi |
| 138 | ;; |
| 139 | esac |
| 140 | |
| 141 | # end |