xref: /openbsd-src/gnu/usr.bin/perl/hints/gnu.sh (revision 5759b3d249badf144a6240f7eec4dcf9df003e6b)
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.
6set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ nsl / /' -e 's/ c / pthread /'`
7shift
8libswanted="$*"
9
10# Debian 4.0 puts ndbm in the -lgdbm_compat library.
11libswanted="$libswanted gdbm_compat"
12
13# malloc wrap works
14case "$usemallocwrap" in
15'') usemallocwrap='define' ;;
16esac
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
21case "$usemymalloc" in
22'') usemymalloc='n' ;;
23esac
24
25case "$optimize" in
26'') optimize='-O2' ;;
27esac
28
29case "$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    ;;
36esac
37
38case "$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    ;;
62esac
63
64# Flags needed to produce shared libraries.
65lddlflags='-shared'
66
67# Flags needed by programs that use dynamic linking.
68ccdlflags='-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.
72cat > UU/usethreads.cbu <<'EOCBU'
73case "$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	;;
96esac
97EOCBU
98
99cat > 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.
102case "$uselargefiles" in
103''|$define|true|[yY]*)
104# Keep this in the left margin.
105ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
106
107	ccflags="$ccflags $ccflags_uselargefiles"
108	;;
109esac
110EOCBU
111
112# The following routines are only available as stubs in GNU libc.
113# XXX remove this once metaconf detects the GNU libc stubs.
114d_msgctl='undef'
115d_msgget='undef'
116d_msgrcv='undef'
117d_msgsnd='undef'
118d_semctl='undef'
119d_semget='undef'
120d_semop='undef'
121d_shmat='undef'
122d_shmctl='undef'
123d_shmdt='undef'
124d_shmget='undef'
125