GCCVER rename

Joerg Sonnenberger joerg at britannica.bec.de
Thu Jan 22 15:20:47 PST 2004


Hi all,
if noone objects, I'll commit the attached patch tomorrow.
It renames GCCVER to CCVER and prepends gcc to the current
values. This is a more appropiate naming and allows us to
more easily choose the system compiler.

Joerg
Index: contrib/gcc/gcc.c
===================================================================
RCS file: /cvs/src/contrib/gcc/gcc.c,v
retrieving revision 1.3
diff -u -r1.3 gcc.c
--- contrib/gcc/gcc.c	16 Jan 2004 07:45:19 -0000	1.3
+++ contrib/gcc/gcc.c	22 Jan 2004 23:10:01 -0000
@@ -1396,8 +1396,8 @@
 static const char *standard_startfile_prefix_1 = "/lib/";
 static const char *standard_startfile_prefix_2 = "/usr/lib/";
 
-#ifndef GCCVER
-#error GCCVER not defined
+#ifndef CCVER
+#error CCVER not defined
 #endif
 
 #ifndef TOOLDIR_BASE_PREFIX
@@ -3131,17 +3131,17 @@
   /* Use 2 as fourth arg meaning try just the machine as a suffix,
      as well as trying the machine and the version.  */
 #ifdef FREEBSD_NATIVE
