summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobache <obache>2013-11-26 07:25:53 +0000
committerobache <obache>2013-11-26 07:25:53 +0000
commitc3e13a513b23b2a5cb928aa6241c8543e00c983c (patch)
tree1cf09328e8399443fec3a9b602175b349f732a48
parent36b0146bed9276f9c99cb8ccecee399c5d1931eb (diff)
downloadpkgsrc-c3e13a513b23b2a5cb928aa6241c8543e00c983c.tar.gz
Use find-headers.mk to detect available endian.h.
-rw-r--r--mk/endian.mk16
1 files changed, 6 insertions, 10 deletions
diff --git a/mk/endian.mk b/mk/endian.mk
index f40b8f10bb6..16c0efc8821 100644
--- a/mk/endian.mk
+++ b/mk/endian.mk
@@ -1,4 +1,4 @@
-# $NetBSD: endian.mk,v 1.8 2013/11/07 05:12:24 obache Exp $
+# $NetBSD: endian.mk,v 1.9 2013/11/26 07:25:53 obache Exp $
#
# Determine the endianness of the platform by checking header files.
#
@@ -19,15 +19,11 @@
.include "../../mk/compiler.mk"
.if !defined(MACHINE_ENDIAN)
-. if exists(/usr/include/endian.h)
-_ENDIAN_H= endian.h # Linux
-. elif exists(/usr/include/sys/endian.h)
-_ENDIAN_H= sys/endian.h # NetBSD>=1.5
-. elif exists(/usr/include/machine/endian.h)
-_ENDIAN_H= machine/endian.h # NetBSD<1.5
-. elif exists(/usr/include/sys/byteorder.h)
-_ENDIAN_H= sys/byteorder.h # Solaris
-. else
+BUILTIN_FIND_HEADERS_VAR:= _ENDIAN_H
+BUILTIN_FIND_HEADERS.ENDIAN_H= endian.h sys/endian.h machine/endian.h \
+ sys/byteorder.h
+.include "../../mk/buildlink3/find-headers.mk"
+. if !empty(_ENDIAN_H:M__nonexistent__)
_ENDIAN_H= /dev/null
. endif