See one comment inline.

On Thu, May 26, 2016 at 09:59:24AM -0600, Todd C. Miller wrote:
> Since /usr/bin/cpp still specified -traditional, use ${CC} -E
> instead.  I've had this rotting in my tree for years now.
> 
>  - todd
> 
> Index: lib/libcurses/Makefile
> ===================================================================
> RCS file: /cvs/src/lib/libcurses/Makefile,v
> retrieving revision 1.67
> diff -u -p -u -r1.67 Makefile
> --- lib/libcurses/Makefile    30 Mar 2016 06:38:42 -0000      1.67
> +++ lib/libcurses/Makefile    26 May 2016 15:38:57 -0000
> @@ -118,7 +118,7 @@ fallback.c: ${.CURDIR}/tinfo/MKfallback.
>       sh ${.CURDIR}/tinfo/MKfallback.sh $(FALLBACK_LIST) > ${.TARGET}
>  
>  lib_gen.c: ${.CURDIR}/base/MKlib_gen.sh
> -     sh ${.CURDIR}/base/MKlib_gen.sh "${CPP} -I${.CURDIR}" \
> +     sh ${.CURDIR}/base/MKlib_gen.sh "${CC} -E -I${.CURDIR}" \
>               "${AWK}" generated < ${.CURDIR}/curses.h > lib_gen.c
>  
>  init_keytry.h: make_keys keys.list
> @@ -135,7 +135,7 @@ make_hash: ${.CURDIR}/tinfo/comp_hash.c 
>  
>  expanded.c: ${.CURDIR}/term.h ${.CURDIR}/curses.priv.h \
>               ${.CURDIR}/ncurses_cfg.h ${.CURDIR}/tty/MKexpanded.sh
> -     sh ${.CURDIR}/tty/MKexpanded.sh "${CPP}" ${CPPFLAGS} > ${.TARGET}
> +     sh ${.CURDIR}/tty/MKexpanded.sh "${CC} -E" ${CPPFLAGS} > ${.TARGET}
>  
>  comp_captab.c: make_hash
>       sh ${.CURDIR}/tinfo/MKcaptab.sh ${AWK} 1 \
> Index: share/locale/ctype/Makefile
> ===================================================================
> RCS file: /cvs/src/share/locale/ctype/Makefile,v
> retrieving revision 1.11
> diff -u -p -u -r1.11 Makefile
> --- share/locale/ctype/Makefile       20 Mar 2016 15:45:40 -0000      1.11
> +++ share/locale/ctype/Makefile       23 Mar 2016 20:16:56 -0000
> @@ -9,8 +9,7 @@ NOMAN=        # defined
>  all: UTF-8.out
>  
>  UTF-8.out: en_US.UTF-8.src
> -     ${CPP} < ${.CURDIR}/en_US.UTF-8.src | \
> -         sed -e '/^#/d' | mklocale -o ${.TARGET}
> +     ${CC} -E -P - < ${.CURDIR}/en_US.UTF-8.src | mklocale -o ${.TARGET}

I think cpp can be dropped here. As far as I can tell it is only used to
remove the comments, which mklocale can do by itself. The output stays
the same with just this:

        mklocale -o ${.TARGET} ${.CURDIR}/en_US.UTF-8.src


>  
>  CLEANFILES+= UTF-8.out
>  
> Index: usr.bin/which/Makefile
> ===================================================================
> RCS file: /cvs/src/usr.bin/which/Makefile,v
> retrieving revision 1.8
> diff -u -p -u -r1.8 Makefile
> --- usr.bin/which/Makefile    15 Apr 2013 16:34:19 -0000      1.8
> +++ usr.bin/which/Makefile    3 Dec 2013 23:48:18 -0000
> @@ -7,7 +7,7 @@ LINKS=        ${BINDIR}/which ${BINDIR}/whereis
>  check_path_in_man:
>       @echo "Checking path expansion in whereis.1"; \
>       stdpath=`printf '#include <paths.h>\n_PATH_STDPATH\n' | \
> -     ${CPP} ${CPPFLAGS} - | \
> +     ${CC} -E -P ${CPPFLAGS} - | \
>       sed -n 's/^[    ]*"\(.*\)".*/.D1 \1/p'` ; \
>       fgrep -xq "$$stdpath" ${.CURDIR}/whereis.1 && { touch $@; exit 0; }; \
>       echo "Update the expansion of _PATH_STDPATH in ${.CURDIR}/whereis.1"; \
> 

Reply via email to