Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src have bsd.endian.mk, which detects target endian.



details:   https://anonhg.NetBSD.org/src/rev/aa61a49c74a0
branches:  trunk
changeset: 532041:aa61a49c74a0
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu May 30 21:40:47 2002 +0000

description:
have bsd.endian.mk, which detects target endian.
generate *.db in target endian.  (see tech-userlevel for discussions)

diffstat:

 distrib/sets/lists/comp/mi |   3 ++-
 etc/Makefile               |  17 ++++-------------
 share/mk/Makefile          |   4 ++--
 share/mk/bsd.endian.mk     |  21 +++++++++++++++++++++
 share/termcap/Makefile     |  14 +++++++++++---
 usr.bin/vgrind/Makefile    |  15 ++++++++++++---
 6 files changed, 52 insertions(+), 22 deletions(-)

diffs (152 lines):

diff -r 029b017dfec5 -r aa61a49c74a0 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Thu May 30 21:36:38 2002 +0000
+++ b/distrib/sets/lists/comp/mi        Thu May 30 21:40:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.443 2002/05/28 11:35:40 itojun Exp $
+#      $NetBSD: mi,v 1.444 2002/05/30 21:40:49 itojun Exp $
 ./sys                          comp-sysutil-root
 ./usr/bin/addr2line            comp-debug-bin
 ./usr/bin/ar                   comp-util-bin
@@ -6060,6 +6060,7 @@
 ./usr/share/mk/bsd.README              comp-util-share
 ./usr/share/mk/bsd.dep.mk              comp-util-share
 ./usr/share/mk/bsd.doc.mk              comp-util-share
+./usr/share/mk/bsd.endian.mk           comp-util-share
 ./usr/share/mk/bsd.files.mk            comp-util-share
 ./usr/share/mk/bsd.hostlib.mk          comp-util-share
 ./usr/share/mk/bsd.hostprog.mk         comp-util-share
diff -r 029b017dfec5 -r aa61a49c74a0 etc/Makefile
--- a/etc/Makefile      Thu May 30 21:36:38 2002 +0000
+++ b/etc/Makefile      Thu May 30 21:40:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.220 2002/05/30 09:49:22 itojun Exp $
+#      $NetBSD: Makefile,v 1.221 2002/05/30 21:40:47 itojun Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -107,20 +107,11 @@
 NAMEDB=        127 root.cache named.conf localhost loopback.v6
 
 .if make(install-etc-files)                                            # {
-# find out endianness of target and set proper flag for pwd_mkdb so that
-# it creates database in same endianness
-.if exists(${DESTDIR}/usr/include/sys/endian.h)
-TARGET_ENDIANNESS!= \
-       printf '\#include <sys/endian.h>\n_BYTE_ORDER\n' | \
-       ${CC} -I${DESTDIR}/usr/include -E - | tail -1 | awk '{print $$1}'
-.else
-TARGET_ENDIANNESS=
-.endif
-
+.include <bsd.endian.mk>
 .if ${TARGET_ENDIANNESS} == "1234"
-TARGET_ENDIANNESS= -L
+TARGET_ENDIANNESS=     -L
 .elif ${TARGET_ENDIANNESS} == "4321"
-TARGET_ENDIANNESS= -B
+TARGET_ENDIANNESS=     -B
 .else
 TARGET_ENDIANNESS=
 .endif
diff -r 029b017dfec5 -r aa61a49c74a0 share/mk/Makefile
--- a/share/mk/Makefile Thu May 30 21:36:38 2002 +0000
+++ b/share/mk/Makefile Thu May 30 21:40:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.33 2001/12/14 05:46:47 explorer Exp $
+#      $NetBSD: Makefile,v 1.34 2002/05/30 21:40:48 itojun Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/8/93
 
 NOOBJ= # defined
@@ -6,7 +6,7 @@
 .include <bsd.own.mk>
 
 .if ${MKSHARE} != "no"
-FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.files.mk bsd.hostlib.mk \
+FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.endian.mk bsd.files.mk bsd.hostlib.mk \
        bsd.hostprog.mk bsd.inc.mk bsd.info.mk bsd.init.mk bsd.kernobj.mk \
        bsd.kinc.mk bsd.kmod.mk bsd.lib.mk bsd.links.mk bsd.man.mk \
        bsd.nls.mk bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk \
diff -r 029b017dfec5 -r aa61a49c74a0 share/mk/bsd.endian.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/mk/bsd.endian.mk    Thu May 30 21:40:47 2002 +0000
@@ -0,0 +1,21 @@
+#      $NetBSD: bsd.endian.mk,v 1.1 2002/05/30 21:40:48 itojun Exp $
+
+.include <bsd.init.mk>
+
+# find out endianness of target and set proper flag for pwd_mkdb so that
+# it creates database in same endianness.
+.if exists(${DESTDIR}/usr/include/sys/endian.h)
+TARGET_ENDIANNESS!= \
+       printf '\#include <sys/endian.h>\n_BYTE_ORDER\n' | \
+       ${CC} -I${DESTDIR}/usr/include -E - | tail -1 | awk '{print $$1}'
+.else
+TARGET_ENDIANNESS=
+.endif
+
+#.if ${TARGET_ENDIANNESS} == "1234"
+#TARGET_ENDIANNESS=    little
+#.elif ${TARGET_ENDIANNESS} == "4321"
+#TARGET_ENDIANNESS=    big
+#.else
+#TARGET_ENDIANNESS=    unknown
+#.endif
diff -r 029b017dfec5 -r aa61a49c74a0 share/termcap/Makefile
--- a/share/termcap/Makefile    Thu May 30 21:36:38 2002 +0000
+++ b/share/termcap/Makefile    Thu May 30 21:40:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.24 2002/05/30 10:45:03 itojun Exp $
+#      $NetBSD: Makefile,v 1.25 2002/05/30 21:40:50 itojun Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/8/93
 
 MAN=   termcap.5
@@ -9,8 +9,16 @@
 FILESNAME_termcap.src=termcap
 FILESDIR=${BINDIR}/misc
 
-# there's no issue in endianness as DB keys are ascii strings.
+.include <bsd.endian.mk>
+.if ${TARGET_ENDIANNESS} == "1234"
+TARGET_ENDIANNESS=     -l
+.elif ${TARGET_ENDIANNESS} == "4321"
+TARGET_ENDIANNESS=     -b
+.else
+TARGET_ENDIANNESS=
+.endif
+
 termcap.db: termcap.src
-       ${CAP_MKDB} -f termcap ${.ALLSRC}
+       ${CAP_MKDB} ${TARGET_ENDIANNESS} -f termcap ${.ALLSRC}
 
 .include <bsd.prog.mk>
diff -r 029b017dfec5 -r aa61a49c74a0 usr.bin/vgrind/Makefile
--- a/usr.bin/vgrind/Makefile   Thu May 30 21:36:38 2002 +0000
+++ b/usr.bin/vgrind/Makefile   Thu May 30 21:40:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.13 2002/05/30 10:45:04 itojun Exp $
+#      $NetBSD: Makefile,v 1.14 2002/05/30 21:40:50 itojun Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/9/93
 
 .include <bsd.own.mk>
@@ -24,10 +24,19 @@
 
 realall: vfontedpr vgrindefs.src.db
 
-# there's no issue of endianness as DB keys are ascii strings.
+.include <bsd.endian.mk>
+.if ${TARGET_ENDIANNESS} == "1234"
+TARGET_ENDIANNESS=     -l
+.elif ${TARGET_ENDIANNESS} == "4321"
+TARGET_ENDIANNESS=     -b
+.else
+TARGET_ENDIANNESS=
+.endif
+
 .if ${MKSHARE} != "no"
 vgrindefs.src.db: vgrindefs.src
-       ${CAP_MKDB} -f vgrindefs.src ${.CURDIR}/vgrindefs.src
+       ${CAP_MKDB} ${TARGET_ENDIANNESS} -f vgrindefs.src \
+           ${.CURDIR}/vgrindefs.src
 .else
 vgrindefs.src.db:
 .endif



Home | Main Index | Thread Index | Old Index