Tue Aug 15 15:54:06 2017 UTC ()
Fix a problem with MAKE_VERSION being undefined on case-insentive filesystems.

On case-insensitive filesystems such as MacOS, two files (Makefile and makefile,
which is created by configure from makefile.in) collide.  Only the former
defines MAKE_VERSION, but it is replaced by the latter.  Consequently,
MAKE_VERSION is defined as an empty string on these systems.  This patch is
the result of a discussion on tech-pkg (see the thread following
http://mail-index.netbsd.org/tech-pkg/2017/08/13/msg018629.html) and is
based upon code incorporated into bmake v20170812.


(brook)
diff -r1.7 -r1.8 pkgsrc/devel/bmake/files/FILES
diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/Makefile
diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/bsd.after-import.mk
diff -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/Makefile.config.in
diff -r0 -r1.1 pkgsrc/devel/bmake/files/VERSION
diff -r1.15 -r1.16 pkgsrc/devel/bmake/files/configure
diff -r1.13 -r1.14 pkgsrc/devel/bmake/files/configure.in
diff -r1.5 -r1.6 pkgsrc/devel/bmake/files/make-bootstrap.sh.in

cvs diff -r1.7 -r1.8 pkgsrc/devel/bmake/files/FILES (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/FILES 2015/05/19 22:01:19 1.7
+++ pkgsrc/devel/bmake/files/FILES 2017/08/15 15:54:06 1.8
@@ -1,20 +1,21 @@ @@ -1,20 +1,21 @@
1ChangeLog 1ChangeLog
2FILES 2FILES
3Makefile 3Makefile
4Makefile.config.in 4Makefile.config.in
5PSD.doc/Makefile 5PSD.doc/Makefile
6PSD.doc/tutorial.ms 6PSD.doc/tutorial.ms
7README 7README
 8VERSION
8aclocal.m4 9aclocal.m4
9arch.c 10arch.c
10bmake.1 11bmake.1
11bmake.cat1 12bmake.cat1
12boot-strap 13boot-strap
13bsd.after-import.mk 14bsd.after-import.mk
14buf.c 15buf.c
15buf.h 16buf.h
16compat.c 17compat.c
17cond.c 18cond.c
18config.h.in 19config.h.in
19configure 20configure
20configure.in 21configure.in

cvs diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/Makefile 2015/05/19 22:01:19 1.2
+++ pkgsrc/devel/bmake/files/Makefile 2017/08/15 15:54:06 1.3
@@ -1,17 +1,14 @@ @@ -1,17 +1,14 @@
1# $Id: Makefile,v 1.2 2015/05/19 22:01:19 joerg Exp $ 1# $Id: Makefile,v 1.3 2017/08/15 15:54:06 brook Exp $
2 
3# Base version on src date 
4MAKE_VERSION= 20150505 
5 2
6PROG= bmake 3PROG= bmake
7 4
8SRCS= \ 5SRCS= \
9 arch.c \ 6 arch.c \
10 buf.c \ 7 buf.c \
11 compat.c \ 8 compat.c \
12 cond.c \ 9 cond.c \
13 dir.c \ 10 dir.c \
14 for.c \ 11 for.c \
15 hash.c \ 12 hash.c \
16 job.c \ 13 job.c \
17 main.c \ 14 main.c \
@@ -47,26 +44,28 @@ SRCS+= \ @@ -47,26 +44,28 @@ SRCS+= \
47 lstInit.c \ 44 lstInit.c \
48 lstInsert.c \ 45 lstInsert.c \
49 lstIsAtEnd.c \ 46 lstIsAtEnd.c \
50 lstIsEmpty.c \ 47 lstIsEmpty.c \
51 lstLast.c \ 48 lstLast.c \
52 lstMember.c \ 49 lstMember.c \
53 lstNext.c \ 50 lstNext.c \
54 lstOpen.c \ 51 lstOpen.c \
55 lstPrev.c \ 52 lstPrev.c \
56 lstRemove.c \ 53 lstRemove.c \
57 lstReplace.c \ 54 lstReplace.c \
58 lstSucc.c 55 lstSucc.c
59 56
 57.-include "VERSION"
 58
60# this file gets generated by configure 59# this file gets generated by configure
61.-include "Makefile.config" 60.-include "Makefile.config"
62 61
63.if !empty(LIBOBJS) 62.if !empty(LIBOBJS)
64SRCS+= ${LIBOBJS:T:.o=.c} 63SRCS+= ${LIBOBJS:T:.o=.c}
65.endif 64.endif
66 65
67# just in case 66# just in case
68prefix?= /usr 67prefix?= /usr
69srcdir?= ${.CURDIR} 68srcdir?= ${.CURDIR}
70 69
71DEFAULT_SYS_PATH?= ${prefix}/share/mk 70DEFAULT_SYS_PATH?= ${prefix}/share/mk
72 71

cvs diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/bsd.after-import.mk (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/bsd.after-import.mk 2015/05/19 22:01:19 1.2
+++ pkgsrc/devel/bmake/files/bsd.after-import.mk 2017/08/15 15:54:06 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $Id: bsd.after-import.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $ 1# $Id: bsd.after-import.mk,v 1.3 2017/08/15 15:54:06 brook Exp $
2 2
3# This makefile is for use when integrating bmake into a BSD build 3# This makefile is for use when integrating bmake into a BSD build
4# system. Use this makefile after importing bmake. 4# system. Use this makefile after importing bmake.
5# It will bootstrap the new version, 5# It will bootstrap the new version,
6# capture the generated files we need, and add an after-import 6# capture the generated files we need, and add an after-import
7# target to allow the process to be easily repeated. 7# target to allow the process to be easily repeated.
8 8
9# The goal is to allow the benefits of autoconf without 9# The goal is to allow the benefits of autoconf without
10# the overhead of running configure. 10# the overhead of running configure.
11 11
12all: _makefile 12all: _makefile
13all: after-import 13all: after-import
14 14
@@ -46,26 +46,27 @@ BOOTSTRAP_ARGS = \ @@ -46,26 +46,27 @@ BOOTSTRAP_ARGS = \
46 --share /usr/share 46 --share /usr/share
47 47
48.if !empty(DEFAULT_SYS_PATH) 48.if !empty(DEFAULT_SYS_PATH)
49BOOTSTRAP_ARGS += --with-default-sys-path='${DEFAULT_SYS_PATH}' 49BOOTSTRAP_ARGS += --with-default-sys-path='${DEFAULT_SYS_PATH}'
50.endif 50.endif
51 51
52# run boot-strap with minimal influence 52# run boot-strap with minimal influence
53bootstrap: ${BMAKE_SRC}/boot-strap ${MAKEFILE} 53bootstrap: ${BMAKE_SRC}/boot-strap ${MAKEFILE}
54 HOME=/ ${BMAKE_SRC}/boot-strap -o ${HOST_OS} ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS} 54 HOME=/ ${BMAKE_SRC}/boot-strap -o ${HOST_OS} ${BOOTSTRAP_ARGS} ${BOOTSTRAP_XTRAS}
55 touch ${.TARGET} 55 touch ${.TARGET}
56 56
57# Makefiles need a little more tweaking than say config.h 57# Makefiles need a little more tweaking than say config.h
58MAKEFILE_SED = sed -e '/^MACHINE/d' \ 58MAKEFILE_SED = sed -e '/^MACHINE/d' \
 59 -e '/include.*VERSION/d' \
59 -e '/^PROG/ { s,=,?=,;s,bmake,$${.CURDIR:T},; }' \ 60 -e '/^PROG/ { s,=,?=,;s,bmake,$${.CURDIR:T},; }' \
60 -e 's,^.-include,.sinclude,' \ 61 -e 's,^.-include,.sinclude,' \
61 -e '/^\..*include *</ { s,<,<bsd.,;/autoconf/d; }' \ 62 -e '/^\..*include *</ { s,<,<bsd.,;/autoconf/d; }' \
62 -e 's,${SRCTOP},$${SRCTOP},g' 63 -e 's,${SRCTOP},$${SRCTOP},g'
63 64
64# These are the simple files we want to capture 65# These are the simple files we want to capture
65configured_files= config.h Makefile.config unit-tests/Makefile 66configured_files= config.h Makefile.config unit-tests/Makefile
66 67
67after-import: bootstrap ${MAKEFILE} 68after-import: bootstrap ${MAKEFILE}
68.for f in ${configured_files:M*.[ch]} 69.for f in ${configured_files:M*.[ch]}
69 @echo Capturing $f 70 @echo Capturing $f
70 @mkdir -p ${${.CURDIR}/$f:L:H} 71 @mkdir -p ${${.CURDIR}/$f:L:H}
71 @(echo '/* $$${HOST_OS}$$ */'; cat ${HOST_OS}/$f) > ${.CURDIR}/$f 72 @(echo '/* $$${HOST_OS}$$ */'; cat ${HOST_OS}/$f) > ${.CURDIR}/$f

cvs diff -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/Makefile.config.in (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/Makefile.config.in 2015/05/19 21:36:43 1.1.1.1
+++ pkgsrc/devel/bmake/files/Makefile.config.in 2017/08/15 15:54:06 1.2
@@ -1,15 +1,17 @@ @@ -1,15 +1,17 @@
1# things set by configure 1# things set by configure
2 2
 3_MAKE_VERSION=@_MAKE_VERSION@
 4
3prefix= @prefix@ 5prefix= @prefix@
4srcdir= @srcdir@ 6srcdir= @srcdir@
5CC?= @CC@ 7CC?= @CC@
6MACHINE= @machine@ 8MACHINE= @machine@
7MACHINE_ARCH= @machine_arch@ 9MACHINE_ARCH= @machine_arch@
8DEFAULT_SYS_PATH= @default_sys_path@ 10DEFAULT_SYS_PATH= @default_sys_path@
9 11
10CPPFLAGS+= @CPPFLAGS@ 12CPPFLAGS+= @CPPFLAGS@
11CFLAGS+= ${CPPFLAGS} @DEFS@ 13CFLAGS+= ${CPPFLAGS} @DEFS@
12LDFLAGS= @LDFLAGS@ 14LDFLAGS= @LDFLAGS@
13LIBOBJS= @LIBOBJS@ 15LIBOBJS= @LIBOBJS@
14LDADD= @LIBS@ 16LDADD= @LIBS@
15USE_META= @use_meta@ 17USE_META= @use_meta@

File Added: pkgsrc/devel/bmake/files/VERSION
# keep this compatible with sh and make
_MAKE_VERSION=20150505

cvs diff -r1.15 -r1.16 pkgsrc/devel/bmake/files/configure (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/configure 2015/05/19 22:01:19 1.15
+++ pkgsrc/devel/bmake/files/configure 2017/08/15 15:54:06 1.16
@@ -581,26 +581,27 @@ ac_includes_default="\ @@ -581,26 +581,27 @@ ac_includes_default="\
581# include <strings.h> 581# include <strings.h>
582#endif 582#endif
583#ifdef HAVE_INTTYPES_H 583#ifdef HAVE_INTTYPES_H
584# include <inttypes.h> 584# include <inttypes.h>
585#endif 585#endif
586#ifdef HAVE_STDINT_H 586#ifdef HAVE_STDINT_H
587# include <stdint.h> 587# include <stdint.h>
588#endif 588#endif
589#ifdef HAVE_UNISTD_H 589#ifdef HAVE_UNISTD_H
590# include <unistd.h> 590# include <unistd.h>
591#endif" 591#endif"
592 592
593ac_subst_vars='LTLIBOBJS 593ac_subst_vars='LTLIBOBJS
 594_MAKE_VERSION
594filemon_h 595filemon_h
595use_meta 596use_meta
596diff_u 597diff_u
597GCC 598GCC
598INSTALL 599INSTALL
599default_sys_path 600default_sys_path
600mksrc 601mksrc
601machine_arch 602machine_arch
602force_machine 603force_machine
603machine 604machine
604LIBOBJS 605LIBOBJS
605bmake_path_max 606bmake_path_max
606ac_exe_suffix 607ac_exe_suffix
@@ -2253,26 +2254,28 @@ ac_cpp='$CPP $CPPFLAGS' @@ -2253,26 +2254,28 @@ ac_cpp='$CPP $CPPFLAGS'
2253ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 2254ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2254ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 2255ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2255ac_compiler_gnu=$ac_cv_c_compiler_gnu 2256ac_compiler_gnu=$ac_cv_c_compiler_gnu
2256 2257
2257 2258
2258ac_config_headers="$ac_config_headers config.h" 2259ac_config_headers="$ac_config_headers config.h"
2259 2260
2260 2261
2261case "$srcdir" in 2262case "$srcdir" in
2262/*) ;; 2263/*) ;;
2263*) srcdir=`cd $srcdir && pwd`;; 2264*) srcdir=`cd $srcdir && pwd`;;
2264esac 2265esac
2265 2266
 2267. $srcdir/VERSION
 2268
2266 2269
2267# Check whether --with-defshell was given. 2270# Check whether --with-defshell was given.
2268if test "${with_defshell+set}" = set; then : 2271if test "${with_defshell+set}" = set; then :
2269 withval=$with_defshell; case "${withval}" in 2272 withval=$with_defshell; case "${withval}" in
2270yes) as_fn_error "bad value ${withval} given for bmake DEFSHELL" "$LINENO" 5 ;; 2273yes) as_fn_error "bad value ${withval} given for bmake DEFSHELL" "$LINENO" 5 ;;
2271no) ;; 2274no) ;;
2272*) case "$with_defshell" in 2275*) case "$with_defshell" in
2273 sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway 2276 sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway
2274 ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; 2277 ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;;
2275 csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right? 2278 csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right?
2276 *) defshell_path=$with_defshell;; # better be sh compatible! 2279 *) defshell_path=$with_defshell;; # better be sh compatible!
2277 esac 2280 esac
2278 ;; 2281 ;;

cvs diff -r1.13 -r1.14 pkgsrc/devel/bmake/files/configure.in (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/configure.in 2015/05/19 22:01:19 1.13
+++ pkgsrc/devel/bmake/files/configure.in 2017/08/15 15:54:06 1.14
@@ -1,29 +1,32 @@ @@ -1,29 +1,32 @@
1dnl 1dnl
2dnl RCSid: 2dnl RCSid:
3dnl $Id: configure.in,v 1.13 2015/05/19 22:01:19 joerg Exp $ 3dnl $Id: configure.in,v 1.14 2017/08/15 15:54:06 brook Exp $
4dnl 4dnl
5dnl Process this file with autoconf to produce a configure script 5dnl Process this file with autoconf to produce a configure script
6dnl 6dnl
7AC_PREREQ(2.50) 7AC_PREREQ(2.50)
8AC_INIT([bmake], [20140214], [sjg@NetBSD.org]) 8AC_INIT([bmake], [20140214], [sjg@NetBSD.org])
9AC_CONFIG_HEADERS(config.h) 9AC_CONFIG_HEADERS(config.h)
10 10
11dnl make srcdir absolute 11dnl make srcdir absolute
12case "$srcdir" in 12case "$srcdir" in
13/*) ;; 13/*) ;;
14*) srcdir=`cd $srcdir && pwd`;; 14*) srcdir=`cd $srcdir && pwd`;;
15esac 15esac
16 16
 17dnl get _MAKE_VERSION
 18. $srcdir/VERSION
 19
17dnl 20dnl
18AC_ARG_WITH(defshell, 21AC_ARG_WITH(defshell,
19[ --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions], 22[ --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions],
20[case "${withval}" in 23[case "${withval}" in
21yes) AC_MSG_ERROR(bad value ${withval} given for bmake DEFSHELL) ;; 24yes) AC_MSG_ERROR(bad value ${withval} given for bmake DEFSHELL) ;;
22no) ;; 25no) ;;
23*) case "$with_defshell" in 26*) case "$with_defshell" in
24 sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway 27 sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway
25 ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; 28 ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;;
26 csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right? 29 csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right?
27 *) defshell_path=$with_defshell;; # better be sh compatible! 30 *) defshell_path=$with_defshell;; # better be sh compatible!
28 esac 31 esac
29 ;; 32 ;;
@@ -365,24 +368,25 @@ if test -n "$DEFSHELL_INDEX"; then @@ -365,24 +368,25 @@ if test -n "$DEFSHELL_INDEX"; then
365 AC_DEFINE_UNQUOTED(DEFSHELL_INDEX, $DEFSHELL_INDEX, Shell spec to use by default) 368 AC_DEFINE_UNQUOTED(DEFSHELL_INDEX, $DEFSHELL_INDEX, Shell spec to use by default)
366fi  369fi
367dnl 370dnl
368AC_SUBST(machine) 371AC_SUBST(machine)
369AC_SUBST(force_machine) 372AC_SUBST(force_machine)
370AC_SUBST(machine_arch) 373AC_SUBST(machine_arch)
371AC_SUBST(mksrc) 374AC_SUBST(mksrc)
372AC_SUBST(default_sys_path) 375AC_SUBST(default_sys_path)
373AC_SUBST(INSTALL) 376AC_SUBST(INSTALL)
374AC_SUBST(GCC) 377AC_SUBST(GCC)
375AC_SUBST(diff_u) 378AC_SUBST(diff_u)
376AC_SUBST(use_meta) 379AC_SUBST(use_meta)
377AC_SUBST(filemon_h) 380AC_SUBST(filemon_h)
 381AC_SUBST(_MAKE_VERSION)
378AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile) 382AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile)
379 383
380cat <<EOF 384cat <<EOF
381 385
382You can now run 386You can now run
383 387
384 sh ./make-bootstrap.sh 388 sh ./make-bootstrap.sh
385 389
386to produce a fully functional bmake. 390to produce a fully functional bmake.
387 391
388EOF 392EOF

cvs diff -r1.5 -r1.6 pkgsrc/devel/bmake/files/make-bootstrap.sh.in (expand / switch to unified diff)

--- pkgsrc/devel/bmake/files/make-bootstrap.sh.in 2016/01/24 16:14:44 1.5
+++ pkgsrc/devel/bmake/files/make-bootstrap.sh.in 2017/08/15 15:54:06 1.6
@@ -3,27 +3,27 @@ @@ -3,27 +3,27 @@
3set -e 3set -e
4 4
5srcdir=@srcdir@ 5srcdir=@srcdir@
6 6
7DEFAULT_SYS_PATH="@default_sys_path@" 7DEFAULT_SYS_PATH="@default_sys_path@"
8 8
9case "@use_meta@" in 9case "@use_meta@" in
10yes) XDEFS="-DUSE_META ${XDEFS}";; 10yes) XDEFS="-DUSE_META ${XDEFS}";;
11esac 11esac
12 12
13CC="@CC@" 13CC="@CC@"
14CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@" 14CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@"
15 15
16MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` 16MAKE_VERSION=@_MAKE_VERSION@
17 17
18MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ 18MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \
19-D@force_machine@MACHINE=\"@machine@\" -DPKGSRC_MACHINE_ARCH=\"@machine_arch@\" \ 19-D@force_machine@MACHINE=\"@machine@\" -DPKGSRC_MACHINE_ARCH=\"@machine_arch@\" \
20-D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"" 20-D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\""
21 21
22 22
23LDFLAGS="@LDFLAGS@" 23LDFLAGS="@LDFLAGS@"
24LIBS="@LIBS@" 24LIBS="@LIBS@"
25 25
26do_compile2() { 26do_compile2() {
27 obj="$1"; shift 27 obj="$1"; shift
28 src="$1"; shift 28 src="$1"; shift
29 echo ${CC} -c ${CFLAGS} "$@" -o "$obj" "$src" 29 echo ${CC} -c ${CFLAGS} "$@" -o "$obj" "$src"