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 context 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
@@ -5,6 +5,7 @@
 PSD.doc/Makefile
 PSD.doc/tutorial.ms
 README
+VERSION
 aclocal.m4
 arch.c
 bmake.1

cvs diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/Makefile (expand / switch to context 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,8 +1,5 @@
-#	$Id: Makefile,v 1.2 2015/05/19 22:01:19 joerg Exp $
+#	$Id: Makefile,v 1.3 2017/08/15 15:54:06 brook Exp $
 
-# Base version on src date
-MAKE_VERSION= 20150505
-
 PROG=	bmake
 
 SRCS= \
@@ -56,6 +53,8 @@
 	lstRemove.c \
 	lstReplace.c \
 	lstSucc.c
+
+.-include "VERSION"
 
 # this file gets generated by configure
 .-include "Makefile.config"

cvs diff -r1.2 -r1.3 pkgsrc/devel/bmake/files/bsd.after-import.mk (expand / switch to context 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,4 +1,4 @@
-# $Id: bsd.after-import.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: bsd.after-import.mk,v 1.3 2017/08/15 15:54:06 brook Exp $
 
 # This makefile is for use when integrating bmake into a BSD build
 # system.  Use this makefile after importing bmake.
@@ -56,6 +56,7 @@
 
 # Makefiles need a little more tweaking than say config.h
 MAKEFILE_SED = 	sed -e '/^MACHINE/d' \
+	-e '/include.*VERSION/d' \
 	-e '/^PROG/ { s,=,?=,;s,bmake,$${.CURDIR:T},; }' \
 	-e 's,^.-include,.sinclude,' \
 	-e '/^\..*include  *</ { s,<,<bsd.,;/autoconf/d; }' \

cvs diff -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/Makefile.config.in (expand / switch to context 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,5 +1,7 @@
 # things set by configure
 
+_MAKE_VERSION=@_MAKE_VERSION@
+
 prefix= @prefix@
 srcdir= @srcdir@
 CC?= @CC@

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 context 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
@@ -591,6 +591,7 @@
 #endif"
 
 ac_subst_vars='LTLIBOBJS
+_MAKE_VERSION
 filemon_h
 use_meta
 diff_u
@@ -2262,6 +2263,8 @@
 /*) ;;
 *) srcdir=`cd $srcdir && pwd`;;
 esac
+
+. $srcdir/VERSION
 
 
 # Check whether --with-defshell was given.

cvs diff -r1.13 -r1.14 pkgsrc/devel/bmake/files/configure.in (expand / switch to context 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,6 +1,6 @@
 dnl
 dnl RCSid:
-dnl	$Id: configure.in,v 1.13 2015/05/19 22:01:19 joerg Exp $
+dnl	$Id: configure.in,v 1.14 2017/08/15 15:54:06 brook Exp $
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
@@ -14,6 +14,9 @@
 *) srcdir=`cd $srcdir && pwd`;;
 esac
 
+dnl get _MAKE_VERSION
+. $srcdir/VERSION
+
 dnl
 AC_ARG_WITH(defshell,
 [  --with-defshell=SHELL  use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions],
@@ -375,6 +378,7 @@
 AC_SUBST(diff_u)
 AC_SUBST(use_meta)
 AC_SUBST(filemon_h)
+AC_SUBST(_MAKE_VERSION)
 AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile)
 
 cat <<EOF

cvs diff -r1.5 -r1.6 pkgsrc/devel/bmake/files/make-bootstrap.sh.in (expand / switch to context 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
@@ -13,7 +13,7 @@
 CC="@CC@"
 CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@"
 
-MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile`
+MAKE_VERSION=@_MAKE_VERSION@
 
 MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \
 -D@force_machine@MACHINE=\"@machine@\" -DPKGSRC_MACHINE_ARCH=\"@machine_arch@\" \