summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2013-11-26 07:25:53 +0000
committerobache <obache@pkgsrc.org>2013-11-26 07:25:53 +0000
commit0998d2936212028652c38f8edb1cc86bc750b7eb (patch)
tree1cf09328e8399443fec3a9b602175b349f732a48 /mk
parent140447c80d8e6c317069d8ab3aa0544afd9d8cb2 (diff)
downloadpkgsrc-0998d2936212028652c38f8edb1cc86bc750b7eb.tar.gz
Use find-headers.mk to detect available endian.h.
Diffstat (limited to 'mk')
-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