cvs commit: src Makefile.inc1 ObsoleteFiles.inc src/share/man/man7 build.7

Jeremie Le Hen jeremie at le-hen.org
Wed Aug 3 12:25:09 GMT 2005


Hi,

> What about making TARGET_ARCH mandatory if DESTDIR is different from "/" ?

The attached patch should work.

Regards,
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >
-------------- next part --------------
Index: Makefile.inc1
===================================================================
RCS file: /donald/repo/FreeBSD/src/Makefile.inc1,v
retrieving revision 1.506
diff -u -p -u -r1.506 Makefile.inc1
--- Makefile.inc1	30 Jul 2005 18:02:20 -0000	1.506
+++ Makefile.inc1	3 Aug 2005 12:22:47 -0000
@@ -103,6 +103,9 @@ OSRELDATE!=	awk '/^\#define[[:space:]]*_
 OSRELDATE=	0
 .endif
 .endif
+.if defined(TARGET_ARCH)
+_TARGET_ARCH_0=	${TARGET_ARCH}
+.endif
 TARGET_ARCH?=	${MACHINE_ARCH}
 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
 TARGET?=	${MACHINE}
@@ -1070,10 +1073,14 @@ RM_I=-i
 RM_I=-v
 .endif
 
-delete-old-files:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
+_safe_delete:
+.if defined(DESTDIR) && !defined(_TARGET_ARCH_0)
+	@echo "Please explicitely define TARGET_ARCH when DESTDIR is defined"
+	@echo "and you want to check/delete old files, libs or dirs."
+	@false
 .endif
+
+delete-old-files: _safe_delete
 	@echo ">>> Removing old files (only deletes safe to delete libs)"
 .for file in ${OLD_FILES}
 # Ask for every old file if the user really wants to remove it.
@@ -1086,19 +1093,13 @@ delete-old-files:
 .endfor
 	@echo ">>> Old files removed"
 
-check-old-files:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
-.endif
+check-old-files: _safe_delete
 	@echo ">>> Checking for old files"
 .for file in ${OLD_FILES}
 	@[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}"
 .endfor
 
-delete-old-libs:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
-.endif
+delete-old-libs: _safe_delete
 	@echo ">>> Removing old libraries"
 	@echo "${OLD_LIBS_MESSAGE}" | fmt
 .for file in ${OLD_LIBS}
@@ -1110,19 +1111,13 @@ delete-old-libs:
 .endfor
 	@echo ">>> Old libraries removed"
 
-check-old-libs:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
-.endif
+check-old-libs: _safe_delete
 	@echo ">>> Checking for old libraries"
 .for file in ${OLD_LIBS}
 	@[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}"
 .endfor
 
-delete-old-dirs:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
-.endif
+delete-old-dirs: _safe_delete
 	@echo ">>> Removing old directories"
 .for dir in ${OLD_DIRS}
 # Don't fail if an old directory isn't empty.
@@ -1130,10 +1125,7 @@ delete-old-dirs:
 .endfor
 	@echo ">>> Old directories removed"
 
-check-old-dirs:
-.if ${TARGET_ARCH} != ${MACHINE_ARCH}
-	@echo "You have to run this in a native environment!" && false
-.endif
+check-old-dirs: _safe_delete
 	@echo ">>> Checking for old directories"
 .for dir in ${OLD_DIRS}
 	@[ ! -d "${DESTDIR}/${dir}" ] || echo "${DESTDIR}/${dir}"
Index: ObsoleteFiles.inc
===================================================================
RCS file: /donald/repo/FreeBSD/src/ObsoleteFiles.inc,v
retrieving revision 1.7
diff -u -p -u -r1.7 ObsoleteFiles.inc
--- ObsoleteFiles.inc	30 Jul 2005 18:04:17 -0000	1.7
+++ ObsoleteFiles.inc	3 Aug 2005 12:20:55 -0000
@@ -223,7 +223,7 @@ OLD_FILES+=usr/share/man/man1/sasc.1.gz
 OLD_FILES+=usr/share/man/man1/sgsc.1.gz
 OLD_FILES+=usr/share/man/man4/i386/stl.4.gz
 OLD_FILES+=usr/share/man/man8/raidctl.8.gz
-.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "sparc64"
+.if ${TARGET_ARCH} != "alpha" && ${TARGET_ARCH} != "sparc64"
 # 20040130: libkse renamed to libpthread
 OLD_FILES+=usr/lib/libkse.a
 OLD_FILES+=usr/lib/libkse.so
@@ -636,7 +636,7 @@ OLD_LIBS+=usr/lib/libpcap.so.2
 OLD_LIBS+=usr/lib/libisc.so.1
 # 200408XX
 OLD_LIBS+=usr/lib/snmp_netgraph.so.1
-.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "sparc64"
+.if ${TARGET_ARCH} != "alpha" && ${TARGET_ARCH} != "sparc64"
 # 20040130: libkse renamed to libpthread
 OLD_LIBS+=usr/lib/libkse.so.1
 .endif


More information about the cvs-src mailing list