Nmap Development mailing list archives

Re: [PATCH] Re: 4.90RC1 doesn't compile on FreeBSD


From: Daniel Roethlisberger <daniel () roe ch>
Date: Tue, 30 Jun 2009 00:16:58 +0200

David Fifield <david () bamsoftware com> 2009-06-29:
On Mon, Jun 29, 2009 at 11:44:29PM +0200, Daniel Roethlisberger wrote:
Fyodor <fyodor () insecure org> 2009-06-29:
On Sat, Jun 27, 2009 at 02:59:17PM +0200, Daniel Roethlisberger wrote:
Fyodor <fyodor () insecure org> 2009-06-26:

Patch attached.  With gmake installed, invoking `make` will
automatically invoke `gmake` on the same target(s).  Without
gmake installed, you get this:

Thanks, this looks good.  Do you know if the make on FreeBSD, Solaris,
OpenBSD, and NetBSD all accept this 'BSDmakefile' name and give it
precedence over "Makefile"?

FreeBSD and OpenBSD both have a make(1) which uses "BSDmakefile"
in precedence of "makefile" and "Makefile".  NetBSD and Solaris
don't.

I don't think it is feasible to write a Makefile compatible with
all implementations of make(1), but maybe that's being too
pessimistic.

We could put a check for GNU Make in Makefile. Then you would get an
immediate, clear error if you use a non-GNU make. The question is how to
detect GNU Make. A list of features specific to GNU Make is at
http://www.gnu.org/software/make/manual/html_node/Features.html.

If one of these, MAKE_VERSION for example, is really not present in
other makes, then this would work:

all: check-gnu-make @LUA_BUILD@ @PCAP_BUILD@ @PCRE_BUILD@ @DNET_BUILD@ @NBASE_BUILD@ @NSOCK_BUILD@ @NCAT_BUILD@
        $(MAKE) $(TARGET) $(BUILDZENMAP) $(BUILDNDIFF)

check-gnu-make:
        @if [ -z "$(MAKE_VERSION)" ]; then \
                echo "Use GNU Make."; \
                false; \
        fi

FreeBSD make(1) also sets the MAKE_VERSION variable:

$ make -V MAKE_VERSION
5200408120

So we'd be looking for a reliable detection of GNU make which
doesn't trigger any syntax errors in other make implementations.

-- 
Daniel Roethlisberger
http://daniel.roe.ch/

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: