From ad879ce9552cb94f4709c6e41a31a060d1c9c335 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 20 Nov 2000 02:17:34 +0000 Subject: [PATCH] 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 --- Makefile.inc1 | 29 ++++++++++++++++----------- gnu/usr.bin/perl/Makefile | 6 +----- gnu/usr.bin/perl/Makefile.inc | 2 +- gnu/usr.bin/perl/library/Makefile.inc | 2 +- gnu/usr.bin/perl/miniperl/Makefile | 2 -- gnu/usr.bin/perl/pod/Makefile.inc | 2 +- gnu/usr.bin/perl/utils/Makefile.inc | 2 +- gnu/usr.bin/perl/x2p/Makefile.inc | 2 +- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 70965b86f098..2a92102578de 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -172,7 +172,8 @@ CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ # bootstrap-tool stage BMAKEENV= ${BOOTSTRAPENV} -BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML +BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOHTML -DNOINFO \ + -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED # build-tool stage TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -183,8 +184,9 @@ TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 # cross-tool stage XMAKEENV= ${BOOTSTRAPENV} \ TARGET_ARCH=${MACHINE_ARCH} -XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \ - -DNO_FORTRAN -DNO_GDB +XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB \ + -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE \ + -DNOSHARED # world stage WMAKEENV= ${CROSSENV} \ @@ -298,7 +300,7 @@ everything: # installworld: mkdir -p ${INSTALLTMP} - for prog in [ awk cat chflags chown date echo egrep find grep \ + for prog in [ awk cat chflags chmod chown date echo egrep find grep \ install ln make makewhatis mtree mv perl rm sed sh sysctl \ test true uname wc zic; do \ cp `which $$prog` ${INSTALLTMP}; \ @@ -551,13 +553,9 @@ _libkrb5= kerberos5/lib/libroken kerberos5/lib/libasn1 kerberos5/lib/libhdb \ kerberos5/lib/libsl .endif -.if !defined(NOPERL) -_perl= gnu/usr.bin/perl -.endif - build-tools: .for _tool in bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \ - ${_libroken4} ${_libkrb5} lib/libncurses ${_share} ${_perl} + ${_libroken4} ${_libkrb5} lib/libncurses ${_share} cd ${.CURDIR}/${_tool}; ${MAKE} build-tools .endfor @@ -588,8 +586,12 @@ _btxld= usr.sbin/btxld _aout_tools= usr.bin/size usr.bin/strip gnu/usr.bin/as gnu/usr.bin/ld .endif +.if !defined(NOPERL) +_perl= gnu/usr.bin/perl/libperl gnu/usr.bin/perl/miniperl +.endif + cross-tools: -.for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} usr.bin/genassym \ +.for _tool in ${_aout_tools} ${_btxld} ${_elf2exe} ${_perl} usr.bin/genassym \ usr.bin/gensetdefs gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc cd ${.CURDIR}/${_tool}; \ ${MAKE} obj; \ @@ -745,13 +747,16 @@ _libm= lib/msun _libkeycap= usr.sbin/pcvt/keycap .endif +.if !defined(NOPERL) +_libperl= gnu/usr.bin/perl/libperl +.endif + libraries: .for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \ ${_secure_lib} ${_kerberosIV_lib} \ ${_kerberos5_lib} lib/libcom_err ${_libm} lib/libncurses \ lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \ - lib/libz lib gnu/lib \ - ${_libperl} usr.bin/lex/lib ${_libkeycap} + lib/libz lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap} .if exists(${.CURDIR}/${_lib}) cd ${.CURDIR}/${_lib}; \ ${MAKE} depend; \ diff --git a/gnu/usr.bin/perl/Makefile b/gnu/usr.bin/perl/Makefile index 3cce3ab02e1b..6770bae8779e 100644 --- a/gnu/usr.bin/perl/Makefile +++ b/gnu/usr.bin/perl/Makefile @@ -1,11 +1,7 @@ # $FreeBSD$ -SUBDIR= libperl miniperl perl suidperl library pod utils x2p +SUBDIR= libperl perl suidperl library pod utils x2p MAINTAINER=markm@freebsd.org -build-tools: - cd ${.CURDIR}/libperl && make build-tools - cd ${.CURDIR}/miniperl && make build-tools - .include diff --git a/gnu/usr.bin/perl/Makefile.inc b/gnu/usr.bin/perl/Makefile.inc index 26f7889c328e..88620eaafd19 100644 --- a/gnu/usr.bin/perl/Makefile.inc +++ b/gnu/usr.bin/perl/Makefile.inc @@ -2,7 +2,7 @@ PERL5SRC?= ${.CURDIR}/../../../../contrib/perl5 PERL5LIBSRC?= ${.CURDIR}/../libperl -MINIPERL?= ${.OBJDIR}/../miniperl/miniperl +MINIPERL?= miniperl BINDIR?= /usr/bin diff --git a/gnu/usr.bin/perl/library/Makefile.inc b/gnu/usr.bin/perl/library/Makefile.inc index e2aa8f1f40af..bde6f9a270cd 100644 --- a/gnu/usr.bin/perl/library/Makefile.inc +++ b/gnu/usr.bin/perl/library/Makefile.inc @@ -2,7 +2,7 @@ PERL5SRC?= ${.CURDIR}/../../../../../contrib/perl5 PERL5LIBSRC?= ${.CURDIR}/../../libperl -MINIPERL= ${.OBJDIR}/../../miniperl/miniperl +MINIPERL= miniperl MODULEDIR?= ${MODULE} diff --git a/gnu/usr.bin/perl/miniperl/Makefile b/gnu/usr.bin/perl/miniperl/Makefile index 62a1a8abf513..81d29c945e01 100644 --- a/gnu/usr.bin/perl/miniperl/Makefile +++ b/gnu/usr.bin/perl/miniperl/Makefile @@ -17,8 +17,6 @@ LDADD= ${MYLIBPERL} -lm -lcrypt -lutil build-tools: cleandepend cd ${.CURDIR} && ${MAKE} ${PROG} -install distribute: - NO_PERL_SCRIPT_MAKE= true .include diff --git a/gnu/usr.bin/perl/pod/Makefile.inc b/gnu/usr.bin/perl/pod/Makefile.inc index e4440c74a553..e03039083711 100644 --- a/gnu/usr.bin/perl/pod/Makefile.inc +++ b/gnu/usr.bin/perl/pod/Makefile.inc @@ -4,7 +4,7 @@ PERL5SRC?= ${.CURDIR}/../../../../../contrib/perl5 MINIPERLOPT?= -I${.OBJDIR}/../../perl/lib -I${.OBJDIR}/../../perl -MINIPERL= ${.OBJDIR}/../../miniperl/miniperl +MINIPERL= miniperl CLEANFILES+= ${PROG}.1 ${PROG}.PL diff --git a/gnu/usr.bin/perl/utils/Makefile.inc b/gnu/usr.bin/perl/utils/Makefile.inc index 6ab43e2c7fe1..726602bdd170 100644 --- a/gnu/usr.bin/perl/utils/Makefile.inc +++ b/gnu/usr.bin/perl/utils/Makefile.inc @@ -4,7 +4,7 @@ PERL5SRC= ${.CURDIR}/../../../../../contrib/perl5 PERL5LIBSRC= ${.CURDIR}/../../libperl -MINIPERL= ${.OBJDIR}/../../miniperl/miniperl +MINIPERL= miniperl .include "../Makefile.inc" diff --git a/gnu/usr.bin/perl/x2p/Makefile.inc b/gnu/usr.bin/perl/x2p/Makefile.inc index 96536145dbb7..b7a7fef028d6 100644 --- a/gnu/usr.bin/perl/x2p/Makefile.inc +++ b/gnu/usr.bin/perl/x2p/Makefile.inc @@ -5,7 +5,7 @@ PERL5SRC= ${.CURDIR}/../../../../../contrib/perl5 PERL5LIBSRC= ${.CURDIR}/../../libperl MINIPERLOPT?= -I${.OBJDIR}/../../perl/lib -I${.OBJDIR}/../../perl -MINIPERL= ${.OBJDIR}/../../miniperl/miniperl +MINIPERL= miniperl LDFLAGS+= -L${.OBJDIR}/../../libperl