Commit 6f2f1690 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix GNU make detection.

(The test 'make --version' with FreeBSD make (and potentially others)
would just reinvoke make on the same Makefile, resulting in an infinite
loop.)
parent db631de5
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
all check install installdirs installcheck uninstall dep depend clean distclean maintainer-clean: all check install installdirs installcheck uninstall dep depend clean distclean maintainer-clean:
@if ! [ -f GNUmakefile ] ; then \ @if ! [ -f GNUmakefile ] ; then \
echo "You need to run the \`configure' program first. See the file"; \ echo "You need to run the 'configure' program first. See the file"; \
echo "\`INSTALL' for installation instructions." ; \ echo "'INSTALL' for installation instructions." ; \
false ; \ false ; \
fi fi
@IFS=':' ; \ @IFS=':' ; \
for dir in $$PATH; do \ for dir in $$PATH; do \
for prog in gmake gnumake make; do \ for prog in gmake gnumake make; do \
if [ -f $$dir/$$prog ] && ( $$dir/$$prog --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then \ if [ -f $$dir/$$prog ] && ( $$dir/$$prog -f /dev/null --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then \
GMAKE=$$dir/$$prog; \ GMAKE=$$dir/$$prog; \
break 2; \ break 2; \
fi; \ fi; \
......
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
# GNUmakefile won't exist yet, so we catch that case as well. # GNUmakefile won't exist yet, so we catch that case as well.
all install clean dep depend distclean maintainer-clean: all check install installdirs installcheck uninstall dep depend clean distclean maintainer-clean:
@if ! [ -f GNUmakefile ] ; then \ @if ! [ -f GNUmakefile ] ; then \
echo "You need to run the \`configure' program first. See the file"; \ echo "You need to run the 'configure' program first. See the file"; \
echo "\`INSTALL' for installation instructions." ; \ echo "'INSTALL' for installation instructions." ; \
false ; \ false ; \
fi fi
@IFS=':' ; \ @IFS=':' ; \
for dir in $$PATH; do \ for dir in $$PATH; do \
for prog in gmake gnumake make; do \ for prog in gmake gnumake make; do \
if [ -f $$dir/$$prog ] && ( $$dir/$$prog --version | grep GNU >/dev/null 2>&1 ) ; then \ if [ -f $$dir/$$prog ] && ( $$dir/$$prog -f /dev/null --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then \
GMAKE=$$dir/$$prog; \ GMAKE=$$dir/$$prog; \
break 2; \ break 2; \
fi; \ fi; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment