#
# Copyright (c) 2012-2022 Red Hat.
# Copyright (c) 2008 Aconex. All Rights Reserved.
# Copyright (c) 2000,2003,2004 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# Common gmake macros for building
#
# src/include/builddefs. Generated from builddefs.in by configure.
#
ifndef _BUILDDEFS_INCLUDED_
_BUILDDEFS_INCLUDED_ = 1
ifndef _PCP_CONF_INCLUDED_
_PCP_CONF_INCLUDED_ = 1
include $(PCP_DIR)/etc/pcp.conf
endif
# General package information
PACKAGE_VERSION ?= 6.3.7
PACKAGE_MAJOR ?= 6
PACKAGE_MINOR ?= 3
PACKAGE_REVISION ?= 7
PACKAGE_BUILD ?= 8
PACKAGE_NAME ?= pcp
PACKAGE_CONFIGURE ?= --with-infiniband=yes --with-python=no --with-dstat-symlink=yes --with-perfevent=yes --with-pmdagfs2=yes --with-pmdastatsd=yes --with-pmdabcc=yes --with-pmdabpf=yes --with-pmdabpftrace=yes --with-pmdajson=yes --with-pmdamongodb=yes --with-pmdamysql=yes --with-pmdanutcracker=no --with-pmdasnmp=yes --enable-multilib=yes
PACKAGE_DISTRIBUTION ?= redhat
SGI_CHROOT_BUILD ?= 0
SGI_ISSP_BUILD ?= 0
# see build/containers/GNUlocalrules and build/containers/*/GNUmakefile
CONTAINER_VERSION = $(PACKAGE_VERSION)-$(PACKAGE_BUILD)
CONTAINER_ARCH = $(shell uname -p)
BUILDRULES = $(PCP_INC_DIR)/buildrules
# LCFLAGS, LLDFLAGS, LLDLIBS, LDIRT may be specified in local makefiles.
# turn on all warnings by default
ifeq "yes" "yes"
WARN_OFF = -Wall
else
WARN_OFF =
endif
LIBPCP_ABIDIR ?= src
PCPLIB_LDFLAGS = -L$(PCP_LIB_DIR)
# backward compatibility
PCP_LIBS = $(PCPLIB_LDFLAGS)
# platform-specific CFLAGS, LDLIBS, and shared library extension
#
# Note:
# Need PCFLAGS setting here to match the CFLAGS settings in
# ../../configure.ac (likewise for PLDFLAGS and LDFLAGS).
#
TARGET_OS = linux
CROSS_COMPILING = no
CASE_INSENSITIVE_FS = no
C99_CFLAGS = --std=c99
PCFLAGS = -fPIC -fno-strict-aliasing -D_GNU_SOURCE -Wshadow -Wno-array-bounds
PLDFLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
ifneq (, $(filter linux kfreebsd gnu, $(TARGET_OS)))
DSOSUFFIX = so
endif
ifeq "$(TARGET_OS)" "darwin"
DSOSUFFIX = dylib
CASE_INSENSITIVE_FS = yes
endif
ifeq "$(TARGET_OS)" "mingw"
DSOSUFFIX = dll
EXECSUFFIX = .exe
SHELLSUFFIX = .sh
PLDLIBS = -lwsock32 -liphlpapi
endif
ifeq "$(TARGET_OS)" "solaris"
PLDFLAGS += -fPIC
PLDLIBS = -lnsl -lsocket -lresolv -ldl -lposix4
DSOSUFFIX = so
endif
ifeq "$(TARGET_OS)" "aix"
DSOSUFFIX = so
# -qcpluscmt
# allow C++-style // as comment preamble
# -brtl
# use run-time linker
# -bnoipath
# do not use path to DSOs from the build, use default search path
# rules
# (and does not accept -Wall as a valid option)
PLDFLAGS += -brtl -bnoipath
WARN_OFF =
endif
ifeq "$(TARGET_OS)" "freebsd"
DSOSUFFIX = so
endif
ifeq "$(TARGET_OS)" "netbsd"
DSOSUFFIX = so
LDFLAGS += -Wl,-rpath=/usr/pkg/lib
endif
ifeq "$(TARGET_OS)" "openbsd"
DSOSUFFIX = so
endif
CFLAGS_DEV =
CFLAGS_ABI =
CFLAGS_OPT = -O2 -g
CFLAGS_SANITIZER =
CFLAGS += -I$(PCP_INC_DIR)/.. -I$(PCP_INC_DIR) \
-DPCP_VERSION=\"$(PCP_VERSION)\" \
$(PCFLAGS) $(LCFLAGS) $(WARN_OFF) $(CFLAGS_OPT) $(CFLAGS_SANITIZER) $(CFLAGS_DEV)
PIECFLAGS = -fPIE
PIELDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
INVISIBILITY = -fvisibility=hidden # hide shared library symbols
AVAHICFLAGS = -D_REENTRANT
LZMACFLAGS =
LIBUVCFLAGS =
OPENSSLCFLAGS =
SASLCFLAGS =
CMOCKACFLAGS =
LDFLAGS += $(PLDFLAGS) $(WARN_OFF) $(PCP_LIBS) $(LLDFLAGS)
SRCFILES = GNUmakefile $(HFILES) $(CFILES) $(CXXFILES) $(MFILES) \
$(LSRCFILES) $(LFILES) $(YFILES) $(PYFILES)
GPERFTOOLS_LIBS =
# tcmalloc of gperftools must be linked last
LDLIBS = $(LLDLIBS) $(PLDLIBS) $(GPERFTOOLS_LIBS)
MAKEOPTS = --no-print-directory
ifdef PROJECT
QTDIRDIRT = build debug release .obj .ui .moc .qrc *.xcodeproj *.app
QTDIRT = *.a *.o ui_* moc_* qrc_* Info.plist Makefile* object_script.* \
.qmake.stash
endif
DEPDIRT = dep dep.bak
MANDIRT = *.[1-9].gz *.[1-9].bz2 *.[1-9].lzma *.[1-9].xz *.[1-9].tmp
LIBDIRT = $(LIBTARGET) $(STATICLIBTARGET)
CDIRT = $(OBJECTS) $(CMDTARGET) $(CXXMDTARGET)
DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(QTDIRT) $(CDIRT) $(LIBDIRT)
DIRDIRT = $(LDIRDIRT) $(QTDIRDIRT)
OBJECTS = $(ASFILES:.s=.o) \
$(CFILES:.c=.o) \
$(CXXFILES:.cxx=.o) \
$(FFILES:.f=.o) \
$(LFILES:.l=.o) \
$(RLFILES:.rl=.o) \
$(YFILES:%.y=%.tab.o)
#NB: don't override $(MAKE); gnumake sets it well, propagating -j etc.
#MAKE = /usr/bin/gmake
AR = /usr/bin/gcc-ar
CC = gcc
CXX = g++
LD = /usr/bin/ld
AWK = /usr/bin/gawk --posix
SED = /usr/bin/sed
CPP = gcc -E
LEX = flex
YACC = bison
RAGEL =
ECHO = /usr/bin/echo
LN_S = ln -s
GREP = grep
GIT = git
# man-lint should not break the build (-f)
MANLINT = $(TOPDIR)/scripts/man-lint -f
PYLINT = /bin/true --rcfile=$(TOPDIR)/.pylintrc --output-format=colorized
PYTHON =
PYTHON3 = /usr/bin/python3
DTRACE = dtrace
ifeq "$(TARGET_OS)" "freebsd"
QMAKE = /usr/lib64/qt5/bin/qmake
else
QMAKE = QT_SELECT=5 /usr/lib64/qt5/bin/qmake
endif
INSTALL_SH = $(PCP_BINADM_DIR)/install-sh
INSTALL = $(INSTALL_SH) -o $(PCP_USER_INSTALL) -g $(PCP_GROUP_INSTALL)
CCF = $(CC) $(CFLAGS)
CXXF = $(CXX) $(CFLAGS) $(CXXFLAGS)
# NB: don't use $(MAKEF), since that suppresses gnumake's subdir parallelization
#MAKEF = $(MAKE) $(MAKEOPTS)
LDF = $(LD) $(LDFLAGS)
MAKEDEPEND = /usr/bin/true
ifeq "$(TARGET_OS)" "freebsd"
# gmake on FreeBSD has a strange default rule that passes insufficient
# flags to cc/ld for the link step. This change prevents errors like
# undefined reference to `__stack_chk_fail_local'
#
LDFLAGS += $(CFLAGS)
endif
ZIP = /usr/bin/gzip
BZIP2 = /usr/bin/bzip2
LZMA = /usr/freeware/bin/lzma
XZ = /usr/bin/xz
TAR = /usr/bin/gtar
RPMPROG = /usr/bin/rpmbuild
HDIUTIL =
MKINSTALLP =
DLLTOOL =
RPMBUILD= /usr/bin/rpmbuild
RPM = /usr/bin/rpm
POD2MAN = /usr/bin/pod2man
DPKG =
MAKEPKG =
GENPMDA = $(PCP_BIN_DIR)/genpmda
PKGMK =
MD5SUM = /usr/bin/md5sum
INKSCAPE =
CLANG = /usr/bin/clang
LLVM_STRIP = /usr/bin/llvm-strip
BPFTOOL = $(TOPDIR)/vendor/github.com/libbpf/bpftool/src/bpftool
PMDABPF_ARCH = x86
PMDABPF_VMLINUXH = /builddir/build/BUILD/pcp-6.3.7/vendor/github.com/iovisor/bcc/libbpf-tools/x86/vmlinux.h
PMDABPF_MODULES = biolatency.so runqlat.so mountsnoop.so oomkill.so bashreadline.so biolatency.so execsnoop.so exitsnoop.so fsslower.so opensnoop.so runqlat.so statsnoop.so tcpconnect.so tcpconnlat.so vfsstat.so biosnoop.so netatop.so
HAVE_MANPAGES = true
HAVE_GZIPPED_MANPAGES = true
HAVE_BZIP2ED_MANPAGES = false
HAVE_LZMAED_MANPAGES = false
HAVE_XZED_MANPAGES = false
PCP_PREFIX = /usr
PCP_MAN_DIR = /usr/share/man
PCP_HTML_DIR = /usr/share/doc/pcp-doc/html
PCP_ICONS_DIR = /usr/share/pcp-gui/pixmaps
PCP_DESKTOP_DIR = /usr/share/applications
PCP_PMNS_DIR = /var/lib/pcp/pmns
PCP_PMNSADM_DIR = /usr/libexec/pcp/pmns
PCP_SELINUX_DIR = /usr/share/selinux
PCP_BASHSHARE_DIR = /usr/share/bash-completion
NEED_OLD_TBL_HEADER = false
RDYNAMIC_FLAG = -rdynamic
QT_RELEASE = release
QT_VERSION = 5
CLANG_MAJOR_VERSION = 21
# configuration state affecting the entire build
ENABLE_MULTILIB = true
ENABLE_SHARED = false
ENABLE_SECURE = true
ENABLE_PROBES = true
ENABLE_AVAHI = true
ENABLE_DSTAT = true
ENABLE_QT = true
ENABLE_QT3D = false
ENABLE_PYTHON2 = false
ENABLE_PYTHON3 = true
ENABLE_SYSTEMD = true
ENABLE_SELINUX = true
ENABLE_DECOMPRESSION = true
ENABLE_LZMA = true
# for code supporting any modern version of perl
HAVE_PERL = true
# for code supporting both/either python2 and/or python3
HAVE_PYTHON = true
# python dependent bits
HAVE_PYTHON_SIX = true
HAVE_PYTHON_REQUESTS = true
HAVE_PYTHON_SETUPTOOLS = true
HAVE_PYTHON_JSONPOINTER = true
HAVE_PYTHON_ORDEREDDICT = true
HAVE_PYTHON_INFLUXDB = true
HAVE_PYTHON_OPENPYXL = false
HAVE_PYTHON_PYARROW = false
HAVE_PYTHON_BPF = false
# for desktop icons in a variety of img sizes
HAVE_HICOLOR_ICONS = true
# additional libraries needed for particular functions
LIB_FOR_ATOMIC =
LIB_FOR_AVAHI = -lavahi-common -lavahi-client
LIB_FOR_BASENAME =
LIB_FOR_CHAN = -lchan
LIB_FOR_CURSES =
LIB_FOR_DLOPEN =
LIB_FOR_HDR_HISTOGRAM = -lz -lhdr_histogram
LIB_FOR_LZMA = -llzma
LIB_FOR_MATH = -lm
LIB_FOR_PTHREADS =
LIB_FOR_READLINE = -lreadline
LIB_FOR_REGEX =
LIB_FOR_RT =
LIB_FOR_BACKTRACE =
HAVE_LIBUV = true
LIB_FOR_LIBUV = -luv
HAVE_LIBINIH = false
LIB_FOR_INIH =
HAVE_LIBBPF = true
LIBBPF_VERSION = 1.5.0
LIB_FOR_LIBBPF = -lbpf
HAVE_LIBELF = true
LIB_FOR_LIBELF = -lelf
HAVE_NCURSES = true
LIB_FOR_NCURSES = -lncurses -ltinfo
HAVE_NCURSESW = true
LIB_FOR_NCURSESW = -lncursesw -ltinfo
HAVE_DEVMAPPER = true
LIB_FOR_DEVMAPPER = -ldevmapper
HAVE_CMOCKA = false
LIB_FOR_CMOCKA =
HAVE_SASL = true
LIB_FOR_LIBSASL2 = -lsasl2
HAVE_OPENSSL = true
LIB_FOR_OPENSSL = -lssl -lcrypto
HAVE_ZLIB = true
LIB_FOR_ZLIB = -lz
HAVE_LIBDRM = @HAVE_LIBDRM@
LIB_FOR_LIBDRM = -ldrm
CFLAGS_FOR_LIBDRM = -I/usr/include/libdrm -I/usr/include/valgrind
HAVE_LIBDRM_AMDGPU = @HAVE_LIBDRM_AMDGPU@
LIB_FOR_LIBDRM_AMDGPU = -ldrm_amdgpu
CFLAGS_FOR_LIBDRM_AMDGPU = -I/usr/include/libdrm -I/usr/include/valgrind
# configuration state for optional performance domains
SYSTEMD_CFLAGS =
SYSTEMD_LIBS = -lsystemd
PFM_LIBS = -lpfm
IB_LIBS = -libmad -libumad
PMDA_BCC = true
PMDA_BPF = true
PMDA_BPFTRACE = true
PMDA_JSON = true
PMDA_GFS2 = true
PMDA_STATSD = true
PMDA_LIBVIRT = true
PMDA_SYSTEMD = true
PMDA_PERFEVENT = true
PMDA_INFINIBAND = true
PMDA_OPENMETRICS = true
PMDA_ELASTICSEARCH = true
PMDA_MYSQL = true
PMDA_ORACLE = true
PMDA_MONGODB = true
PMDA_POSTGRESQL = true
PMDA_SNMP = true
PMDA_NGINX = true
PMDA_ACTIVEMQ = true
PMDA_POSTFIX = true
PMDA_BIND2 = true
PMDA_NUTCRACKER = false
PMDA_LIO = true
PMDA_MSSQL = true
PMDA_RESCTRL = true
PMDA_AMDGPU = true
SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images
DIST_DIR = $(TOPDIR)/dist
# env vars to be set before you can run a PCP binary in the build
# environment ... needed for tools like newhelp
#
# default, then special case for different platforms
#
RUN_IN_BUILD_ENV = PCP_CONF=$(TOPDIR)/src/include/pcp.conf PCP_ALT_CPP=$(TOPDIR)/src/pmcpp/pmcpp.static$(EXECSUFFIX)
# when cross-compiling, we cannot use RUN_IN_BUILD_ENV, so any binaries
# from PCP we need in the build must be installed on the build machine.
#
ifeq "$(CROSS_COMPILING)" "yes"
NEWHELP = . $$PCP_DIR/etc/pcp.conf && $$PCP_BINADM_DIR/newhelp
PMIECONF = . $$PCP_DIR/etc/pcp.conf && $$PCP_BIN_DIR/pmieconf
PMGENMAP = . $$PCP_DIR/etc/pcp.conf && $$PCP_BIN_DIR/pmgenmap
PMCPP = . $$PCP_DIR/etc/pcp.conf && $$PCP_BINADM_DIR/pmcpp
else
NEWHELP = $(RUN_IN_BUILD_ENV) $(TOPDIR)/src/newhelp/newhelp.static$(EXECSUFFIX)
PMIECONF = $(RUN_IN_BUILD_ENV) $(TOPDIR)/src/pmieconf/pmieconf.static$(EXECSUFFIX)
PMGENMAP = $(RUN_IN_BUILD_ENV) sh ./pmgenmap.sh
PMCPP = $(RUN_IN_BUILD_ENV) $(TOPDIR)/src/pmcpp/pmcpp.static$(EXECSUFFIX)
endif
SUBDIRS_MAKERULE = \
+for d in `echo $^ `; do \
if test -d "$$d" -a -f "$$d/GNUmakefile"; then \
$(ECHO) === $$d ===; \
$(MAKE) $(MAKEOPTS) -C $$d $@ || exit $$?; \
fi; \
done
# special variant of SUBDIRS_MAKERULE when running QA
#
QA_SUBDIRS_MAKERULE = \
+@for d in `echo $^ `; do \
if test -d "$$d" ; then \
if test -f "$$d/GNUmakefile.install"; then \
$(MAKE) --silent -C $$d -f GNUmakefile.install $@ || exit $$?; \
else \
$(MAKE) --silent -C $$d $@ || exit $$?; \
fi; \
fi; \
done
# prepare symbols file for the GNU toolchain (linker) for DSO PMDAs
VERSION_SCRIPT_MAKERULE = \
@rm -f $@; \
echo "$(DOMAIN) {" >$@; \
echo " global: $(PMDAINIT);" >>$@; \
echo " local: *;" >>$@; \
echo "};" >>$@; \
# prepare symbols file for other platforms toolchain for shared libs
# (convert one canonical format - GNU toolchain style - into others)
ifeq "$(TARGET_OS)" "solaris"
EXPORTS_MAKERULE = \
$(AWK) <$< >$@ '\
BEGIN { print "$$mapfile_version 2"; print } \
/\{$$/ { print "SYMBOL_VERSION", $$0; next } \
{ print }'
else
EXPORTS_MAKERULE =
endif
# prepare domain.h used during the PMDA build process for each PMDA
DOMAIN_MAKERULE = \
@rm -f $@; \
echo "/*" >$@; \
echo " * built from $<" >>$@; \
echo " */" >>$@; \
$(AWK) <$< '\
$$1=="\#define" && $$2 == "$(DOMAIN)" {\
print "\#define $(DOMAIN) " $$3 >>"$@"; found++ \
}\
END {\
if (found == 0) { \
print "Botch: no define for domain $(DOMAIN) in $<"; \
system("rm '$@'"); \
exit(1) \
}\
if (found > 1) { \
print "Botch: multiple defines for domain $(DOMAIN) in $<";\
print "... see $@ for details"; \
system("rm '$@'"); \
exit(1) \
}\
exit(0) \
}' || ( rm -f $@ && false )
DOMAIN_PERLRULE = \
@export perldomain=`sed -n \
-e '/PCP::PMDA->new/s/[^0-9]*$$//' \
-e '/PCP::PMDA->new/s/^[^0-9]*//p' pmda$(IAM).pl | \
$(AWK) '{ print $$NF }'`; \
$(AWK) <$< '\
BEGIN {\
domain = toupper("$(IAM)") \
}\
$$1=="\#define" && $$2 == domain { \
pmd=$$3; found++ \
}\
END {\
if (found == 0) {\
print "Botch: no define for domain " domain " in $<"; \
exit(1) \
}\
if (found > 1) {\
print "Botch: multiple defines of domain " domain " in $<";\
exit(1) \
}\
if (pmd != "'"$$perldomain"'") {\
print "Botch: domain number in ../../pmns/stdpmid (" pmd ") does not match domain number in Perl source ("'"$$perldomain"'")"; \
exit(1) \
}\
exit(0) \
}'
DOMAIN_PYTHONRULE = \
@export pythondomain=`sed -n \
-e '/PMDA(/s/[^0-9]*$$//' \
-e '/PMDA(/s/^[^0-9]*//p' $(PYSCRIPT) | \
$(AWK) '{ print $$NF }'`; \
$(AWK) <$< '\
BEGIN {\
domain = toupper("$(IAM)") \
}\
$$1=="\#define" && $$2 == domain { \
pmd=$$3; found++ \
}\
END {\
if (found == 0) {\
print "Botch: no define for domain " domain " in $<"; \
exit(1) \
}\
if (found > 1) {\
print "Botch: multiple defines of domain " domain " in $<";\
exit(1) \
}\
if (pmd != "'"$$pythondomain"'") {\
print "Botch: domain number in ../../pmns/stdpmid (" pmd ") does not match domain number in Python source ("'"$$pythondomain"'")"; \
exit(1) \
}\
exit(0) \
}'
POD_OPTIONS = --section=$(MAN_SECTION) --release=$(PCP_VERSION) \
--center="Performance Co-Pilot" --date="Performance Co-Pilot"
POD_MAKERULE = $(POD2MAN) $(POD_OPTIONS) $^ $@
ifeq "$(TARGET_OS)" "mingw"
INSTALL_MAN =
else
INSTALL_MAN = \
test -z "$$MAN_PAGES" && MAN_PAGES="$(MAN_PAGES)"; \
if [ "$(HAVE_MANPAGES)" = "true" ] ; then \
for d in `echo $$MAN_PAGES`; do \
first=true; \
base=`echo $$d | sed -e 's/\.[0-9]//g'`; \
section=`echo $$d | sed -e 's/.*\.//g'`; \
$(AWK) <$$d ' \
BEGIN { state=0 } \
$$1==".ds" && $$2=="xM" { print $$3; next } \
$$1==".ds" { ds["\\\\\\*\\("$$2] = $$3 } \
$$1==".SH" && $$2=="NAME" { state=1; next } \
$$1==".SH" && state==1 { exit } \
/^\./ { next } \
state==1 { for (i=1;i<=NF;i++) { \
if ($$i=="\\-" || $$i=="-") exit; \
gsub ("\\\\f3", "", $$i); gsub ("\\\\f1.*", "", $$i); \
for ( d in ds ) sub (d, ds[d], $$i); \
print $$i \
} \
}' \
| while read m; do \
[ -z "$$m" -o "$$m" = "\\" ] && continue; \
t=$(PCP_MAN_DIR)/man$$section/$$m.$$section; \
if $$first; then \
_tfx= ;\
if $(NEED_OLD_TBL_HEADER) ; then \
$(SED) -e "1s/^'\\\\\"! tbl.*/'\\\\\" t/" $$d > $$d.tmp; _tfx=.tmp; \
fi; \
if $(HAVE_GZIPPED_MANPAGES) ; then \
$(ZIP) -c $$d$$_tfx > $$d.gz; _tfx=.gz; _sfx=.gz; \
fi; \
if $(HAVE_BZIP2ED_MANPAGES) ; then \
$(BZIP2) -c $$d$$_tfx > $$d.bz2; _tfx=.bz2; _sfx=.bz2; \
fi; \
if $(HAVE_LZMAED_MANPAGES) ; then \
$(LZMA) -c $$d$$_tfx > $$d.lzma; _tfx=.lzma; _sfx=.lzma; \
fi; \
if $(HAVE_XZED_MANPAGES) ; then \
$(XZ) -c $$d$$_tfx > $$d.xz; _tfx=.xz; _sfx=.xz; \
fi; \
u=$$m.$$section$$_sfx; \
echo $(INSTALL) -m 644 $${d}$$_tfx $${t}$$_sfx; \
$(INSTALL) -m 644 $${d}$$_tfx $${t}$$_sfx; \
else \
echo $(INSTALL) -S $$u $${t}$$_sfx; \
$(INSTALL) -S $$u $${t}$$_sfx; \
fi; \
first=false; \
done; \
done; \
fi
endif
MANPAGE_SUFFIX = _sfx=.gz; \
$(HAVE_BZIP2ED_MANPAGES) && _sfx=.bz2; \
$(HAVE_LZMAED_MANPAGES) && _sfx=.lzma; \
$(HAVE_XZED_MANPAGES) && _sfx=.xz; \
PERL_INSTALL_BASE = /usr
PERL_INSTALLDIRS = vendor
# MakeMaker INSTALL_BASE needs to be unset for proper vendor_perl paths to be used for --prefix=/usr;
ifeq "$(PERL_INSTALL_BASE)" "/usr"
ifneq "$(TARGET_OS)" "darwin"
MAKEMAKER_EXTRA_OPTIONS=
else
MAKEMAKER_EXTRA_OPTIONS=INSTALL_BASE=$(PERL_INSTALL_BASE) INSTALLBASE=$(PERL_INSTALL_BASE)
endif
else
MAKEMAKER_EXTRA_OPTIONS=INSTALL_BASE=$(PERL_INSTALL_BASE) INSTALLBASE=$(PERL_INSTALL_BASE)
endif
PERL_MAKE_MAKEFILE = \
export PCP_TOPDIR="`cd $(TOPDIR) && pwd`"; \
TARGET_OS="$(TARGET_OS)" CC="$(CC) $(CFLAGS_ABI)" perl Makefile.PL $(MAKEMAKER_EXTRA_OPTIONS) $(MAKEMAKER_OPTIONS)
# Collect files from a Perl "make -f Makefile install" below
# src/perl to build the PCP Perl packaging list, and also clean up
# the installed files to remove unwanted files and make the DSO
# executable
#
# Usage is $(call PERL_GET_FILELIST,target,listfile,base)
# where target is the Makefile target (install or install_perl),
# listfile is something like $(TOPDIR)/perl-pcp-pmda.list and
# base is the DSO basename like PMDA.
#
# We need different versions for the different installation and
# packaging regimes.
#
ifeq "$(PACKAGE_DISTRIBUTION)" "debian"
# For Debian packaging, this is not needed
PERL_GET_FILELIST =
else
ifeq "$(PACKAGE_DISTRIBUTION)" "gentoo"
# Gentoo cannot rely on the .packlist files from the install, so create
# a temporary pack.list file
PERL_GET_FILELIST = \
$(PERLMAKE) -f Makefile $(1) DESTDIR="$$DIST_ROOT" \
| tee pack.list; \
sed -n -e '/\.bs$$/d' -e 's/\.[0-9]pm$$/&.gz/' -e "s@^Installing $$DIST_ROOT@@p"