summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2008-10-26 07:28:06 +0000
committermrg <mrg@NetBSD.org>2008-10-26 07:28:06 +0000
commit7bee40559fb7e80f736edf131deb4a1f9de8b713 (patch)
tree44da9c25e45f36bf6b049a2f31353e42ff29e0b5 /lib/libc
parent4c0ca913b1e7b5093d3a47c14a31df7ac1ecbf0a (diff)
put the code to find the libc include directories and define ARCHSUBDIR
and ARCHDIR in a common place. this will be used by libc, libposix and librt.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/libcincludes.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libc/libcincludes.mk b/lib/libc/libcincludes.mk
new file mode 100644
index 00000000000..66afcc3b990
--- /dev/null
+++ b/lib/libc/libcincludes.mk
@@ -0,0 +1,19 @@
+# $NetBSD: libcincludes.mk,v 1.1 2008/10/26 07:28:06 mrg Exp $
+
+# Makefile fragment shared across several parts that want to look
+# inside libc's include tree.
+
+.if defined(LIBC_MACHINE_ARCH) && \
+ exists(${NETBSDSRCDIR}/lib/libc/arch/${LIBC_MACHINE_ARCH}/SYS.h)
+ARCHSUBDIR= ${LIBC_MACHINE_ARCH}
+.elif exists(${NETBSDSRCDIR}/lib/libc/arch/${MACHINE_ARCH}/SYS.h)
+ARCHSUBDIR= ${MACHINE_ARCH}
+.elif exists(${NETBSDSRCDIR}/lib/libc/arch/${MACHINE_CPU}/SYS.h)
+ARCHSUBDIR= ${MACHINE_CPU}
+.else
+.BEGIN:
+ @echo no ARCHDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
+ @false
+.endif
+
+ARCHDIR= ${NETBSDSRCDIR}/lib/libc/arch/${ARCHSUBDIR}