Date: Wed, 3 Aug 2005 14:25:18 +0200 From: Jeremie Le Hen <jeremie@le-hen.org> To: Alexander Leidinger <netchild@FreeBSD.org> Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, ru@FreeBSD.org, "M. Warner Losh" <imp@bsdimp.com>, des@des.no, grehan@FreeBSD.org Subject: Re: cvs commit: src Makefile.inc1 ObsoleteFiles.inc src/share/man/man7 build.7 Message-ID: <20050803122517.GH45385@obiwan.tataz.chchile.org> In-Reply-To: <20050803113208.GG45385@obiwan.tataz.chchile.org> References: <20050731102343.35bc4aa9@Magellan.Leidinger.net> <20050802090717.GK14023@ip.net.ua> <20050802140536.zstn68rcgsg84g0w@netchild.homeip.net> <20050802.085239.34568854.imp@bsdimp.com> <20050803121150.gn025733y8400wk8@netchild.homeip.net> <20050803113208.GG45385@obiwan.tataz.chchile.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mandatory_target_arch.diff" 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 --Yylu36WmvOXNoKYn--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050803122517.GH45385>