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 # This script UU/use64bitint.cbu will get 'called-back' by Configure
133 # after it has prompted the user for whether to use 64-bitness.
134 cat > UU/use64bitint.cbu <<'EOCBU'
135 case "$use64bitint" in
138 echo "Checking if your C library has broken 64-bit functions..." >&4
141 typedef $uquadtype myULL;
148 {4294967303.15, 4294967303ULL},
149 {4294967294.2, 4294967294ULL},
150 {4294967295.7, 4294967295ULL},
153 for (p = test; p->u; p++) {
154 myULL x = (myULL)p->d;
165 if eval $compile_ok; then
167 echo "Your C library's 64-bit functions are $libcquad."
169 echo "(I can't seem to compile the test program.)"
170 echo "Assuming that your C library's 64-bit functions are ok."
179 *** You have a C library with broken 64-bit functions.
180 *** 64-bit support does not work reliably in this configuration.
181 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
182 *** Cannot continue, aborting.
191 # When building in the OpenBSD tree we use different paths
192 # This is only part of the story, the rest comes from config.over
193 case "$openbsd_distribution" in
196 # We put things in /usr, not /usr/local
199 sysman='/usr/share/man/man1'
202 # Local things, however, do go in /usr/local
203 siteprefix='/usr/local'
204 siteprefixexp='/usr/local'
205 # Ports installs non-std libs in /usr/local/lib so look there too
206 locincpth='/usr/local/include'
207 loclibpth='/usr/local/lib'
208 # Link perl with shared libperl
209 if [ "$usedl" = "$define" -a -r shlib_version ]; then
211 libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}`