diff options
Diffstat (limited to 'Makefile.inc1')
-rw-r--r-- | Makefile.inc1 | 66 |
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 |