3 # hints file for OpenBSD; Todd Miller <millert@openbsd.org>
4 # Edited to allow Configure command-line overrides by
5 # Andy Dougherty <doughera@lafayette.edu>
7 # To build with distribution paths, use:
8 # ./Configure -des -Dopenbsd_distribution=defined
11 # OpenBSD has a better malloc than perl...
12 test "$usemymalloc" || usemymalloc='n'
14 # Currently, vfork(2) is not a real win over fork(2).
17 # In OpenBSD < 3.3, the setre?[ug]id() are emulated using the
18 # _POSIX_SAVED_IDS functionality which does not have the same
19 # semantics as 4.3BSD. Starting with OpenBSD 3.3, the original
20 # semantics have been restored.
30 # Not all platforms support dynamic loading...
31 # For the case of "$openbsd_distribution", the hints file
32 # needs to know whether we are using dynamic loading so that
33 # it can set the libperl name appropriately.
34 # Allow command line overrides.
36 ARCH=`arch | sed 's/^OpenBSD.//'`
37 case "${ARCH}-${osvers}" in
38 alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-7]|m88k-*|hppa-*|vax-*)
39 test -z "$usedl" && usedl=$undef
42 test -z "$usedl" && usedl=$define
43 # We use -fPIC here because -fpic is *NOT* enough for some of the
44 # extensions like Tk on some OpenBSD platforms (ie: sparc)
45 cccdlflags="-DPIC -fPIC $cccdlflags"
47 [01].*|2.[0-7]|2.[0-7].*)
48 lddlflags="-Bshareable $lddlflags"
52 lddlflags="-shared -fPIC $lddlflags"
56 lddlflags="-shared -fPIC $lddlflags"
57 libswanted=`echo $libswanted | sed 's/ dl / /'`
61 # We need to force ld to export symbols on ELF platforms.
62 # Without this, dlopen() is crippled.
63 ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
64 test -n "$ELF" && ldflags="-Wl,-E $ldflags"
69 # Tweaks for various versions of OpenBSD
73 # OpenBSD 2.5 has broken odbm support
78 # OpenBSD doesn't need libcrypt but many folks keep a stub lib
79 # around for old NetBSD binaries.
80 libswanted=`echo $libswanted | sed 's/ crypt / /'`
82 # Configure can't figure this out non-interactively
85 # cc is gcc so we can do better than -O
86 # Allow a command-line override, such as -Doptimize=-g
95 test "$optimize" || optimize='-O2'
99 # This script UU/usethreads.cbu will get 'called-back' by Configure
100 # after it has prompted the user for whether to use threads.
101 cat > UU/usethreads.cbu <<'EOCBU'
102 case "$usethreads" in
104 # any openbsd version dependencies with pthreads?
105 ccflags="-pthread $ccflags"
106 ldflags="-pthread $ldflags"
109 # Change from -lc to -lc_r
110 set `echo "X $libswanted " | sed 's/ c / c_r /'`
118 # When building in the OpenBSD tree we use different paths
119 # This is only part of the story, the rest comes from config.over
120 case "$openbsd_distribution" in
123 # We put things in /usr, not /usr/local
126 sysman='/usr/share/man/man1'
129 # Local things, however, do go in /usr/local
130 siteprefix='/usr/local'
131 siteprefixexp='/usr/local'
132 # Ports installs non-std libs in /usr/local/lib so look there too
133 locincpth='/usr/local/include'
134 loclibpth='/usr/local/lib'
135 # Link perl with shared libperl
136 if [ "$usedl" = "$define" -a -r shlib_version ]; then
138 libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}`