This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
updated OpenBSD hints (From Todd C. Miller <Todd.Miller@courtesan.com>)
[perl5.git] / hints / openbsd.sh
CommitLineData
43051805
GS
1# hints/openbsd.sh
2#
3# hints file for OpenBSD; Todd Miller <millert@openbsd.org>
4# Edited to allow Configure command-line overrides by
5# Andy Dougherty <doughera@lafcol.lafayette.edu>
6#
c347f277 7# To build with distribution paths, use:
48827ca2 8# ./Configure -des -Dopenbsd_distribution=defined
c347f277 9#
43051805
GS
10
11# OpenBSD has a better malloc than perl...
12test "$usemymalloc" || usemymalloc='n'
13
14# Currently, vfork(2) is not a real win over fork(2) but this will
48827ca2 15# change starting with OpenBSD 2.7.
43051805
GS
16usevfork='true'
17
18# setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions
19# in 4.4BSD. Configure will find these but they are just emulated
20# and do not have the same semantics as in 4.3BSD.
1528c3db
TM
21d_setregid=$undef
22d_setreuid=$undef
23d_setrgid=$undef
24d_setruid=$undef
43051805
GS
25
26#
48827ca2 27# Not all platforms support dynamic loading...
43051805 28#
48827ca2
GS
29case `arch` in
30OpenBSD.alpha|OpenBSD.mips|OpenBSD.powerpc|OpenBSD.vax)
31 usedl=$undef
43051805
GS
32 ;;
33*)
48827ca2 34 usedl=$define
43051805
GS
35 d_dlopen=$define
36 d_dlerror=$define
37 # we use -fPIC here because -fpic is *NOT* enough for some of the
38 # extensions like Tk on some OpenBSD platforms (ie: sparc)
39 cccdlflags="-DPIC -fPIC $cccdlflags"
48827ca2 40 lddlflags="-Bshareable $lddlflags"
43051805
GS
41 ;;
42esac
43
1528c3db
TM
44#
45# Tweaks for various versions of OpenBSD
46#
47case "$osvers" in
482.5)
49 # OpenBSD 2.5 has broken odbm support
50 i_dbm=$undef
51 ;;
52esac
53
43051805
GS
54# OpenBSD doesn't need libcrypt but many folks keep a stub lib
55# around for old NetBSD binaries.
56libswanted=`echo $libswanted | sed 's/ crypt / /'`
57
43051805 58# Configure can't figure this out non-interactively
1528c3db 59d_suidsafe=$define
43051805
GS
60
61# cc is gcc so we can do better than -O
62# Allow a command-line override, such as -Doptimize=-g
63test "$optimize" || optimize='-O2'
64
619ffc2b
JH
65# This script UU/usethreads.cbu will get 'called-back' by Configure
66# after it has prompted the user for whether to use threads.
67cat > UU/usethreads.cbu <<'EOCBU'
68case "$usethreads" in
69$define|true|[yY]*)
70 # any openbsd version dependencies with pthreads?
71 libswanted="$libswanted pthread"
72esac
73EOCBU
74
c347f277
TM
75# When building in the OpenBSD tree we use different paths
76# This is only part of the story, the rest comes from config.over
77case "$openbsd_distribution" in
48827ca2 78''|$undef|false) ;;
c347f277
TM
79*)
80 # We put things in /usr, not /usr/local
81 prefix='/usr'
82 prefixexp='/usr'
83 sysman='/usr/share/man/man1'
c347f277 84 libpth='/usr/lib'
48827ca2
GS
85 glibpth='/usr/lib'
86 # Ports installs non-std libs in /usr/local/lib so look there too
87 locincpth='/usr/local/include'
88 loclibpth='/usr/local/lib'
89 # Link perl with shared libperl
90 if [ "$usedl" = "$define" -a -r shlib_version ]; then
91 useshrplib=true
92 libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}`
93 fi
c347f277
TM
94 ;;
95esac
96
43051805 97# end