Commit | Line | Data |
---|---|---|
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... | |
12 | test "$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 |
16 | usevfork='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 |
21 | d_setregid=$undef |
22 | d_setreuid=$undef | |
23 | d_setrgid=$undef | |
24 | d_setruid=$undef | |
43051805 GS |
25 | |
26 | # | |
48827ca2 | 27 | # Not all platforms support dynamic loading... |
43051805 | 28 | # |
48827ca2 GS |
29 | case `arch` in |
30 | OpenBSD.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" | |
154d43cb JH |
40 | case "$osvers" in |
41 | [01].*|2.[0-7]|2.[0-7].*) | |
42 | lddlflags="-Bshareable $lddlflags" | |
43 | ;; | |
44 | *) # from 2.8 onwards | |
45 | ld=${cc:-cc} | |
eb9cd59d | 46 | lddlflags="-shared -fPIC $lddlflags" |
154d43cb JH |
47 | ;; |
48 | esac | |
43051805 GS |
49 | ;; |
50 | esac | |
51 | ||
1528c3db TM |
52 | # |
53 | # Tweaks for various versions of OpenBSD | |
54 | # | |
55 | case "$osvers" in | |
56 | 2.5) | |
57 | # OpenBSD 2.5 has broken odbm support | |
58 | i_dbm=$undef | |
59 | ;; | |
60 | esac | |
61 | ||
43051805 GS |
62 | # OpenBSD doesn't need libcrypt but many folks keep a stub lib |
63 | # around for old NetBSD binaries. | |
64 | libswanted=`echo $libswanted | sed 's/ crypt / /'` | |
65 | ||
43051805 | 66 | # Configure can't figure this out non-interactively |
1528c3db | 67 | d_suidsafe=$define |
43051805 GS |
68 | |
69 | # cc is gcc so we can do better than -O | |
70 | # Allow a command-line override, such as -Doptimize=-g | |
71 | test "$optimize" || optimize='-O2' | |
72 | ||
619ffc2b JH |
73 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
74 | # after it has prompted the user for whether to use threads. | |
75 | cat > UU/usethreads.cbu <<'EOCBU' | |
76 | case "$usethreads" in | |
77 | $define|true|[yY]*) | |
78 | # any openbsd version dependencies with pthreads? | |
34163b21 JH |
79 | ccflags="-pthread $ccflags" |
80 | ldflags="-pthread $ldflags" | |
619ffc2b | 81 | libswanted="$libswanted pthread" |
34163b21 JH |
82 | # This is strange. |
83 | usevfork="$undef" | |
619ffc2b JH |
84 | esac |
85 | EOCBU | |
86 | ||
c347f277 TM |
87 | # When building in the OpenBSD tree we use different paths |
88 | # This is only part of the story, the rest comes from config.over | |
89 | case "$openbsd_distribution" in | |
48827ca2 | 90 | ''|$undef|false) ;; |
c347f277 TM |
91 | *) |
92 | # We put things in /usr, not /usr/local | |
93 | prefix='/usr' | |
94 | prefixexp='/usr' | |
95 | sysman='/usr/share/man/man1' | |
c347f277 | 96 | libpth='/usr/lib' |
48827ca2 | 97 | glibpth='/usr/lib' |
eb9cd59d TM |
98 | # Local things, however, do go in /usr/local |
99 | siteprefix='/usr/local' | |
100 | siteprefixexp='/usr/local' | |
48827ca2 GS |
101 | # Ports installs non-std libs in /usr/local/lib so look there too |
102 | locincpth='/usr/local/include' | |
103 | loclibpth='/usr/local/lib' | |
104 | # Link perl with shared libperl | |
105 | if [ "$usedl" = "$define" -a -r shlib_version ]; then | |
106 | useshrplib=true | |
107 | libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}` | |
108 | fi | |
c347f277 TM |
109 | ;; |
110 | esac | |
111 | ||
43051805 | 112 | # end |