Patch from Andreas.
[p5sagit/p5-mst-13.2.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 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 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 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 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 31# may fail because they don't supply proper prototypes.
32# This should be fixed as of 5.001f. I'd appreciate reports.
232e078e 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 45
46# Explanation?
1aef975c 47usemymalloc='n'
48
49case "$optimize" in
50'') optimize='-O2' ;;
51esac
52
232e078e 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 73 cat <<'EOM'
74
75You appear to have ELF support. I'll try to use it for dynamic loading.
76EOM
232e078e 77else
16d20bd9 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
c2960299 83uncomment a couple of lines in hints/linux.sh and restart Configure so
84that shared libraries will be disallowed.
16d20bd9 85
86EOM
232e078e 87 lddlflags="-r $lddlflags"
5d94fbed 88 # These empty values are so that Configure doesn't put in the
89 # Linux ELF values.
90 ccdlflags=' '
91 cccdlflags=' '
1aef975c 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 98fi
a0d0e21e 99
c2960299 100rm -f try.c a.out
16d20bd9 101
c2960299 102if /bin/bash -c exit; then
103 echo You appear to have a working bash. Good.
104else
105 cat << 'EOM'
106Warning: it would appear you have a defective bash shell installed. This is
107likely to give you a failure of op/exec test #5 during the test phase of the
108build, Upgrading to a recent version (1.14.4 or later) should fix the
109problem.
a0d0e21e 110
a0d0e21e 111EOM
c2960299 112
113fi
16d20bd9 114
115# In addition, on some systems there is a problem with perl and NDBM, which
116# causes AnyDBM and NDBM_File to lock up. This is evidenced in the tests as
117# AnyDBM just freezing. Currently we disable NDBM for all linux systems.
118# If someone can suggest a more robust test, that would be appreciated.
c2960299 119# This will generate a harmless message:
120# Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
121# Propagating recommended variable d_dbm_open
16d20bd9 122d_dbm_open=undef
232e078e 123