summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc191
-rw-r--r--gnu/usr.bin/perl/Makefile18
-rw-r--r--gnu/usr.bin/perl/Makefile.inc7
-rw-r--r--gnu/usr.bin/perl/libperl/Makefile3
-rw-r--r--gnu/usr.bin/perl/library/Makefile.inc1
-rw-r--r--gnu/usr.bin/perl/miniperl/Makefile31
-rw-r--r--gnu/usr.bin/perl/pod/Makefile.inc1
-rw-r--r--gnu/usr.bin/perl/x2p/Makefile.inc1
-rw-r--r--secure/lib/libtelnet/Makefile14
-rw-r--r--share/mk/bsd.lib.mk2
10 files changed, 68 insertions, 101 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 9c36143..24ca96c 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -20,7 +20,7 @@
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
-# MACHINE_ARCH="machine arch" to crossbuild world to a different arch
+# TARGET_ARCH="arch" to crossbuild world to a different arch
#
# The intended user-driven targets are:
@@ -121,13 +121,18 @@ SUPFLAGS+= -h ${SUPHOST}
MAKEOBJDIRPREFIX?= /usr/obj
TARGET_ARCH?= ${MACHINE_ARCH}
+.if make(buildworld)
BUILD_ARCH!= sysctl -n hw.machine_arch
-.if ${BUILD_ARCH} == ${MACHINE_ARCH}
+.if ${MACHINE_ARCH} != ${BUILD_ARCH}
+.error To cross-build, set TARGET_ARCH.
+.endif
+.endif
+.if ${MACHINE_ARCH} == ${TARGET_ARCH}
OBJTREE= ${MAKEOBJDIRPREFIX}
.else
-OBJTREE= ${MAKEOBJDIRPREFIX}/${MACHINE_ARCH}
+OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET_ARCH}
.endif
-WORLDTMP= ${OBJTREE}${.CURDIR}/${BUILD_ARCH}
+WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
# /usr/games added for fortune which depend on strfile
STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
TMPPATH= ${STRICTTMPPATH}:${PATH}
@@ -158,42 +163,34 @@ INSTALLTMP= ${TMPDIR}/install.${TMPPID}
# This stage installs a previously built world.
#
-# Common environment for bootstrap related stages
-BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
- DESTDIR=${WORLDTMP} \
- INSTALL="sh ${.CURDIR}/tools/install.sh" \
- MACHINE_ARCH=${BUILD_ARCH} \
- TOOLS_PREFIX=${WORLDTMP} \
- PATH=${TMPPATH}
-
# Common environment for world related stages
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
+ MACHINE_ARCH=${TARGET_ARCH} \
COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
CFLAGS="-nostdinc ${CFLAGS}" \
+ CXXINCLUDES="-nostdinc++ ${CXXINCLUDES}" \
PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.0 \
GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
# bootstrap-tool stage
-BMAKEENV= ${BOOTSTRAPENV}
+BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
+ DESTDIR= \
+ INSTALL="sh ${.CURDIR}/tools/install.sh"
BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
# build-tool stage
TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
- INSTALL="sh ${.CURDIR}/tools/install.sh" \
- PATH=${TMPPATH}
+ DESTDIR= \
+ INSTALL="sh ${.CURDIR}/tools/install.sh"
TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
# cross-tool stage
-XMAKEENV= ${BOOTSTRAPENV} \
- TARGET_ARCH=${MACHINE_ARCH}
-XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
- -DNO_FORTRAN -DNO_GDB -DNOHTML -DNOINFO -DNOMAN \
- -DNOPIC -DNOPROFILE -DNOSHARED
+XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
# world stage
WMAKEENV= ${CROSSENV} \
@@ -246,13 +243,6 @@ buildworld:
@echo "--------------------------------------------------------------"
.if !defined(NOCLEAN)
rm -rf ${WORLDTMP}
-.else
- for dir in bin games include lib sbin share; do \
- rm -rf ${WORLDTMP}/usr/$$dir; \
- done
- # XXX - Work-around for broken cc/cc_tools/Makefile.
- # This is beyond dirty...
- rm -f ${OBJTREE}${.CURDIR}/gnu/usr.bin/cc/cc_tools/.depend
.endif
.for _dir in ${USRDIRS}
mkdir -p ${WORLDTMP}/${_dir}
@@ -271,13 +261,13 @@ buildworld:
@echo "--------------------------------------------------------------"
@echo ">>> stage 2: cleaning up the object tree"
@echo "--------------------------------------------------------------"
- cd ${.CURDIR}; ${TMAKE} ${CLEANDIR:S/^/par-/}
+ cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
.endif
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2: rebuilding the object tree"
@echo "--------------------------------------------------------------"
- cd ${.CURDIR}; ${TMAKE} par-obj
+ cd ${.CURDIR}; ${WMAKE} par-obj
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2: build tools"
@@ -324,7 +314,7 @@ installworld:
mkdir -p ${INSTALLTMP}
for prog in [ awk cat chflags chmod chown date echo egrep find grep \
ln make makewhatis mkdir mtree mv perl rm sed sh sysctl \
- test true uname wc which zic; do \
+ test true uname wc zic; do \
cp `which $$prog` ${INSTALLTMP}; \
done
cd ${.CURDIR}; ${IMAKE} reinstall
@@ -373,8 +363,8 @@ distribworld:
# for building kernels and only the first of these is designated
# as the one being installed.
#
-# Note that we have to use MACHINE instead of MACHINE_ARCH when
-# we're in kernel-land. Since only MACHINE_ARCH is (expected) to
+# Note that we have to use MACHINE instead of TARGET_ARCH when
+# we're in kernel-land. Since only TARGET_ARCH is (expected) to
# be set to cross-build, we have to make sure MACHINE is set
# properly.
@@ -386,11 +376,11 @@ KERNCONF?= GENERIC
.endif
INSTKERNNAME?= kernel
-# The only exotic MACHINE_ARCH/MACHINE combination valid at this
+# The only exotic TARGET_ARCH/MACHINE combination valid at this
# time is i386/pc98. In all other cases set MACHINE equal to
-# MACHINE_ARCH.
-.if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98"
-MACHINE= ${MACHINE_ARCH}
+# TARGET_ARCH.
+.if ${TARGET_ARCH} != "i386" || ${MACHINE} != "pc98"
+MACHINE= ${TARGET_ARCH}
.endif
KRNLSRCDIR= ${.CURDIR}/sys
@@ -572,7 +562,7 @@ bootstrap-tools:
${MAKE} obj; \
${MAKE} depend; \
${MAKE} all; \
- ${MAKE} install
+ ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor
#
@@ -590,6 +580,10 @@ _share= share/syscons/scrnmaps
_fortran= gnu/usr.bin/cc/f771
.endif
+.if !defined(NOPERL)
+_perl= gnu/usr.bin/perl/miniperl
+.endif
+
.if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
!defined(NOCRYPT) && defined(MAKE_KERBEROS4)
_libroken4= kerberosIV/lib/libroken
@@ -602,7 +596,7 @@ _libkrb5= kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
build-tools:
.for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
- ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file \
+ ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file \
usr.sbin/sysinstall
cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
.endfor
@@ -610,17 +604,6 @@ build-tools:
#
# cross-tools: Build cross-building tools
#
-# WARNING: Because the bootstrap tools are expected to run on the
-# build-machine, MACHINE_ARCH is *always* set to BUILD_ARCH when this
-# target is being made. TARGET_ARCH is *always* set to reflect the
-# target-machine (which you can set by specifying MACHINE_ARCH on
-# make's command-line, get it?).
-# The reason is simple: we build these tools not to be run on the
-# architecture we're cross-building, but on the architecture we're
-# currently building on (ie the host-machine) and we expect these
-# tools to produce output for the architecture we're trying to
-# cross-build.
-#
.if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
_elf2exe= usr.sbin/elf2exe
.endif
@@ -629,18 +612,14 @@ _elf2exe= usr.sbin/elf2exe
_btxld= usr.sbin/btxld
.endif
-.if !defined(NOPERL)
-_perl= gnu/usr.bin/perl/libperl gnu/usr.bin/perl/miniperl
-.endif
-
cross-tools:
-.for _tool in ${_btxld} ${_elf2exe} ${_perl} \
+.for _tool in ${_btxld} ${_elf2exe} \
gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
cd ${.CURDIR}/${_tool}; \
${MAKE} obj; \
${MAKE} depend; \
${MAKE} all; \
- ${MAKE} install
+ ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor
#
@@ -677,6 +656,8 @@ includes:
cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
+.elif exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
+ cd ${.CURDIR}/secure/lib/libtelnet; ${MAKE} beforeinstall
.else
cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
.endif
diff --git a/gnu/usr.bin/perl/Makefile b/gnu/usr.bin/perl/Makefile
index fa1f636..b532310 100644
--- a/gnu/usr.bin/perl/Makefile
+++ b/gnu/usr.bin/perl/Makefile
@@ -1,23 +1,7 @@
# $FreeBSD$
-.ifmake !install && !distribute
-_MINI= miniperl
-.endif
-
-SUBDIR= libperl ${_MINI} perl suidperl library pod utils x2p BSDPAN
+SUBDIR= libperl miniperl perl suidperl library pod utils x2p BSDPAN
MAINTAINER=markm@freebsd.org
-.BEGIN:
-.ifmake depend || all
- if [ \! -f ${.OBJDIR}/build-tools ] ; then \
- cd ${.CURDIR}/libperl && ${MAKE} depend && ${MAKE} all ; \
- cd ${.CURDIR}/miniperl && ${MAKE} depend && ${MAKE} all ; \
- touch ${.OBJDIR}/build-tools ; \
- fi
-.endif
-.ifmake cleandir || clean
- @rm -f ${.OBJDIR}/build-tools
-.endif
-
.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/perl/Makefile.inc b/gnu/usr.bin/perl/Makefile.inc
index 91e979c..91628f4 100644
--- a/gnu/usr.bin/perl/Makefile.inc
+++ b/gnu/usr.bin/perl/Makefile.inc
@@ -2,7 +2,12 @@
PERL5SRC?= ${.CURDIR}/../../../../contrib/perl5
PERL5LIBSRC?= ${.CURDIR}/../libperl
-MINIPERL!= echo `PATH=$$PATH:${.OBJDIR}/../miniperl:${.OBJDIR}/../../miniperl which miniperl`
+
+.if exists(${.OBJDIR}/../miniperl/miniperl)
+MINIPERL?= ${.OBJDIR}/../miniperl/miniperl
+.else
+MINIPERL?= ${.OBJDIR}/../../miniperl/miniperl
+.endif
BINDIR?= /usr/bin
diff --git a/gnu/usr.bin/perl/libperl/Makefile b/gnu/usr.bin/perl/libperl/Makefile
index 824ce61..55fb87a 100644
--- a/gnu/usr.bin/perl/libperl/Makefile
+++ b/gnu/usr.bin/perl/libperl/Makefile
@@ -19,9 +19,6 @@ NO_PERL_SCRIPT_MAKE= true
.include <bsd.lib.mk>
-build-tools: cleandepend
- cd ${.CURDIR} && ${MAKE} lib${LIB}.a
-
config.h: links
@sh config_h.sh
diff --git a/gnu/usr.bin/perl/library/Makefile.inc b/gnu/usr.bin/perl/library/Makefile.inc
index b339f00..6835a0a 100644
--- a/gnu/usr.bin/perl/library/Makefile.inc
+++ b/gnu/usr.bin/perl/library/Makefile.inc
@@ -2,7 +2,6 @@
PERL5SRC?= ${.CURDIR}/../../../../../contrib/perl5
PERL5LIBSRC?= ${.CURDIR}/../../libperl
-MINIPERL= miniperl
MODULEDIR?= ${MODULE}
diff --git a/gnu/usr.bin/perl/miniperl/Makefile b/gnu/usr.bin/perl/miniperl/Makefile
index cdc8bc1..9856964 100644
--- a/gnu/usr.bin/perl/miniperl/Makefile
+++ b/gnu/usr.bin/perl/miniperl/Makefile
@@ -2,20 +2,20 @@
PROG= miniperl
NOMAN= true
-CFLAGS+=-I${PERL5SRC} -I${.OBJDIR} -DPERL_EXTERNAL_GLOB
-SRCS= miniperlmain.c opmini.c config.h
+SRCS= miniperlmain.c
+SRCS+= perl.c gv.c toke.c perly.c op.c regcomp.c dump.c util.c mg.c \
+ hv.c av.c run.c pp_hot.c sv.c pp.c scope.c pp_ctl.c pp_sys.c \
+ doop.c doio.c regexec.c utf8.c taint.c universal.c \
+ xsutils.c globals.c perlio.c config.h
+CFLAGS+=-I${.OBJDIR} -I${PERL5SRC} -DPERL_EXTERNAL_GLOB -DPERL_CORE
+DPADD= ${LIBM} ${LIBCRYPT}
+LDADD= -lm -lcrypt
# Miniperl _must_ be static!!
NOSHARED= yes
-.if exists(${.OBJDIR}/../libperl/)
-MYLIBPERL= ${.OBJDIR}/../libperl/libperl.a
-.else
-MYLIBPERL= ${.CURDIR}/../libperl/libperl.a
-.endif
-DPADD= ${MYLIBPERL} ${LIBM} ${LIBCRYPT}
-LDADD= ${MYLIBPERL} -lm -lcrypt
-build-tools: cleandepend
- cd ${.CURDIR} && ${MAKE} ${PROG}
+build-tools: depend ${PROG}
+
+install:
NO_PERL_SCRIPT_MAKE= true
@@ -23,10 +23,9 @@ NO_PERL_SCRIPT_MAKE= true
.PATH: ${PERL5SRC}
-opmini.c: op.c
- ln -sf ${.OODATE} ${.TARGET}
-
-config.h: links
+config.h: links
@sh config_h.sh
-CLEANFILES+= opmini.c config.h
+.SUFFIXES:
+
+.SUFFIXES: .o .po .So .s .S .c
diff --git a/gnu/usr.bin/perl/pod/Makefile.inc b/gnu/usr.bin/perl/pod/Makefile.inc
index e030390..1e3cbfe 100644
--- a/gnu/usr.bin/perl/pod/Makefile.inc
+++ b/gnu/usr.bin/perl/pod/Makefile.inc
@@ -4,7 +4,6 @@
PERL5SRC?= ${.CURDIR}/../../../../../contrib/perl5
MINIPERLOPT?= -I${.OBJDIR}/../../perl/lib -I${.OBJDIR}/../../perl
-MINIPERL= miniperl
CLEANFILES+= ${PROG}.1 ${PROG}.PL
diff --git a/gnu/usr.bin/perl/x2p/Makefile.inc b/gnu/usr.bin/perl/x2p/Makefile.inc
index b7a7fef..7f8371c 100644
--- a/gnu/usr.bin/perl/x2p/Makefile.inc
+++ b/gnu/usr.bin/perl/x2p/Makefile.inc
@@ -5,7 +5,6 @@
PERL5SRC= ${.CURDIR}/../../../../../contrib/perl5
PERL5LIBSRC= ${.CURDIR}/../../libperl
MINIPERLOPT?= -I${.OBJDIR}/../../perl/lib -I${.OBJDIR}/../../perl
-MINIPERL= miniperl
LDFLAGS+= -L${.OBJDIR}/../../libperl
diff --git a/secure/lib/libtelnet/Makefile b/secure/lib/libtelnet/Makefile
index daf1e81..c229e6b 100644
--- a/secure/lib/libtelnet/Makefile
+++ b/secure/lib/libtelnet/Makefile
@@ -15,14 +15,18 @@ CFLAGS+= -DHAS_CGETENT -DENCRYPTION -DDES_ENCRYPTION -DAUTHENTICATION \
INCS= ${TELNETDIR}/arpa/telnet.h
INCDIR= /usr/include/arpa
+.include <bsd.lib.mk>
+
+.PATH: ${TELNETDIR}/libtelnet
+
#
# Remove obsolete shared libraries, if any. We don't bother moving them
# to /usr/lib/compat, since they were only used by telnet, telnetd and
# tn3270.
#
-beforeinstall:
+beforeinstall: __remove-stale-libs
+__remove-stale-libs: .PHONY
+.if exists(${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0)
+ -chflags noschg ${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0
rm -f ${DESTDIR}${SHLIBDIR}/lib${LIB}.so.2.0
-
-.include <bsd.lib.mk>
-
-.PATH: ${TELNETDIR}/libtelnet
+.endif
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index ffe529a..3920b28 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -196,7 +196,7 @@ lib${LIB}_p.a:: ${POBJS}
${RANLIB} lib${LIB}_p.a
.endif
-.if defined(DESTDIR)
+.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
LDDESTDIRENV?= LIBRARY_PATH=${DESTDIR}${SHLIBDIR}:${DESTDIR}${LIBDIR}
.endif
OpenPOWER on IntegriCloud