Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/stand Convert fixcoff into a true host tool ...



details:   https://anonhg.NetBSD.org/src/rev/9ca06230f915
branches:  trunk
changeset: 556261:9ca06230f915
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Dec 11 00:27:42 2003 +0000

description:
Convert fixcoff into a true host tool by making it under tools.

diffstat:

 sys/arch/macppc/stand/Makefile              |   9 +++-
 sys/arch/macppc/stand/fixcoff/Makefile      |  19 +++------
 sys/arch/macppc/stand/fixcoff/fixcoff.c     |   6 ++-
 sys/arch/macppc/stand/fixcoff/nb_progname.c |  58 -----------------------------
 sys/arch/macppc/stand/ofwboot/Makefile      |  19 +++------
 5 files changed, 26 insertions(+), 85 deletions(-)

diffs (165 lines):

diff -r 6678385475b6 -r 9ca06230f915 sys/arch/macppc/stand/Makefile
--- a/sys/arch/macppc/stand/Makefile    Thu Dec 11 00:22:29 2003 +0000
+++ b/sys/arch/macppc/stand/Makefile    Thu Dec 11 00:27:42 2003 +0000
@@ -1,5 +1,10 @@
-#      $NetBSD: Makefile,v 1.4 2002/05/18 04:06:12 lukem Exp $
+#      $NetBSD: Makefile,v 1.5 2003/12/11 00:27:42 matt Exp $
+
+.include <bsd.own.mk>
 
-SUBDIR=        bootxx fixcoff ofwboot
+.if ${USETOOLS} != "yes"
+SUBDIR=                fixcoff .WAIT
+.endif
+SUBDIR+=       bootxx ofwboot
 
 .include <bsd.subdir.mk>
diff -r 6678385475b6 -r 9ca06230f915 sys/arch/macppc/stand/fixcoff/Makefile
--- a/sys/arch/macppc/stand/fixcoff/Makefile    Thu Dec 11 00:22:29 2003 +0000
+++ b/sys/arch/macppc/stand/fixcoff/Makefile    Thu Dec 11 00:27:42 2003 +0000
@@ -1,14 +1,9 @@
-#      $NetBSD: Makefile,v 1.5 2003/12/10 23:45:25 matt Exp $
-
-NOMAN=  # defined
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.6 2003/12/11 00:27:42 matt Exp $
 
-HOSTPROG=   fixcoff
-SRCS=    fixcoff.c nb_progname.c
-
+.if ${USETOOLS} == "yes"
+PROG=          fixcoff
+.include <bsd.prog.mk>
+.else
+HOSTPROG=      fixcoff
 .include <bsd.hostprog.mk>
-
-COMPATOBJ!=    cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
-.-include      "${COMPATOBJ}/defs.mk"
-
+.endif
diff -r 6678385475b6 -r 9ca06230f915 sys/arch/macppc/stand/fixcoff/fixcoff.c
--- a/sys/arch/macppc/stand/fixcoff/fixcoff.c   Thu Dec 11 00:22:29 2003 +0000
+++ b/sys/arch/macppc/stand/fixcoff/fixcoff.c   Thu Dec 11 00:27:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fixcoff.c,v 1.7 2003/12/10 23:36:07 matt Exp $ */
+/*     $NetBSD: fixcoff.c,v 1.8 2003/12/11 00:27:42 matt Exp $ */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -41,6 +41,10 @@
  * Partially inspired by hack-coff, written by Paul Mackerras.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff -r 6678385475b6 -r 9ca06230f915 sys/arch/macppc/stand/fixcoff/nb_progname.c
--- a/sys/arch/macppc/stand/fixcoff/nb_progname.c       Thu Dec 11 00:22:29 2003 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*     $NetBSD: nb_progname.c,v 1.1 2001/10/20 06:14:30 jmc Exp $      */
-
-/*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Todd Vierling.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Stub to emulate [gs]etprogname() where needed. */
-
-#ifdef __NetBSD__
-#include <sys/param.h>
-#if !defined(__NetBSD_Version__) || (__NetBSD_Version__ < 106000000)
-#undef __NetBSD__
-#endif
-#endif
-
-#ifndef __NetBSD__
-const char *ln_progname;
-
-void setprogname(const char *progname) {
-       ln_progname = progname;
-}
-
-const char *getprogname(void) {
-       return ln_progname;
-}
-#endif
diff -r 6678385475b6 -r 9ca06230f915 sys/arch/macppc/stand/ofwboot/Makefile
--- a/sys/arch/macppc/stand/ofwboot/Makefile    Thu Dec 11 00:22:29 2003 +0000
+++ b/sys/arch/macppc/stand/ofwboot/Makefile    Thu Dec 11 00:27:42 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.38 2003/10/26 07:25:36 lukem Exp $
+#      $NetBSD: Makefile,v 1.39 2003/12/11 00:27:42 matt Exp $
 
 S=     ${.CURDIR}/../../../..
 
@@ -32,15 +32,10 @@
 .if !defined(FIXCOFF)
 .include <bsd.own.mk>
 
-FIXCOFFDIR!=   cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
-FIXCOFF=       ${FIXCOFFDIR}/fixcoff
-FIXCOFFTARG=   ${FIXCOFF}
-
-${FIXCOFF}:
-       (cd ${.CURDIR}/../fixcoff; ${MAKE})
-
-.else
-FIXCOFFTARG=
+.if !defined(TOOL_MACPPCFIXCOFF)
+TOOL_MACPPCFIXCOFFDIR!=        cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
+TOOL_MACPPCFIXCOFF=    ${FIXCOFFDIR}/fixcoff
+.endif
 .endif
 
 NEWVERSWHAT=   "OpenFirmware Boot"
@@ -107,10 +102,10 @@
        ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
            ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
 
-${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
+${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN}
        ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
            -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg  ${XCOFFXTRAOBJ} \
            ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
        ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
            ${PROG}.mrg ${PROG}.xcf
-       ${FIXCOFF} ${PROG}.xcf
+       ${TOOL_MACPPCFIXCOFF} ${PROG}.xcf



Home | Main Index | Thread Index | Old Index