-  add_prefix (&exec_prefixes, PREFIX"/libexec/gcc" GCCVER "/", "BINUTILS",
+  add_prefix (&exec_prefixes, PREFIX"/libexec/" CCVER "/", "BINUTILS",
 	      0, 0, NULL_PTR);
   switch (objformat)
     {
     case OBJFMT_AOUT:
       n_switches++;		/* add implied -maout */
-      add_prefix (&exec_prefixes, PREFIX"/libexec/gcc" GCCVER "/aout/", "BINUTILS",
+      add_prefix (&exec_prefixes, PREFIX"/libexec/" CCVER "/aout/", "BINUTILS",
 		  0, 0, NULL_PTR);
       break;
     case OBJFMT_ELF:
-      add_prefix (&exec_prefixes, PREFIX"/libexec/gcc" GCCVER "/elf/", "BINUTILS",
+      add_prefix (&exec_prefixes, PREFIX"/libexec/" CCVER "/elf/", "BINUTILS",
 		  0, 0, NULL_PTR);
       break;
     case OBJFMT_UNKNOWN:
Index: contrib/gcc3/gcc.c
===================================================================
RCS file: /cvs/src/contrib/gcc3/gcc.c,v
retrieving revision 1.2
diff -u -r1.2 gcc.c
--- contrib/gcc3/gcc.c	20 Jan 2004 19:31:18 -0000	1.2
+++ contrib/gcc3/gcc.c	22 Jan 2004 23:10:09 -0000
@@ -1338,9 +1338,9 @@
 static const char *const standard_startfile_prefix_1 = "/lib/";
 static const char *const standard_startfile_prefix_2 = "/usr/lib/";
 
-#ifndef GCCVER
+#ifndef CCVER
 
-#error GCCVER not defined
+#error CCVER not defined
 
 #endif
 
@@ -3676,7 +3676,7 @@
   /* Use 2 as fourth arg meaning try just the machine as a suffix,
      as well as trying the machine and the version.  */
 #ifdef FREEBSD_NATIVE
-      add_prefix (&exec_prefixes, PREFIX"/bin" GCCVER "/", "BINUTILS",
+      add_prefix (&exec_prefixes, PREFIX"/bin" CCVER "/", "BINUTILS",
 		  PREFIX_PRIORITY_LAST, 0, warn_std_ptr, 0);
 #endif	/* FREEBSD_NATIVE */
 #ifndef OS2
Index: gnu/lib/gcc2/Makefile.inc
===================================================================
RCS file: /cvs/src/gnu/lib/gcc2/Makefile.inc,v
retrieving revision 1.1
diff -u -r1.1 Makefile.inc
--- gnu/lib/gcc2/Makefile.inc	16 Jan 2004 07:45:19 -0000	1.1
+++ gnu/lib/gcc2/Makefile.inc	22 Jan 2004 23:10:30 -0000
@@ -2,4 +2,4 @@
 #
 
 USEGNUDIR=YES
-GCCVER=2
+CCVER=gcc2
Index: gnu/lib/gcc3/Makefile.inc
===================================================================
RCS file: /cvs/src/gnu/lib/gcc3/Makefile.inc,v
retrieving revision 1.1
diff -u -r1.1 Makefile.inc
--- gnu/lib/gcc3/Makefile.inc	21 Jan 2004 20:21:58 -0000	1.1
+++ gnu/lib/gcc3/Makefile.inc	22 Jan 2004 23:10:30 -0000
@@ -2,4 +2,4 @@
 #
 
 USEGNUDIR=YES
-GCCVER=3
+CCVER=gcc3
Index: gnu/usr.bin/cc/c++/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc/c++/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- gnu/usr.bin/cc/c++/Makefile	16 Jan 2004 07:45:21 -0000	1.3
+++ gnu/usr.bin/cc/c++/Makefile	22 Jan 2004 23:10:31 -0000
@@ -13,7 +13,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc/cc/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc/cc/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- gnu/usr.bin/cc/cc/Makefile	16 Jan 2004 07:45:21 -0000	1.3
+++ gnu/usr.bin/cc/cc/Makefile	22 Jan 2004 23:10:31 -0000
@@ -15,7 +15,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc/cpp/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc/cpp/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- gnu/usr.bin/cc/cpp/Makefile	16 Jan 2004 07:45:22 -0000	1.3
+++ gnu/usr.bin/cc/cpp/Makefile	22 Jan 2004 23:10:31 -0000
@@ -11,7 +11,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc/f77/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc/f77/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- gnu/usr.bin/cc/f77/Makefile	16 Jan 2004 07:45:22 -0000	1.3
+++ gnu/usr.bin/cc/f77/Makefile	22 Jan 2004 23:10:31 -0000
@@ -10,7 +10,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD=	${LIBCC_INT}
 LDADD=	${LIBCC_INT}
Index: gnu/usr.bin/cc3/c++/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc3/c++/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- gnu/usr.bin/cc3/c++/Makefile	17 Jan 2004 23:05:19 -0000	1.2
+++ gnu/usr.bin/cc3/c++/Makefile	22 Jan 2004 23:10:31 -0000
@@ -14,7 +14,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc3/cc/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc3/cc/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- gnu/usr.bin/cc3/cc/Makefile	17 Jan 2004 23:05:19 -0000	1.2
+++ gnu/usr.bin/cc3/cc/Makefile	22 Jan 2004 23:10:31 -0000
@@ -16,7 +16,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc3/cpp/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc3/cpp/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- gnu/usr.bin/cc3/cpp/Makefile	17 Jan 2004 23:05:20 -0000	1.2
+++ gnu/usr.bin/cc3/cpp/Makefile	22 Jan 2004 23:10:31 -0000
@@ -11,7 +11,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 
 DPADD+=	${LIBCC_INT}
 LDADD+=	${LIBCC_INT}
Index: gnu/usr.bin/cc3/f77/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc3/f77/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- gnu/usr.bin/cc3/f77/Makefile	17 Jan 2004 23:05:20 -0000	1.2
+++ gnu/usr.bin/cc3/f77/Makefile	22 Jan 2004 23:10:31 -0000
@@ -11,7 +11,7 @@
 
 CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
 CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
-CFLAGS+= -DGCCVER=\"$(GCCVER)\"
+CFLAGS+= -DCCVER=\"$(CCVER)\"
 CFLAGS+= -DFORTRAN_INIT=\"-lg2c\" -DFORTRAN_INIT_PROFILE=\"-lg2c_p\"
 
 DPADD=	${LIBCC_INT}
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /cvs/src/share/mk/bsd.own.mk,v
retrieving revision 1.3
diff -u -r1.3 bsd.own.mk
--- share/mk/bsd.own.mk	16 Jan 2004 07:45:19 -0000	1.3
+++ share/mk/bsd.own.mk	22 Jan 2004 23:10:46 -0000
@@ -38,9 +38,9 @@
 #
 # BINMODE	Binary mode. [555]
 #
-# GCCVER	Default gcc version
-# GCCLIBDIR	Default gcc subdirectory [${LIBDIR}/gcc${GCCVER}]
-# GCCSHLIBDIR	Default gcc subdirectory [${SHLIBDIR}/gcc${GCCVER}]
+# CCVER		Default compiler version
+# GCCLIBDIR	Default gcc subdirectory [${LIBDIR}/${CCVER}]
+# GCCSHLIBDIR	Default gcc subdirectory [${SHLIBDIR}/${CCVER}]
 #
 # NOBINMODE	Mode for non-executable files. [444]
 #
@@ -135,18 +135,18 @@
 KMODGRP?=	${BINGRP}
 KMODMODE?=	${BINMODE}
 
-GCCVER?=	2
+CCVER?=	gcc2
 .if ${OBJFORMAT} == aout
 LIBDIR?=	/usr/lib/aout
 .else
 LIBDIR?=	/usr/lib
 .endif
-GCCLIBDIR?=	${LIBDIR}/gcc${GCCVER}
+GCCLIBDIR?=	${LIBDIR}/${CCVER}
 LIBCOMPATDIR?=	/usr/lib/compat
 LIBDATADIR?=	/usr/libdata
 LINTLIBDIR?=	/usr/libdata/lint
 SHLIBDIR?=	${LIBDIR}
-GCCSHLIBDIR?=	${SHLIBDIR}/gcc${GCCVER}
+GCCSHLIBDIR?=	${SHLIBDIR}/${CCVER}
 LIBOWN?=	${BINOWN}
 LIBGRP?=	${BINGRP}
 LIBMODE?=	${NOBINMODE}
Index: usr.bin/objformat/objformat.c
===================================================================
RCS file: /cvs/src/usr.bin/objformat/objformat.c,v
retrieving revision 1.3
diff -u -r1.3 objformat.c
--- usr.bin/objformat/objformat.c	16 Jan 2004 07:45:22 -0000	1.3
+++ usr.bin/objformat/objformat.c	22 Jan 2004 23:10:50 -0000
@@ -41,7 +41,7 @@
 	char *path, *chunk;
 	char *cmd, *newcmd = NULL;
 	char *objformat_path;
-	char *gccver;
+	char *ccver;
 	char *dirprefix;
 	char *dirpostfix;
 
@@ -88,15 +88,13 @@
 	}
 
 	/*
-	 * make buildweorld glue and GCCVER overrides.
+	 * make buildworld glue and CCVER overrides.
 	 */
 	objformat_path = getenv("OBJFORMAT_PATH");
 	if (objformat_path == NULL)
 		objformat_path = "";
-	if ((gccver = getenv("GCCVER")) == NULL) {
-		gccver = "gcc2";
-	} else if (gccver[0] >= '0' && gccver[0] <= '9') {
-	    asprintf(&gccver, "gcc%s", gccver);
+	if ((ccver = getenv("CCVER")) == NULL) {
+		ccver = "gcc2";
 	}
 	path = strdup(objformat_path);
 
@@ -111,7 +109,7 @@
 			newcmd = NULL;
 		}
 		asprintf(&newcmd, "%s%s/%s%s/%s",
-			chunk, dirprefix, gccver, dirpostfix, cmd);
+			chunk, dirprefix, ccver, dirpostfix, cmd);
 		if (newcmd == NULL)
 			err(1, "cannot allocate memory");
 
@@ -119,6 +117,6 @@
 		execv(newcmd, argv);
 	}
 	err(1, "in path [%s]%s/%s%s/%s",
-		objformat_path, dirprefix, gccver, dirpostfix, cmd);
+		objformat_path, dirprefix, ccver, dirpostfix, cmd);
 }
 




More information about the Submit mailing list