Augment the upgrade_etc target to remove stale compiler-related binaries
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 16 Jan 2004 09:11:10 +0000 (09:11 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 16 Jan 2004 09:11:10 +0000 (09:11 +0000)
and data files if it detects that the gcc upgrade has occured from a
recent installworld.

etc/Makefile

index 252c88c..25f7cc9 100644 (file)
@@ -1,6 +1,6 @@
 #      from: @(#)Makefile      5.11 (Berkeley) 5/21/91
 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $
-# $DragonFly: src/etc/Makefile,v 1.8 2004/01/09 20:25:13 drhodus Exp $
+# $DragonFly: src/etc/Makefile,v 1.9 2004/01/16 09:11:10 dillon Exp $
 
 .if !defined(NO_SENDMAIL)
 SUBDIR=        sendmail
@@ -95,6 +95,20 @@ upgrade_etc:
 .if !defined(NOMAN)
        cd ${.CURDIR}/../share/man; ${MAKE} makedb
 .endif
+.if exists(${DESTDIR}/usr/libexec/gcc2/cc1)
+       ldconfig -m ${DESTDIR}/usr/lib/gcc2
+       rm -rf ${DESTDIR}/usr/libdata/ldscripts
+       rm -rf ${DESTDIR}/usr/libexec/elf
+       csh -c "rm -f ${DESTDIR}/usr/libexec/{cc1,cc1obj,cc1plus,cpp,cpp0}"
+       csh -c "rm -f ${DESTDIR}/usr/libexec/{f771,objformat}"
+       csh -c "rm -f ${DESTDIR}/usr/lib/{crtbegin.o,crtbeginS.o,crtend.o}"
+       csh -c "rm -f ${DESTDIR}/usr/lib/{crtendS.o,libgcc.a,libgcc_p.a}"
+       csh -c "rm -f ${DESTDIR}/usr/lib/{libobjc.a,libobjc_p.a,libstdc++.a}"
+       csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++.so,libstdc++.so.3}"
+       csh -c "rm -f ${DESTDIR}/usr/lib/{libstdc++_p.a}"
+       csh -c "rm -f ${DESTDIR}/usr/bin/CC"
+       ldconfig -R
+.endif
 
 distribution:
        cd ${.CURDIR}; \