opnsense-src/gnu/usr.bin/perl/library/Makefile.inc
Marcel Moolenaar ad879ce955 Fix cross-building.
o  Move building libperl and miniperl from build-tools to
   cross-tools. libperl uses MACHINE_ARCH to determine the
   right configuration, which doesn't match the build
   machine when cross-building if they are built as build-
   tools.
o  Since miniperl needs to be built as a cross-tool, it
   needs to be installed under /usr/obj so that it can be
   used (cross-tools have a special object directory to
   avoid build conflicts. As a downside, you can't easily
   run cross-tools from their object directory). Remove
   the install and distribute override targets. To avoid
   having miniperl installed by installworld, remove it
   from SUBDIR.
o  We can't pickup miniperl from the object directory but
   since it's installed, depend on PATH. This is save,
   because the makefiles are run with a known path.
o  Build libperl again as part of the library target. A
   _libperl variable existed, but it was never defined.
o  Add chmod to the list of saved tools, because perl
   conditionally uses it during install.

The bootstrap-tools and cross-tools targets are modified to
avoid building profiled and shared libraries. While here,
have these targets build static binaries instead of shared
binaries.

Approved by: markm
2000-11-20 02:17:34 +00:00

44 lines
1.2 KiB
Makefile

# $FreeBSD$
PERL5SRC?= ${.CURDIR}/../../../../../contrib/perl5
PERL5LIBSRC?= ${.CURDIR}/../../libperl
MINIPERL= miniperl
MODULEDIR?= ${MODULE}
MAKEMAKER_ARGS= INSTALLDIRS=perl PERL_SRC=${.OBJDIR} \
INSTALLMAN3DIR=${DESTDIR}/usr/share/perl/man3 \
PERL=${MINIPERL} FULLPERL=perl DEFINE=-I${DESTDIR}/usr/include \
DEFINE=-DPERL_CORE
CFLAGS+= -L${.OBJDIR}/../../libperl
all: lib/auto/${MODULE}.so
.include "../Makefile.inc"
lib/auto/${MODULE}.so: ext/${MODULEDIR}/Makefile ${DYNALOADER}
@cd ext/${MODULEDIR}; \
make -B all PERL_SRC=${.OBJDIR}
ext/${MODULEDIR}/Makefile: scripts
@cd ext/${MODULEDIR}; \
${MINIPERL} -I${.OBJDIR}/lib Makefile.PL ${MAKEMAKER_ARGS} \
LINKTYPE=dynamic LIBS="-lperl -lm" \
INST_LIB=${.OBJDIR}/build/${MODULEDIR} \
INST_ARCHLIB=${.OBJDIR}/build/${MODULEDIR}; \
make -B config PERL_SRC=${.OBJDIR}
install:
@cd ${.OBJDIR}/ext/${MODULEDIR} ;\
make -B install \
INSTALLPRIVLIB=${DESTDIR}/usr/libdata/perl/${VERSION} \
INSTALLARCHLIB=${DESTDIR}/usr/libdata/perl/${VERSION}/mach
distribute:
@cd ${.OBJDIR}/ext/${MODULEDIR} ;\
make -B install DESTDIR=${DISTDIR}/${dist} SHARED=copies \
INSTALLPRIVLIB=${DESTDIR}/usr/libdata/perl/${VERSION} \
INSTALLARCHLIB=${DESTDIR}/usr/libdata/perl/${VERSION}/mach
.PATH: ${PERL5SRC}