This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
This is my patch patch.1i for perl5.001.
[perl5.git] / hints / linux.sh
CommitLineData
1aef975c 1# hints/linux.sh
a0d0e21e 2# Original version by rsanders
1fc4cb55 3# Additional support by Kenneth Albanowski <kjahds@kjahds.com>
1aef975c 4#
232e078e
AD
5# ELF support by H.J. Lu <hjl@nynexst.com>
6# Additional info from Nigel Head <nhead@ESOC.bitnet>
7# and Kenneth Albanowski <kjahds@kjahds.com>
1aef975c 8#
232e078e 9# Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
1fc4cb55 10#
16d20bd9 11# Last updated Tue May 30 14:25:02 EDT 1995
232e078e 12#
f0b7e567
AD
13# If you wish to use something other than 'gcc' for your compiler,
14# you should specify it on the Configure command line. To use
16d20bd9 15# gcc-elf, for exmample, type
f0b7e567 16# ./Configure -Dcc=gcc-elf
232e078e
AD
17
18# perl goes into the /usr tree. See the Filesystem Standard
19# available via anonymous FTP at tsx-11.mit.edu in
20# /pub/linux/docs/linux-standards/fsstnd.
16d20bd9 21# Allow a command line override, e.g. Configure -Dprefix=/foo/bar
232e078e
AD
22case "$prefix" in
23'') prefix='/usr' ;;
24esac
1fc4cb55 25
232e078e 26# Perl expects BSD style signal handling.
16d20bd9 27# gcc-2.6.3 defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
5d94fbed 28ccflags="-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL $ccflags"
1fc4cb55 29
5d94fbed 30# The following functions are gcc built-ins, but the Configure tests
16d20bd9
AD
31# may fail because they don't supply proper prototypes.
32# This should be fixed as of 5.001f. I'd appreciate reports.
232e078e
AD
33d_memcmp=define
34d_memcpy=define
35
36# Configure may fail to find lstat() since it's a static/inline
37# function in <sys/stat.h>.
38d_lstat=define
1aef975c 39
16d20bd9 40# Explanation?
a0d0e21e 41d_dosuid='define'
1aef975c 42
16d20bd9 43# I think Configure gets this right now, but I'd appreciate reports.
a0d0e21e 44malloctype='void *'
16d20bd9
AD
45
46# Explanation?
1aef975c
AD
47usemymalloc='n'
48
49case "$optimize" in
50'') optimize='-O2' ;;
51esac
52
232e078e
AD
53# Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
54# for this test.
55cat >try.c <<'EOM'
56/* Test for whether ELF binaries are produced */
57#include <fcntl.h>
58#include <stdlib.h>
59main() {
60 char buffer[4];
61 int i=open("a.out",O_RDONLY);
62 if(i==-1)
63 exit(1); /* fail */
64 if(read(i,&buffer[0],4)<4)
65 exit(1); /* fail */
66 if(buffer[0] != 127 || buffer[1] != 'E' ||
67 buffer[2] != 'L' || buffer[3] != 'F')
68 exit(1); /* fail */
69 exit(0); /* succeed (yes, it's ELF) */
70}
71EOM
f0b7e567 72if ${cc:-gcc} try.c >/dev/null 2>&1 && ./a.out; then
232e078e
AD
73 cat <<'EOM'
74
75You appear to have ELF support. I'll try to use it for dynamic loading.
76EOM
232e078e 77else
16d20bd9
AD
78 cat <<'EOM'
79
80You don't have an ELF gcc. I will use dld if possible. If you are
81using a version of DLD earlier than 3.2.6, or don't have it at all, you
82should probably upgrade. If you are forced to use 3.2.4, you should
83uncomment a couple of lines in hints/linux.sh and rerun Configure to
84disallow shared libraries.
85
86EOM
232e078e 87 lddlflags="-r $lddlflags"
5d94fbed
AD
88 # These empty values are so that Configure doesn't put in the
89 # Linux ELF values.
90 ccdlflags=' '
91 cccdlflags=' '
1aef975c
AD
92 so='sa'
93 dlext='o'
94 ## If you are using DLD 3.2.4 which does not support shared libs,
95 ## uncomment the next two lines:
96 #ldflags="-static"
97 #so='none'
232e078e
AD
98fi
99rm -rf try.c a.out
a0d0e21e 100
16d20bd9
AD
101case "$BASH_VERSION" in
1021.14.3*)
103 cat <<'EOM'
104
105If you get failure of op/exec test #5 during the test phase, you probably
106have a buggy version of bash. Upgrading to a recent version (1.14.4 or
107later) should fix the problem.
a0d0e21e 108
a0d0e21e 109EOM
16d20bd9
AD
110;;
111esac
112
113# In addition, on some systems there is a problem with perl and NDBM, which
114# causes AnyDBM and NDBM_File to lock up. This is evidenced in the tests as
115# AnyDBM just freezing. Currently we disable NDBM for all linux systems.
116# If someone can suggest a more robust test, that would be appreciated.
117d_dbm_open=undef
232e078e 118