summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-03-03 19:36:20 +0000
committergad <gad@FreeBSD.org>2004-03-03 19:36:20 +0000
commit631c9d292f70a4d4df8980327549da8730b9d523 (patch)
tree837452737e39df915146236521752e4cac4467de /Makefile.inc1
parent902e092d18e937bd398302e1ce5156f228194093 (diff)
downloadFreeBSD-src-631c9d292f70a4d4df8980327549da8730b9d523.zip
FreeBSD-src-631c9d292f70a4d4df8980327549da8730b9d523.tar.gz
Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually change anything. It merely provides instructions, scripts, and a safety measure in Makefile.inc1 for people who want to make the change. The real change to 64-bit time_t's on sparc64 is scheduled to happen on March 10th, assuming that so major problems are found between now and then by early-adopters. Reviewed by: freebsd-sparc64
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc166
1 files changed, 63 insertions, 3 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index b13602e..8e238e0 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -343,11 +343,70 @@ buildworld: ${WMAKE_TGTS}
.ORDER: ${WMAKE_TGTS}
#
+# Use this to add checks to installworld/installkernel targets.
+#
+SPECIAL_INSTALLCHECKS=
+
+#
+# The following install-time check will see if the installation will
+# change the type used for time_t, and if it will, the target makes
+# sure that the user is expecting to make that change.
+#
+.if ${TARGET_ARCH} == "sparc64"
+SPECIAL_INSTALLCHECKS+=sparc64_installcheck
+
+CUR_TIMETYPE!= grep __time_t /usr/include/machine/_types.h | awk '{print $$2}'
+SRC_TIMETYPE!= grep __time_t ${.CURDIR}/sys/sparc64/include/_types.h | awk '{print $$2}'
+NEWSPARC_TIMETYPE?=${CUR_TIMETYPE}
+THISHOST!= hostname -s
+.if ${THISHOST} == ""
+THISHOST="name not set yet"
+.endif
+
+sparc64_installcheck:
+.if ${CUR_TIMETYPE} != ${SRC_TIMETYPE}
+ @echo ""
+.if ${NEWSPARC_TIMETYPE} != ${SRC_TIMETYPE}
+ @echo "*** ERROR: This target would change the type used for time_t! ***"
+.else
+ @echo "* Note: This installation changes the type used for time_t"
+.endif
+ @echo "* "
+ @echo "* This host (${THISHOST}) presently has a time_t of type ${CUR_TIMETYPE},"
+ @echo "* and this installation will switch time_t to be type ${SRC_TIMETYPE}."
+.if ${NEWSPARC_TIMETYPE} != ${SRC_TIMETYPE}
+ @echo "* "
+ @echo "* If that is *NOT* what you wanted, then you need to change the"
+ @echo "* typedef for __time_t in: ${.CURDIR}/sys/sparc64/include/_types.h"
+ @echo "* from '${SRC_TIMETYPE}' to '${CUR_TIMETYPE}'. After that you *MUST* do a"
+ @echo "* complete cleanworld, buildworld, buildkernel before you retry"
+ @echo "* your 'make' command. Also read /usr/src/UPDATING.64BTT."
+ @echo "* "
+ @echo "* If that *is* what you want, then enter the commands:"
+ @echo " NEWSPARC_TIMETYPE=${SRC_TIMETYPE}"
+ @echo " export NEWSPARC_TIMETYPE"
+ @echo "* and repeat your 'make' command."
+ @echo ""
+ @false
+.endif
+ @echo ""
+.elif ${NEWSPARC_TIMETYPE} != ${SRC_TIMETYPE}
+ @echo ""
+ @echo "*** ERROR: The variable NEWSPARC_TIMETYPE is set to '${NEWSPARC_TIMETYPE}'"
+ @echo "*** but ${.CURDIR}/sys/sparc64/include/_types.h"
+ @echo "*** has __time_t defined as: '${SRC_TIMETYPE}'"
+ @false
+.else
+ @# in sparc64_installcheck, all TIMETYPEs == '${NEWSPARC_TIMETYPE}'
+.endif
+.endif
+
+#
# installcheck
#
# Checks to be sure system is ready for installworld
#
-installcheck:
+installcheck: ${SPECIAL_INSTALLCHECKS}
.if !defined(NO_SENDMAIL)
@if ! `id -u smmsp > /dev/null`; then \
echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
@@ -386,7 +445,7 @@ distributeworld installworld: installcheck
# and do a 'make reinstall' on the *client* to install new binaries from the
# most recent server build.
#
-reinstall:
+reinstall: ${SPECIAL_INSTALLCHECKS}
@echo "--------------------------------------------------------------"
@echo ">>> Making hierarchy"
@echo "--------------------------------------------------------------"
@@ -503,7 +562,8 @@ buildkernel:
#
# Install the kernel defined by INSTALLKERNEL
#
-installkernel reinstallkernel installkernel.debug reinstallkernel.debug:
+installkernel installkernel.debug \
+reinstallkernel reinstallkernel.debug: ${SPECIAL_INSTALLCHECKS}
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."
@false
OpenPOWER on IntegriCloud