This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test-Harness: don't assume symlink succeeds
[perl5.git] / hints / gnu.sh
1 # hints/gnu.sh
2 # Originally contributed by:  Mark Kettenis <kettenis@phys.uva.nl> Dec 10 1998
3
4 # libnsl is unusable on the Hurd.
5 # XXX remove this once SUNRPC is implemented.
6 set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ nsl / /' -e 's/ c / pthread /'`
7 shift
8 libswanted="$*"
9
10 # Debian 4.0 puts ndbm in the -lgdbm_compat library.
11 libswanted="$libswanted gdbm_compat"
12
13 # malloc wrap works
14 case "$usemallocwrap" in
15 '') usemallocwrap='define' ;;
16 esac
17
18 # The system malloc() is about as fast and as frugal as perl's.
19 # Since the system malloc() has been the default since at least
20 # 5.001, we might as well leave it that way.  --AD  10 Jan 2002
21 case "$usemymalloc" in
22 '') usemymalloc='n' ;;
23 esac
24
25 case "$optimize" in
26 '') optimize='-O2' ;;
27 esac
28
29 case "$plibpth" in
30 '') plibpth=`gcc -print-search-dirs | grep libraries |
31         cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
32     set X $plibpth # Collapse all entries on one line
33     shift
34     plibpth="$*"
35     ;;
36 esac
37
38 case "$libc" in
39 '')
40 # If you have glibc, then report the version for ./myconfig bug reporting.
41 # (Configure doesn't need to know the specific version since it just uses
42 # gcc to load the library for all tests.)
43 # We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
44 # are insufficiently precise to distinguish things like
45 # libc-2.0.6 and libc-2.0.7.
46     for p in $plibpth
47     do
48         for trylib in libc.so.0.3 libc.so
49         do
50             if $test -e $p/$trylib; then
51                 libc=`ls -l $p/$trylib | awk '{print $NF}'`
52                 if $test "X$libc" != X; then
53                     break
54                 fi
55             fi
56         done
57         if $test "X$libc" != X; then
58             break
59         fi
60     done
61     ;;
62 esac
63
64 # Flags needed to produce shared libraries.
65 lddlflags='-shared'
66
67 # Flags needed by programs that use dynamic linking.
68 ccdlflags='-Wl,-E'
69
70 # This script UU/usethreads.cbu will get 'called-back' by Configure
71 # after it has prompted the user for whether to use threads.
72 cat > UU/usethreads.cbu <<'EOCBU'
73 case "$usethreads" in
74 $define|true|[yY]*)
75         ccflags="-D_REENTRANT -D_GNU_SOURCE $ccflags"
76         if echo $libswanted | grep -v pthread >/dev/null
77         then
78             set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
79             shift
80             libswanted="$*"
81         fi
82
83         # Somehow at least in Debian 2.2 these manage to escape
84         # the #define forest of <features.h> and <time.h> so that
85         # the hasproto macro of Configure doesn't see these protos,
86         # even with the -D_GNU_SOURCE.
87
88         d_asctime_r_proto="$define"
89         d_crypt_r_proto="$define"
90         d_ctime_r_proto="$define"
91         d_gmtime_r_proto="$define"
92         d_localtime_r_proto="$define"
93         d_random_r_proto="$define"
94
95         ;;
96 esac
97 EOCBU
98
99 cat > UU/uselargefiles.cbu <<'EOCBU'
100 # This script UU/uselargefiles.cbu will get 'called-back' by Configure
101 # after it has prompted the user for whether to use large files.
102 case "$uselargefiles" in
103 ''|$define|true|[yY]*)
104 # Keep this in the left margin.
105 ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
106
107         ccflags="$ccflags $ccflags_uselargefiles"
108         ;;
109 esac
110 EOCBU
111
112 # The following routines are only available as stubs in GNU libc.
113 # XXX remove this once metaconf detects the GNU libc stubs.
114 d_msgctl='undef'
115 d_msgget='undef'
116 d_msgrcv='undef'
117 d_msgsnd='undef'
118 d_semctl='undef'
119 d_semget='undef'
120 d_semop='undef'
121 d_shmat='undef'
122 d_shmctl='undef'
123 d_shmdt='undef'
124 d_shmget='undef'