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