This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
split()'s unused captures should be undef, not ''
[perl5.git] / hints / darwin.sh
CommitLineData
f556e5b9
JH
1##
2# Darwin (Mac OS) hints
437cf188 3# Wilfredo Sanchez <wsanchez@mit.edu>
f556e5b9
JH
4##
5
6##
7# Paths
8##
9
10# BSD paths
e32f0149
JH
11case "$prefix" in
12'')
13 prefix='/usr/local'; # Built-in perl uses /usr
14 siteprefix='/usr/local';
15 vendorprefix='/usr/local'; usevendorprefix='define';
16
17 # 4BSD uses ${prefix}/share/man, not ${prefix}/man.
18 # Don't put man pages in ${prefix}/lib; that's goofy.
19 man1dir="${prefix}/share/man/man1";
20 man3dir="${prefix}/share/man/man3";
21
22 # Where to put modules.
23 # Built-in perl uses /System/Library/Perl
24 privlib='/Library/Perl';
25 sitelib='/Library/Perl';
26 vendorlib='/Network/Library/Perl';
27 ;;
28esac
f556e5b9
JH
29
30##
31# Tool chain settings
32##
33
34# Since we can build fat, the archname doesn't need the processor type
35archname='darwin';
36
37# nm works.
38usenm='true';
39
40# Libc is in libsystem.
4e644a1e 41#libc='/usr/lib/libSystem.dylib';
f556e5b9
JH
42
43# Optimize.
23131aa4
RH
44if [ "x$optimize" = 'x' ]; then
45 optimize='-O3'
46fi
f556e5b9 47
0ac8ade1
AD
48# XXX Unclear why we require -pipe and -fno-common here.
49ccflags="${ccflags} -pipe -fno-common"
f556e5b9 50
4e644a1e 51# At least on Darwin 1.3.x:
ccf87481
JH
52#
53# # define INT32_MIN -2147483648
54# int main () {
55# double a = INT32_MIN;
56# printf ("INT32_MIN=%g\n", a);
57# return 0;
58# }
59# will output:
60# INT32_MIN=2.14748e+09
61# Note that the INT32_MIN has become positive.
62# INT32_MIN is set in /usr/include/stdint.h by:
63# #define INT32_MIN -2147483648
64# which seems to break the gcc. Defining INT32_MIN as (-2147483647-1)
65# seems to work. INT64_MIN seems to be similarly broken.
66# -- Nicholas Clark, Ken Williams, and Edward Moy
67#
68ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN"
69
4e644a1e 70# cpp-precomp is problematic.
0511a818 71cppflags='-traditional-cpp';
2ece6c11 72
f556e5b9
JH
73# Shared library extension is .dylib.
74# Bundle extension is .bundle.
75ld='cc';
76so='dylib';
77dlext='bundle';
78dlsrc='dl_dyld.xs'; usedl='define';
c374061b 79cccdlflags=' '; # space, not empty, because otherwise we get -fpic
f556e5b9
JH
80lddlflags="${ldflags} -bundle -undefined suppress";
81ldlibpthname='DYLD_LIBRARY_PATH';
82useshrplib='true';
83
84##
85# System libraries
86##
87
88# vfork works
89usevfork='true';
90
91# malloc works
92usemymalloc='n';
2ece6c11 93
d235852b
PP
94##
95# Build process
96##
97
98# Locales aren't feeling well.
99LC_ALL=C; export LC_ALL;
100
4e644a1e
W
101# Case-insensitive filesystems don't get along with Makefile and
102# makefile in the same place. Since Darwin uses GNU make, this dodges
103# the problem.
d235852b 104firstmakefile=GNUmakefile;