]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/aclocal.m4
ncurses 6.2 - patch 20210703
[ncurses.git] / Ada95 / aclocal.m4
index e2bc2cd792d0c4b8e8a5ea790281cc98db3310b5..d41fd275ac88a8bb5778676a77f7d51109b94feb 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey
 dnl
-dnl $Id: aclocal.m4,v 1.176 2021/06/19 23:44:07 tom Exp $
+dnl $Id: aclocal.m4,v 1.177 2021/07/03 20:24:36 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -2526,6 +2526,89 @@ CF_EOF
 AC_SUBST(cf_cv_makeflags)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_MAKE_PHONY version: 3 updated: 2021/01/08 16:08:21
+dnl -------------
+dnl Check if the make-program handles a ".PHONY" target, e.g,. a target which
+dnl acts as a placeholder.
+dnl
+dnl The ".PHONY" feature was proposed in 2011 here
+dnl     https://www.austingroupbugs.net/view.php?id=523
+dnl and is scheduled for release in P1003.1 Issue 8 (late 2022).
+dnl
+dnl This is not supported by SVr4 make (or SunOS 4, 4.3SD, etc), but works with
+dnl a few others (i.e., GNU make and the non-POSIX "BSD" make):
+dnl
+dnl + This is a GNU make feature (since April 1988, but in turn from binutils,
+dnl   date unspecified).
+dnl
+dnl + It was adopted in NetBSD make in June 1995.
+dnl
+dnl + The other BSD make programs are derived from the NetBSD make (and for
+dnl   that reason are not actually different "implementations").
+dnl
+dnl + Some features of NetBSD make were actually adapted from pmake, which
+dnl   began as a modified GNU make starting in 1993.
+dnl
+dnl + Version 3.8 of the dmake program in January 1992 also implemented this
+dnl   GNU make extension, but is less well known than the BSD make.
+AC_DEFUN([CF_MAKE_PHONY],[
+AC_CACHE_CHECK(for \".PHONY\" make-support, cf_cv_make_PHONY,[
+       rm -rf conftest*
+       (
+               mkdir conftest || exit 1
+               cd conftest
+               cat >makefile <<'CF_EOF'
+.PHONY: always
+DATA=0
+always:        always.out
+       @echo "** making [$]@ [$](DATA)"
+once: once.out
+       @echo "** making [$]@ [$](DATA)"
+always.out:
+       @echo "** making [$]@ [$](DATA)"
+       echo [$](DATA) > [$]@
+once.out:
+       @echo "** making [$]@ [$](DATA)"
+       echo [$](DATA) > [$]@
+CF_EOF
+               for cf_data in 1 2 3
+               do
+                       ${MAKE:-make} always DATA=$cf_data
+                       ${MAKE:-make} once   DATA=$cf_data
+                       ${MAKE:-make} -t always once
+                       if test -f always ; then
+                               echo "no (case 1)" > ../conftest.tmp
+                       elif test ! -f always.out ; then
+                               echo "no (case 2)" > ../conftest.tmp
+                       elif test ! -f once.out ; then
+                               echo "no (case 3)" > ../conftest.tmp
+                       elif ! cmp -s always.out once.out ; then
+                               echo "no (case 4)" > ../conftest.tmp
+                               diff always.out once.out
+                       else
+                               cf_check="`cat always.out`"
+                               if test "x$cf_check" != "x$cf_data" ; then
+                                       echo "no (case 5)" > ../conftest.tmp
+                               else
+                                       echo yes > ../conftest.tmp
+                                       rm -f ./*.out
+                                       continue
+                               fi
+                       fi
+                       break
+               done
+       ) >&AC_FD_CC 2>&1
+       cf_cv_make_PHONY="`cat conftest.tmp`"
+       rm -rf conftest*
+])
+MAKE_NO_PHONY="#"
+MAKE_PHONY="#"
+test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
+test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
+AC_SUBST(MAKE_NO_PHONY)
+AC_SUBST(MAKE_PHONY)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
 dnl ------------
 dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have