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 # In OpenBSD > 3.7, use perl's malloc [perl #75742]
14 test "$usemymalloc" || usemymalloc=y
19 case "$usemallocwrap" in
20 '') usemallocwrap='define' ;;
23 # Currently, vfork(2) is not a real win over fork(2).
26 # In OpenBSD < 3.3, the setre?[ug]id() are emulated using the
27 # _POSIX_SAVED_IDS functionality which does not have the same
28 # semantics as 4.3BSD. Starting with OpenBSD 3.3, the original
29 # semantics have been restored.
39 # Not all platforms support dynamic loading...
40 # For the case of "$openbsd_distribution", the hints file
41 # needs to know whether we are using dynamic loading so that
42 # it can set the libperl name appropriately.
43 # Allow command line overrides.
45 ARCH=`arch | sed 's/^OpenBSD.//'`
46 case "${ARCH}-${osvers}" in
47 alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-7]|m88k-*|hppa-*|vax-*)
48 test -z "$usedl" && usedl=$undef
51 test -z "$usedl" && usedl=$define
52 # We use -fPIC here because -fpic is *NOT* enough for some of the
53 # extensions like Tk on some OpenBSD platforms (ie: sparc)
54 cccdlflags="-DPIC -fPIC $cccdlflags"
56 [01].*|2.[0-7]|2.[0-7].*)
57 lddlflags="-Bshareable $lddlflags"
61 lddlflags="-shared -fPIC $lddlflags"
65 lddlflags="-shared -fPIC $lddlflags"
66 libswanted=`echo $libswanted | sed 's/ dl / /'`
70 # We need to force ld to export symbols on ELF platforms.
71 # Without this, dlopen() is crippled.
72 ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
73 test -n "$ELF" && ldflags="-Wl,-E $ldflags"
78 # Tweaks for various versions of OpenBSD
82 # OpenBSD 2.5 has broken odbm support
87 # OpenBSD doesn't need libcrypt but many folks keep a stub lib
88 # around for old NetBSD binaries.
89 libswanted=`echo $libswanted | sed 's/ crypt / /'`
91 # Configure can't figure this out non-interactively
94 # cc is gcc so we can do better than -O
95 # Allow a command-line override, such as -Doptimize=-g
104 test "$optimize" || optimize='-O2'
108 # This script UU/usethreads.cbu will get 'called-back' by Configure
109 # after it has prompted the user for whether to use threads.
110 cat > UU/usethreads.cbu <<'EOCBU'
111 case "$usethreads" in
113 # any openbsd version dependencies with pthreads?
114 ccflags="-pthread $ccflags"
115 ldflags="-pthread $ldflags"
118 # Change from -lc to -lc_r
119 set `echo "X $libswanted " | sed 's/ c / c_r /'`
126 # Broken at least up to OpenBSD 3.6, we'll see about 3.7
127 d_getservbyname_r=$undef ;;
132 # When building in the OpenBSD tree we use different paths
133 # This is only part of the story, the rest comes from config.over
134 case "$openbsd_distribution" in
137 # We put things in /usr, not /usr/local
140 sysman='/usr/share/man/man1'
143 # Local things, however, do go in /usr/local
144 siteprefix='/usr/local'
145 siteprefixexp='/usr/local'
146 # Ports installs non-std libs in /usr/local/lib so look there too
147 locincpth='/usr/local/include'
148 loclibpth='/usr/local/lib'
149 # Link perl with shared libperl
150 if [ "$usedl" = "$define" -a -r shlib_version ]; then
152 libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}`