| 1 | ## |
| 2 | # Rhapsody (Mac OS X Server) hints |
| 3 | # Wilfredo Sanchez <wsanchez@wsanchez.net> |
| 4 | ## |
| 5 | |
| 6 | ## |
| 7 | # Paths |
| 8 | ## |
| 9 | |
| 10 | # Configure hasn't figured out the version number yet. Bummer. |
| 11 | perl_revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $src/patchlevel.h` |
| 12 | perl_version=`awk '/define[ ]+PERL_VERSION/ {print $3}' $src/patchlevel.h` |
| 13 | perl_subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $src/patchlevel.h` |
| 14 | version="${perl_revision}.${perl_version}.${perl_subversion}" |
| 15 | |
| 16 | # BSD paths |
| 17 | case "$prefix" in |
| 18 | '') |
| 19 | # Default install; use non-system directories |
| 20 | prefix='/usr/local'; # Built-in perl uses /usr |
| 21 | siteprefix='/usr/local'; |
| 22 | vendorprefix='/usr'; usevendorprefix='define'; |
| 23 | |
| 24 | # Where to put modules. |
| 25 | sitelib="/Local/Library/Perl/${version}"; # FIXME: Want "/Network/Perl/${version}" also |
| 26 | vendorlib="/System/Library/Perl/${version}"; # Apple-supplied modules |
| 27 | ;; |
| 28 | |
| 29 | '/usr') |
| 30 | # We are building/replacing the built-in perl |
| 31 | siteprefix='/usr/local'; |
| 32 | vendorprefix='/usr/local'; usevendorprefix='define'; |
| 33 | |
| 34 | # Where to put modules. |
| 35 | sitelib="/Local/Library/Perl/${version}"; # FIXME: Want "/Network/Perl/${version}" also |
| 36 | vendorlib="/System/Library/Perl/${version}"; # Apple-supplied modules |
| 37 | ;; |
| 38 | esac |
| 39 | |
| 40 | ## |
| 41 | # Tool chain settings |
| 42 | ## |
| 43 | |
| 44 | # Since we can build fat, the archname doesn't need the processor type |
| 45 | archname='rhapsody'; |
| 46 | |
| 47 | # nm works. |
| 48 | usenm='true'; |
| 49 | |
| 50 | # Libc is in libsystem. |
| 51 | libc='/System/Library/Frameworks/System.framework/System'; |
| 52 | |
| 53 | # Optimize. |
| 54 | optimize='-O3'; |
| 55 | |
| 56 | # -pipe: makes compilation go faster. |
| 57 | # -fno-common because common symbols are not allowed in MH_DYLIB |
| 58 | ccflags="${ccflags} -pipe -fno-common" |
| 59 | |
| 60 | # Unverified whether this is necessary on Rhapsody, but the test shouldn't hurt. |
| 61 | # At least on Darwin 1.3.x: |
| 62 | # |
| 63 | # # define INT32_MIN -2147483648 |
| 64 | # int main () { |
| 65 | # double a = INT32_MIN; |
| 66 | # printf ("INT32_MIN=%g\n", a); |
| 67 | # return 0; |
| 68 | # } |
| 69 | # will output: |
| 70 | # INT32_MIN=2.14748e+09 |
| 71 | # Note that the INT32_MIN has become positive. |
| 72 | # INT32_MIN is set in /usr/include/stdint.h by: |
| 73 | # #define INT32_MIN -2147483648 |
| 74 | # which seems to break the gcc. Defining INT32_MIN as (-2147483647-1) |
| 75 | # seems to work. INT64_MIN seems to be similarly broken. |
| 76 | # -- Nicholas Clark, Ken Williams, and Edward Moy |
| 77 | # |
| 78 | case "$(grep '^#define INT32_MIN' /usr/include/stdint.h)" in |
| 79 | *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;; |
| 80 | esac |
| 81 | |
| 82 | # cpp-precomp is problematic. |
| 83 | cppflags='${cppflags} -traditional-cpp'; |
| 84 | |
| 85 | # This is necessary because perl's build system doesn't |
| 86 | # apply cppflags to cc compile lines as it should. |
| 87 | ccflags="${ccflags} ${cppflags}" |
| 88 | |
| 89 | # Shared library extension is .dylib. |
| 90 | # Bundle extension is .bundle. |
| 91 | ld='cc'; |
| 92 | so='dylib'; |
| 93 | dlext='bundle'; |
| 94 | dlsrc='dl_dyld.xs'; |
| 95 | usedl='define'; |
| 96 | cccdlflags=''; |
| 97 | lddlflags="${ldflags} -bundle -undefined suppress"; |
| 98 | ldlibpthname='DYLD_LIBRARY_PATH'; |
| 99 | useshrplib='true'; |
| 100 | |
| 101 | ## |
| 102 | # System libraries |
| 103 | ## |
| 104 | |
| 105 | # vfork works |
| 106 | usevfork='true'; |
| 107 | |
| 108 | # malloc works |
| 109 | usemymalloc='n'; |
| 110 | |
| 111 | # |
| 112 | # The libraries are not threadsafe in Rhapsody |
| 113 | # |
| 114 | # Fix when Apple fixes libc. |
| 115 | # |
| 116 | case "$usethreads$useithreads" in |
| 117 | *define*) |
| 118 | cat <<EOM >&4 |
| 119 | |
| 120 | |
| 121 | |
| 122 | *** Warning, there might be problems with your libraries with |
| 123 | *** regards to threading. The test ext/threads/t/libc.t is likely |
| 124 | *** to fail. |
| 125 | |
| 126 | EOM |
| 127 | ;; |
| 128 | esac |
| 129 | |
| 130 | ## |
| 131 | # Build process |
| 132 | ## |
| 133 | |
| 134 | # Case-insensitive filesystems don't get along with Makefile and |
| 135 | # makefile in the same place. Since Darwin uses GNU make, this dodges |
| 136 | # the problem. |
| 137 | firstmakefile=GNUmakefile; |