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