Module Name:    src
Committed By:   matt
Date:           Sun Mar  2 03:55:19 UTC 2014

Modified Files:
        src/usr.bin/ldd: ldd.c
        src/usr.bin/ldd/build: Makefile
        src/usr.bin/ldd/elf32: Makefile
        src/usr.bin/ldd/elf64: Makefile

Log Message:
Use OBJECT_FMTS from <bsd.own.mk> to determine elf32/elf64 needs


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.21 src/usr.bin/ldd/ldd.c:1.22
--- src/usr.bin/ldd/ldd.c:1.21	Wed Mar 20 15:18:42 2013
+++ src/usr.bin/ldd/ldd.c	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $	*/
+/*	$NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -165,7 +165,7 @@ main(int argc, char **argv)
 		}
 		if (elf_ldd(fd, *argv, fmt1, fmt2) == -1
 		    /* Alpha never had 32 bit support. */
-#if (defined(_LP64) && !defined(__alpha__)) || defined(MIPS_N32)
+#if (defined(_LP64) && !defined(ELF64_ONLY)) || defined(MIPS_N32)
 		    && elf32_ldd(fd, *argv, fmt1, fmt2) == -1
 #if defined(__mips__) && 0 /* XXX this is still hosed for some reason */
 		    && elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.1 src/usr.bin/ldd/build/Makefile:1.2
--- src/usr.bin/ldd/build/Makefile:1.1	Fri Apr 15 08:47:02 2011
+++ src/usr.bin/ldd/build/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/04/15 08:47:02 plunky Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/02 03:55:19 matt Exp $
 
 .include <bsd.own.mk>		# for MKDYNAMICROOT definition
 
@@ -8,9 +8,11 @@ MAN=	ldd.1
 
 .PATH: ${.CURDIR}/..
 
-.if (${MACHINE_ARCH} != "alpha")
+.if ${OBJECT_FMTS:Melf32} != ""
 LIB_ELF32DIR!=	cd ${.CURDIR}/../elf32 && ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_ELF32DIR}/libldd_elf32.a
+.else
+CPPFLAGS.ldd.c+= -DELF64_ONLY
 .endif
 
 .if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
@@ -18,14 +20,12 @@ LIB_ELF32COMPATDIR!=	cd ${.CURDIR}/../el
 EXTRA_LIBS+=		${LIB_ELF32COMPATDIR}/libldd_elf32_compat.a
 .endif
 
-.if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc64") || \
-    (${MACHINE_ARCH} == "x86_64") || (${MACHINE_ARCH} == "powerpc64") || \
-    (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+.if ${OBJECT_FMTS:Melf64} != ""
 LIB_ELF64DIR!=	cd ${.CURDIR}/../elf64 && ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_ELF64DIR}/libldd_elf64.a
-CPPFLAGS.ldd.c= -DELFSIZE=64
+CPPFLAGS.ldd.c+= -DELFSIZE=64
 .else
-CPPFLAGS.ldd.c= -DELFSIZE=32
+CPPFLAGS.ldd.c+= -DELFSIZE=32
 .endif
 
 LDADD+=	${EXTRA_LIBS}

Index: src/usr.bin/ldd/elf32/Makefile
diff -u src/usr.bin/ldd/elf32/Makefile:1.8 src/usr.bin/ldd/elf32/Makefile:1.9
--- src/usr.bin/ldd/elf32/Makefile:1.8	Wed Mar  9 23:10:08 2011
+++ src/usr.bin/ldd/elf32/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2011/03/09 23:10:08 joerg Exp $
+#	$NetBSD: Makefile,v 1.9 2014/03/02 03:55:19 matt Exp $
 
 .include <bsd.own.mk>
 .include <bsd.init.mk>
@@ -24,7 +24,7 @@ LIBISPRIVATE=	yes
 CPPFLAGS+=	-DRTLD_ARCH_SUBDIR=\"${MLIBDIR}\"
 .endif
 
-.if ${MACHINE_ARCH} != "alpha"
+.if ${OBJECT_FMTS:Melf32} != ""
 .include "../Makefile.elf"
 .endif
 

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.6 src/usr.bin/ldd/elf64/Makefile:1.7
--- src/usr.bin/ldd/elf64/Makefile:1.6	Wed Mar  9 23:10:08 2011
+++ src/usr.bin/ldd/elf64/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/03/09 23:10:08 joerg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/02 03:55:19 matt Exp $
 
 .include <bsd.own.mk>
 
@@ -11,9 +11,7 @@ SRCS=	dummy.c
 LIBISPRIVATE=	yes
 .PATH: ${.CURDIR}/..
 
-.if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc64") || \
-    (${MACHINE_ARCH} == "x86_64") || (${MACHINE_ARCH} == "powerpc64") || \
-    (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+.if ${OBJECT_FMTS:Melf64} != ""
 
 # XXX we need to make sure that we don't accidentally get the elf32
 # XXX versions of these.

Reply via email to