xref: /openbsd-src/gnu/usr.bin/perl/hints/mirbsd.sh (revision 6fb12b7054efc6b436584db6cef9c2f85c0d7e27)
1*43003dfeSmillert# $MirOS: src/gnu/usr.bin/perl/hints/mirbsd.sh,v 1.3 2007/05/07 20:32:09 tg Exp $
2*43003dfeSmillert#
3*43003dfeSmillert# hints file for MirOS by Thorsten Glaser <tg@mirbsd.de>
4*43003dfeSmillert# based upon hints for OpenBSD
5*43003dfeSmillert
6*43003dfeSmillert[ -z "$cc" ] && cc="${CC:-mgcc}"
7*43003dfeSmillert
8*43003dfeSmillert# MirOS has a better malloc than perl...
9*43003dfeSmillertusemymalloc='n'
10*43003dfeSmillert
11*43003dfeSmillert# Added by bingos.
12*43003dfeSmillertloclibpth="/usr/mpkg/lib /usr/local/lib"
13*43003dfeSmillertlocincpath="/usr/mpkg/include /usr/local/include"
14*43003dfeSmillertccflags="$ccflags -fhonour-copts -I/usr/mpkg/include"
15*43003dfeSmillertcppflags="$cppflags -fhonour-copts -I/usr/mpkg/include"
16*43003dfeSmillert
17*43003dfeSmillert# Currently, vfork(2) is not a real win over fork(2).
18*43003dfeSmillertusevfork="$undef"
19*43003dfeSmillert
20*43003dfeSmillerttest -z "$usedl" && usedl=$define
21*43003dfeSmillert# We use -fPIC here because -fpic is *NOT* enough for some of the
22*43003dfeSmillert# extensions like Tk on some platforms (ie: sparc)
23*43003dfeSmillertcccdlflags="-DPIC -fPIC $cccdlflags"
24*43003dfeSmillertld=$cc
25*43003dfeSmillertlddlflags="-shared -fPIC $lddlflags"
26*43003dfeSmillertlibswanted=$(echo $libswanted | sed 's/ dl / /')
27*43003dfeSmillert
28*43003dfeSmillert# We need to force ld to export symbols on ELF platforms.
29*43003dfeSmillert# Without this, dlopen() is crippled. All platforms are ELF.
30*43003dfeSmillertldflags="-Wl,-E $ldflags"
31*43003dfeSmillert
32*43003dfeSmillert# malloc wrap works
33*43003dfeSmillertcase "$usemallocwrap" in
34*43003dfeSmillert'') usemallocwrap='define' ;;
35*43003dfeSmillertesac
36*43003dfeSmillert
37*43003dfeSmillert# MirOS doesn't need libcrypt
38*43003dfeSmillertlibswanted=$(echo $libswanted | sed 's/ crypt / /')
39*43003dfeSmillert
40*43003dfeSmillert# Configure can't figure this out non-interactively
41*43003dfeSmillertd_suidsafe=$define
42*43003dfeSmillert
43*43003dfeSmillert# cc is gcc so we can do better than -O
44*43003dfeSmillert# Allow a command-line override, such as -Doptimize=-g
45*43003dfeSmillerttest "$optimize" || optimize='-O2'
46*43003dfeSmillert
47*43003dfeSmillert# This script UU/usethreads.cbu will get 'called-back' by Configure
48*43003dfeSmillert# after it has prompted the user for whether to use threads.
49*43003dfeSmillertcat > UU/usethreads.cbu <<'EOCBU'
50*43003dfeSmillertcase "$usethreads" in
51*43003dfeSmillert$define|true|[yY]*)
52*43003dfeSmillert	ccflags="-pthread $ccflags"
53*43003dfeSmillert	ldflags="-pthread $ldflags"
54*43003dfeSmillertesac
55*43003dfeSmillertEOCBU
56*43003dfeSmillert
57*43003dfeSmillert# When building in the MirOS tree we use different paths
58*43003dfeSmillert# This is only part of the story, the rest comes from config.over
59*43003dfeSmillertcase "$mirbsd_distribution" in
60*43003dfeSmillert''|$undef|false) ;;
61*43003dfeSmillert*)
62*43003dfeSmillert	# We put things in /usr, not /usr/local
63*43003dfeSmillert	prefix='/usr'
64*43003dfeSmillert	prefixexp='/usr'
65*43003dfeSmillert	sysman='/usr/share/man/man1'
66*43003dfeSmillert	libpth='/usr/lib'
67*43003dfeSmillert	glibpth='/usr/lib'
68*43003dfeSmillert	# Local things, however, do go in /usr/local
69*43003dfeSmillert	siteprefix='/usr/local'
70*43003dfeSmillert	siteprefixexp='/usr/local'
71*43003dfeSmillert	# Ports installs non-std libs in /usr/local/lib so look there too
72*43003dfeSmillert	locincpth='/usr/local/include'
73*43003dfeSmillert	loclibpth='/usr/local/lib'
74*43003dfeSmillert	# Link perl with shared libperl
75*43003dfeSmillert	if [ "$usedl" = "$define" -a -r shlib_version ]; then
76*43003dfeSmillert		useshrplib=true
77*43003dfeSmillert		libperl=$(. ./shlib_version; echo libperl.so.${major}.${minor})
78*43003dfeSmillert	fi
79*43003dfeSmillert	;;
80*43003dfeSmillertesac
81*43003dfeSmillert
82*43003dfeSmillert# end
83