Repository navigation
Expand file tree
/
Copy pathMakepkgs.configopts
More file actions
156 lines (154 loc) · 5.21 KB
/
Copy pathMakepkgs.configopts
File metadata and controls
156 lines (154 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# common $configopts settings for Makepkgs and qa/admin/myconfigure
#
if $dodeb
then
# On Debian-based platforms, the debian/rules file already captures
# most of the required configure settings in $(configure_paths) and
# $(configure_tools) ... but turn off SELinux because it fights with
# AppArmor
#
configopts="$configopts --with-selinux=no"
elif $dorpm
then
# On RPM-based platforms, rpm macros provide an excellent set of defaults.
# This set is based on Fedora 22 %configure macro from /usr/lib/rpm/macros,
# and is known to work as far back as RHEL5.
configopts="`rpmbuild --eval '--exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --prefix=%{_prefix}' 2>/dev/null`"
# rpmbuild clears the environment, so force these settings into the
# rpm build configure
#
configopts="$configopts --with-make=$MAKE --with-tar=$TAR --with-zip=$ZIP"
# for RHEL 6 and CentOS 6, building with selinux no longer works, and
# our libqwt won't build
#
if [ -f /etc/system-release ]
then
if grep -E '((Red Hat)|CentOS).* release 6\.' /etc/system-release >/dev/null
then
configopts="$configopts --with-selinux=no --with-qt=no"
fi
fi
# bpftrace PMDA can't be installed on CentOS 7.9 or 32-bit openSUSE
# so don't build it
#
if [ -f /etc/system-release ]
then
if grep -E '((Red Hat)|CentOS).* release 7\.' /etc/system-release >/dev/null
then
configopts="$configopts --with-pmdabpftrace=no"
fi
fi
if [ -f /etc/os-release ]
then
if grep 'openSUSE' /etc/os-release >/dev/null
then
case `uname -m`
in
i?86)
configopts="$configopts --with-pmdabpftrace=no"
;;
esac
fi
fi
elif [ $target = darwin ]
then
# On Mac OS platforms, we install away from /usr/bin, /usr/lib
# and so on because of security requirements in recent versions.
# Qt use is retired here due to problems with linking+packaging.
# The realpath invocations resolve an issue relating to symlink
# re-mapping to the /private paths.
#
etc=`realpath /etc`
var=`realpath /var`
configopts="--sysconfdir=$etc --localstatedir=$var --prefix=/usr/local --with-qt=no"
PKGBUILD=`which pkgbuild`; export PKGBUILD
elif [ $target = netbsd ]
then
# Try to mimic where pkgsrc/pkgin places things
#
configopts="--exec-prefix=/usr/pkg --mandir=/usr/pkg/man --with-rcdir=/etc/rc.d --localstatedir=/usr/pkg --with-rundir=/var/run --with-tmpdir=/var/tmp --with-logdir=/var/log/pcp --prefix=/usr/pkg"
elif [ $target = freebsd ]
then
# Python build does not work on FreeBSD 9.3, so skip it
# For FreeBSD 10.4 and 11.3 it seems to fail when trying to build
# Python and Python3 at the same time ... so skip Python(2)
# For FreeBSD 13 I don't have Qt working
# For FreeBSD 14 cppcheck => Qt installed
#
case `uname -r`
in
9.3*)
# Bog-standard, just without python3
#
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr --with-python3=no"
;;
13.*)
# Bog-standard, just without Qt
#
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr --with-qt=no"
;;
*)
# Bog-standard, as below ...
#
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr"
;;
esac
elif [ $target = sunos ]
then
# Need to take control of the Python versions, otherwise standard.
#
configopts="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-python3=check"
else
# Bog-standard options suitable for a package on any platform.
# Command line can be used to extend this set, and any unusual
# platform-specific requirements are also appended later on.
configopts="--sysconfdir=/etc --localstatedir=/var --prefix=/usr"
fi
# Platform-specific variants ...
#
case "$target"
in
mingw|mingw64|windows)
target=mingw
dorpm=false
configopts="$configopts --disable-ssp --without-python3"
configure="/usr/bin/mingw64-configure"; export configure
MAKE="/usr/bin/mingw64-make"; export MAKE
QMAKE="/usr/bin/mingw64-qmake-qt6"; export QMAKE
PKG_CONFIG="/usr/bin/mingw64-pkg-config"; export PKG_CONFIG
;;
linux)
ARCH=`uname -m`
[ -f /etc/slackware-version -a "$ARCH" = x86_64 ] && configopts="$configopts --libdir=/usr/lib64"
;;
sunos|SunOS|solaris)
ARCH=`isainfo -k`
[ "$ARCH" = amd64 -o "$ARCH" = sparcv9 ] && configopts="$configopts --libdir=/usr/lib/64"
YACC=bison; export YACC
LEX=flex; export LEX
;;
esac
# now some specific QA/development hosts with special needs ...
#
case `hostname`
in
bozo-vm|bozo-vm.localdomain)
# trying to build pmview here ...
#
configopts="$configopts --with-qt=debug --without-optimization"
;;
vm11|vm11.localdomain)
# gcc -O2 is broken here (for the linux PMDA)
#
configopts="$configopts --with-optimization=no"
# over-ride the settings from dpkg-buildflags
#
DEB_CFLAGS_SET=''; export DEB_CFLAGS_SET
DEB_CXXFLAGS_SET=''; export DEB_CXXFLAGS_SET
;;
vm34|vm34.localdomain)
# libpf won't build here for latest Arch Linux - 20 Aug 2026
#
configopts="$configopts --with-pmdabpf=no"
;;
esac