Source-Changes-HG archive

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

[src/trunk]: src/etc Call pwd_mkdb with proper flag, so that it creates datab...



details:   https://anonhg.NetBSD.org/src/rev/1ca961a2c0f9
branches:  trunk
changeset: 499052:1ca961a2c0f9
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Nov 09 20:01:54 2000 +0000

description:
Call pwd_mkdb with proper flag, so that it creates database in same
endianness as compile target. This is primarily for cross compiles.
Hopefully this method (looking into
${DESTDIR}/usr/include/machine/endian_machdep.h) is okay.

Patch sent by Andrew Brown in bin/11454.

diffstat:

 etc/Makefile |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 7a1b3bd00ed7 -r 1ca961a2c0f9 etc/Makefile
--- a/etc/Makefile      Thu Nov 09 19:51:57 2000 +0000
+++ b/etc/Makefile      Thu Nov 09 20:01:54 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.169 2000/10/30 21:48:20 thorpej Exp $
+#      $NetBSD: Makefile,v 1.170 2000/11/09 20:01:54 jdolecek Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -118,8 +118,26 @@
 NAMEDB=        127 root.cache named.conf localhost loopback.v6
 PCS=   pcs750.bin
 
+# 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/machine/endian_machdep.h)
+TARGET_ENDIANNESS!= awk '/_BYTE_ORDER/{print $$3}' \
+       ${DESTDIR}/usr/include/machine/endian_machdep.h
+.else
+TARGET_ENDIANNESS=
+.endif
+
+.if ${TARGET_ENDIANNESS} == "_LITTLE_ENDIAN"
+TARGET_ENDIANNESS= -L
+.elif ${TARGET_ENDIANNESS} == "_BIG_ENDIAN"
+TARGET_ENDIANNESS= -B
+.else
+TARGET_ENDIANNESS=
+.endif
+
 all clean cleandir depend distclean etc includes install lint:
 
+
 .include <bsd.kernobj.mk>
 
 obj:
@@ -148,7 +166,7 @@
            ${DESTDIR}/var/cron/tabs/root
        ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 master.passwd \
            ${DESTDIR}/etc
-       pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd
+       pwd_mkdb -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd
        ${INSTALL} ${INSTPRIV} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
             MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
        ${INSTALL} ${INSTPRIV} -c -o root -g wheel -m 600 minfree \



Home | Main Index | Thread Index | Old Index