From 38fdaecd10a60cf3772deb0a4f6863796e159571 Mon Sep 17 00:00:00 2001 From: John Marino Date: Sun, 21 Oct 2012 11:08:28 +0200 Subject: [PATCH] gcc4X man pages: Introduce generic MLINK handling A few months ago, the MLINK handling for binutils was updated to make it easier to switch the primary version. For binutils, every manpage has a suffix based on the binutils version and the "real" man page is linked to the primary version. The two base compilers had the same organization, but the manual system was not converted when binutils system was. When gcc47 was brought in, the manual organization wasn't implemented correctly and the gcc47 pages ended up getting linked to the "real" man page instead of the primary compiler gcc44. While fixing this, bring in the binutils MLINK handling to prepare for switching gcc47 to the primary compiler in the future. --- gnu/usr.bin/Makefile.cco | 21 ++++++++++++++++++++ gnu/usr.bin/cc44/Makefile.inc | 2 -- gnu/usr.bin/cc44/Makefile.langs | 2 ++ gnu/usr.bin/cc44/c++/Makefile | 16 +++++++++------- gnu/usr.bin/cc44/cc/Makefile | 34 +++++++++++++++++---------------- gnu/usr.bin/cc44/cpp/Makefile | 17 +++++++++-------- gnu/usr.bin/cc44/doc/Makefile | 5 +---- gnu/usr.bin/cc44/gcov/Makefile | 17 +++++++++-------- gnu/usr.bin/cc47/Makefile.inc | 3 --- gnu/usr.bin/cc47/Makefile.langs | 2 ++ gnu/usr.bin/cc47/c++/Makefile | 17 ++++++++++------- gnu/usr.bin/cc47/cc/Makefile | 34 +++++++++++++++++---------------- gnu/usr.bin/cc47/cpp/Makefile | 17 +++++++++-------- gnu/usr.bin/cc47/doc/Makefile | 5 +---- gnu/usr.bin/cc47/gcov/Makefile | 17 +++++++++-------- 15 files changed, 118 insertions(+), 91 deletions(-) create mode 100644 gnu/usr.bin/Makefile.cco diff --git a/gnu/usr.bin/Makefile.cco b/gnu/usr.bin/Makefile.cco new file mode 100644 index 0000000000..815a2db91c --- /dev/null +++ b/gnu/usr.bin/Makefile.cco @@ -0,0 +1,21 @@ +# DragonFly maintains two sets of compilers. +# In order to keep man page generation simple when the primary compiler +# changes, this makefile will direct the makefile that included it how +# to name the man pages and if it should hardlink a generic man page to it. +# The same approach is used for the two sets of binutils + +CC_PRIMARY= gcc44 +CC_BACKUP= gcc47 + +.if defined(COMPVERSION) +.if (${COMPVERSION} == ${CC_PRIMARY}) +IS_PRIMARY= 1 +MANPAGEVER= 44 +.else +.endif + +.if (${COMPVERSION} == ${CC_BACKUP}) +MANPAGEVER= 47 +.else +.endif +.endif diff --git a/gnu/usr.bin/cc44/Makefile.inc b/gnu/usr.bin/cc44/Makefile.inc index b1f622bc6b..406044e685 100644 --- a/gnu/usr.bin/cc44/Makefile.inc +++ b/gnu/usr.bin/cc44/Makefile.inc @@ -6,8 +6,6 @@ GCCDATESTAMP= 2012.03.13 GCCPOINTVER= ${GCCCOMPLETEVER:R} GCCSHORTVER= ${GCCPOINTVER:S/.//} -GCCDOCSUFFIX= ${GCCSHORTVER} - CSTD?= gnu89 CFLAGS+= -DGCCPOINTVER=\"${GCCPOINTVER}\" diff --git a/gnu/usr.bin/cc44/Makefile.langs b/gnu/usr.bin/cc44/Makefile.langs index 7b2b137aa7..e1f56eeecd 100644 --- a/gnu/usr.bin/cc44/Makefile.langs +++ b/gnu/usr.bin/cc44/Makefile.langs @@ -1,5 +1,7 @@ .include "Makefile.inc" +COMPVERSION= gcc44 + .if !defined(NO_CXX) lang_tree_files= cp/cp-tree.def .endif diff --git a/gnu/usr.bin/cc44/c++/Makefile b/gnu/usr.bin/cc44/c++/Makefile index d0ce03465d..00116e7a42 100644 --- a/gnu/usr.bin/cc44/c++/Makefile +++ b/gnu/usr.bin/cc44/c++/Makefile @@ -2,24 +2,26 @@ GCC_LANG_DIR= gcc/cp .include "../Makefile.inc" .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= c++ LINKS= ${BINDIR}/c++ ${BINDIR}/g++ LINKS+= ${BINDIR}/c++ ${BINDIR}/CC -MAN= g++${GCCSHORTVER}.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS= g++${GCCSHORTVER}.1 g++${GCCDOCSUFFIX}.1 -.endif +MFILE= g++${MANPAGEVER}.1 +MAN= ${MFILE} SRCS= ${GCC_SRCS} g++spec.c intl.c prefix.c version.c SRCS+= ${EXTRA_GCC_SRCS} CFLAGS+= -DGCC_DRIVER -g++${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/g++.1 +${MFILE}: ${GCCDIR}/gcc/doc/g++.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= g++${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} g++.1 +.endif .include diff --git a/gnu/usr.bin/cc44/cc/Makefile b/gnu/usr.bin/cc44/cc/Makefile index 3a8f0f7129..975294ba7b 100644 --- a/gnu/usr.bin/cc44/cc/Makefile +++ b/gnu/usr.bin/cc44/cc/Makefile @@ -1,31 +1,33 @@ .include "../Makefile.inc" .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= cc LINKS= ${BINDIR}/cc ${BINDIR}/gcc -MAN= gcc${GCCSHORTVER}.1 -MLINKS= gcc${GCCSHORTVER}.1 cc.1 \ - gcc${GCCSHORTVER}.1 c++.1 \ - gcc${GCCSHORTVER}.1 g++.1 \ - gcc${GCCSHORTVER}.1 gcc.1 \ - gcc${GCCSHORTVER}.1 CC.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS+=gcc${GCCSHORTVER}.1 cc${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 c++${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 g++${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 gcc${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 CC${GCCDOCSUFFIX}.1 -.endif +MFILE= gcc${MANPAGEVER}.1 +MAN= ${MFILE} SRCS= ${GCC_SRCS} gccspec.c intl.c prefix.c version.c SRCS+= ${EXTRA_GCC_SRCS} CFLAGS+= -DGCC_DRIVER -gcc${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/gcc.1 +${MFILE}: ${GCCDIR}/gcc/doc/gcc.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= gcc${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +MLINKS+= ${MFILE} cc${MANPAGEVER}.1 +MLINKS+= ${MFILE} CC${MANPAGEVER}.1 +MLINKS+= ${MFILE} c++${MANPAGEVER}.1 +MLINKS+= ${MFILE} g++${MANPAGEVER}.1 + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} cc.1 +MLINKS+= ${MFILE} CC.1 +MLINKS+= ${MFILE} gcc.1 +MLINKS+= ${MFILE} c++.1 +MLINKS+= ${MFILE} g++.1 +.endif .include diff --git a/gnu/usr.bin/cc44/cpp/Makefile b/gnu/usr.bin/cc44/cpp/Makefile index fbe2f10a88..e96e380af7 100644 --- a/gnu/usr.bin/cc44/cpp/Makefile +++ b/gnu/usr.bin/cc44/cpp/Makefile @@ -1,22 +1,23 @@ .include "../Makefile.inc" .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= cpp -MAN= cpp${GCCSHORTVER}.1 -MLINKS= cpp${GCCSHORTVER}.1 cpp.1 - -.if ${GCCSHORTVER} != ${GCCDOCSUFFIX} -MLINKS+=cpp${GCCSHORTVER}.1 cpp${GCCDOCSUFFIX}.1 -.endif +MFILE= cpp${GCCSHORTVER}.1 +MAN= ${MFILE} SRCS= ${GCC_SRCS} cppspec.c intl.c prefix.c version.c SRCS+= ${EXTRA_GCC_SRCS} CFLAGS+= -DGCC_DRIVER -cpp${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/cpp.1 +${MFILE}: ${GCCDIR}/gcc/doc/cpp.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= cpp${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} cpp.1 +.endif .include diff --git a/gnu/usr.bin/cc44/doc/Makefile b/gnu/usr.bin/cc44/doc/Makefile index 43b99e6164..5348364ef8 100644 --- a/gnu/usr.bin/cc44/doc/Makefile +++ b/gnu/usr.bin/cc44/doc/Makefile @@ -15,7 +15,7 @@ INFOENTRY_gcint= "* GCC-internals. The GNU Compiler Collection's internals." # Install as nameVER for the time being .for _i in ${ORIGINFO} -.for docsfx in ${GCCSHORTVER} ${GCCDOCSUFFIX} +.for docsfx in ${GCCSHORTVER} .if empty(INFO:M${_i}${docsfx}) INFO+= ${_i}${docsfx} INFOENTRY_${_i}${docsfx}= ${INFOENTRY_${_i}:C/\./${docsfx}./1} @@ -30,9 +30,6 @@ CLEANFILES+= ${_i}${docsufx}.info .endfor .endfor # End magic rewriting -.if ${GCCDOCSUFFIX} == "" -INFO+= ${ORIGINFO} -.endif cpp.info: cpp.texi fdl.texi cppenv.texi cppopts.texi \ gcc-common.texi gcc-vers.texi diff --git a/gnu/usr.bin/cc44/gcov/Makefile b/gnu/usr.bin/cc44/gcov/Makefile index 1cbd18c03a..774e35c7c7 100644 --- a/gnu/usr.bin/cc44/gcov/Makefile +++ b/gnu/usr.bin/cc44/gcov/Makefile @@ -1,19 +1,20 @@ .include "../Makefile.inc" .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= gcov -MAN= gcov${GCCSHORTVER}.1 -MLINKS= gcov${GCCSHORTVER}.1 gcov.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS+=gcov${GCCSHORTVER}.1 gcov${GCCDOCSUFFIX}.1 -.endif +MFILE= gcov${GCCSHORTVER}.1 +MAN= ${MFILE} SRCS= gcov.c intl.c errors.c version.c -gcov${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/gcov.1 +${MFILE}: ${GCCDIR}/gcc/doc/gcov.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= gcov${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} gcov.1 +.endif .include diff --git a/gnu/usr.bin/cc47/Makefile.inc b/gnu/usr.bin/cc47/Makefile.inc index 966d674fd4..cc8275cc1c 100644 --- a/gnu/usr.bin/cc47/Makefile.inc +++ b/gnu/usr.bin/cc47/Makefile.inc @@ -6,9 +6,6 @@ GCCDATESTAMP= 2012-09-20 GCCPOINTVER= ${GCCCOMPLETEVER:R} GCCSHORTVER= ${GCCPOINTVER:S/.//} -GCCDOCSUFFIX= ${GCCSHORTVER} - - CFLAGS+= -DGCCPOINTVER=\"${GCCPOINTVER}\" CFLAGS+= -DGCCSHORTVER=\"${GCCSHORTVER}\" CFLAGS+= -DBASEVER=\"${GCCCOMPLETEVER}\" diff --git a/gnu/usr.bin/cc47/Makefile.langs b/gnu/usr.bin/cc47/Makefile.langs index 8cef1d1bcc..0ed188b7b4 100644 --- a/gnu/usr.bin/cc47/Makefile.langs +++ b/gnu/usr.bin/cc47/Makefile.langs @@ -1,5 +1,7 @@ .include "Makefile.inc" +COMPVERSION= gcc47 + .if !defined(NO_CXX) lang_tree_files+= cp/cp-tree.def .endif diff --git a/gnu/usr.bin/cc47/c++/Makefile b/gnu/usr.bin/cc47/c++/Makefile index 83e607f6d2..cc71758faf 100644 --- a/gnu/usr.bin/cc47/c++/Makefile +++ b/gnu/usr.bin/cc47/c++/Makefile @@ -1,14 +1,13 @@ GCC_LANG_DIR= gcc/cp .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= c++ +MFILE= g++${MANPAGEVER}.1 +MAN= ${MFILE} + LINKS= ${BINDIR}/c++ ${BINDIR}/g++ LINKS+= ${BINDIR}/c++ ${BINDIR}/CC -MAN= g++${GCCSHORTVER}.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS= g++${GCCSHORTVER}.1 g++${GCCDOCSUFFIX}.1 -.endif OBJS+= ${GCC_SRCS:S/^/..\/cc\//:.c=.o} OBJS+= ${EXTRA_GCC_SRCS:S/^/..\/cc\//:.c=.o} @@ -16,9 +15,13 @@ SRCS= g++spec.c CFLAGS+= -DCONFIGURE_SPECS="\"\"" -g++${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/g++.1 +${MFILE}: ${GCCDIR}/gcc/doc/g++.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= g++${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} g++.1 +.endif .include diff --git a/gnu/usr.bin/cc47/cc/Makefile b/gnu/usr.bin/cc47/cc/Makefile index fe401718d0..7b9667b9d0 100644 --- a/gnu/usr.bin/cc47/cc/Makefile +++ b/gnu/usr.bin/cc47/cc/Makefile @@ -1,30 +1,32 @@ .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= cc LINKS= ${BINDIR}/cc ${BINDIR}/gcc -MAN= gcc${GCCSHORTVER}.1 -MLINKS= gcc${GCCSHORTVER}.1 cc.1 \ - gcc${GCCSHORTVER}.1 c++.1 \ - gcc${GCCSHORTVER}.1 g++.1 \ - gcc${GCCSHORTVER}.1 gcc.1 \ - gcc${GCCSHORTVER}.1 CC.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS+=gcc${GCCSHORTVER}.1 cc${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 c++${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 g++${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 gcc${GCCDOCSUFFIX}.1 -MLINKS+=gcc${GCCSHORTVER}.1 CC${GCCDOCSUFFIX}.1 -.endif +MFILE= gcc${MANPAGEVER}.1 +MAN= ${MFILE} SRCS= ${GCC_SRCS} gccspec.c SRCS+= ${EXTRA_GCC_SRCS} CFLAGS+= -DCONFIGURE_SPECS="\"\"" -gcc${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/gcc.1 +${MFILE}: ${GCCDIR}/gcc/doc/gcc.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= gcc${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +MLINKS+= ${MFILE} cc${MANPAGEVER}.1 +MLINKS+= ${MFILE} CC${MANPAGEVER}.1 +MLINKS+= ${MFILE} c++${MANPAGEVER}.1 +MLINKS+= ${MFILE} g++${MANPAGEVER}.1 + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} cc.1 +MLINKS+= ${MFILE} CC.1 +MLINKS+= ${MFILE} gcc.1 +MLINKS+= ${MFILE} c++.1 +MLINKS+= ${MFILE} g++.1 +.endif .include diff --git a/gnu/usr.bin/cc47/cpp/Makefile b/gnu/usr.bin/cc47/cpp/Makefile index cf012d4d20..abf6bf1e88 100644 --- a/gnu/usr.bin/cc47/cpp/Makefile +++ b/gnu/usr.bin/cc47/cpp/Makefile @@ -1,13 +1,10 @@ .include "../Makefile.inc" .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= cpp -MAN= cpp${GCCSHORTVER}.1 -MLINKS= cpp${GCCSHORTVER}.1 cpp.1 - -.if ${GCCSHORTVER} != ${GCCDOCSUFFIX} -MLINKS+=cpp${GCCSHORTVER}.1 cpp${GCCDOCSUFFIX}.1 -.endif +MFILE= cpp${MANPAGEVER}.1 +MAN= ${MFILE} OBJS+= ${GCC_SRCS:S/^/..\/cc\//:.c=.o} OBJS+= ${EXTRA_GCC_SRCS:S/^/..\/cc\//:.c=.o} @@ -15,9 +12,13 @@ SRCS= cppspec.c CFLAGS+= -DCONFIGURE_SPECS="\"\"" -cpp${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/cpp.1 +${MFILE}: ${GCCDIR}/gcc/doc/cpp.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= cpp${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} cpp.1 +.endif .include diff --git a/gnu/usr.bin/cc47/doc/Makefile b/gnu/usr.bin/cc47/doc/Makefile index 5ebec27ea2..0baabee35f 100644 --- a/gnu/usr.bin/cc47/doc/Makefile +++ b/gnu/usr.bin/cc47/doc/Makefile @@ -15,7 +15,7 @@ INFOENTRY_gcint= "* GCC-internals. The GNU Compiler Collection's internals." # Install as nameVER for the time being .for _i in ${ORIGINFO} -.for docsfx in ${GCCSHORTVER} ${GCCDOCSUFFIX} +.for docsfx in ${GCCSHORTVER} .if empty(INFO:M${_i}${docsfx}) INFO+= ${_i}${docsfx} INFOENTRY_${_i}${docsfx}= ${INFOENTRY_${_i}:C/\./${docsfx}./1} @@ -30,9 +30,6 @@ CLEANFILES+= ${_i}${docsufx}.info .endfor .endfor # End magic rewriting -.if ${GCCDOCSUFFIX} == "" -INFO+= ${ORIGINFO} -.endif cpp.info: cpp.texi fdl.texi cppenv.texi cppopts.texi \ gcc-common.texi gcc-vers.texi diff --git a/gnu/usr.bin/cc47/gcov/Makefile b/gnu/usr.bin/cc47/gcov/Makefile index 71b22a50ef..c063d3b548 100644 --- a/gnu/usr.bin/cc47/gcov/Makefile +++ b/gnu/usr.bin/cc47/gcov/Makefile @@ -1,18 +1,19 @@ .include "../Makefile.langs" +.include "../../Makefile.cco" PROG= gcov -MAN= gcov${GCCSHORTVER}.1 -MLINKS= gcov${GCCSHORTVER}.1 gcov.1 - -.if ${GCCDOCSUFFIX} != ${GCCSHORTVER} -MLINKS+=gcov${GCCSHORTVER}.1 gcov${GCCDOCSUFFIX}.1 -.endif +MFILE= gcov${MANPAGEVER}.1 +MAN= ${MFILE} SRCS= gcov.c -gcov${GCCSHORTVER}.1: ${GCCDIR}/gcc/doc/gcov.1 +${MFILE}: ${GCCDIR}/gcc/doc/gcov.1 cp ${.ALLSRC} ${.TARGET} -CLEANFILES+= gcov${GCCSHORTVER}.1 +CLEANFILES+= ${MFILE} + +.if defined(IS_PRIMARY) +MLINKS+= ${MFILE} gcov.1 +.endif .include -- 2.41.0