NetBSD-Bugs archive

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

Re: toolchain/47188: MKTOOLS=no broken



The following reply was made to PR toolchain/47188; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/47188: MKTOOLS=no broken
Date: Wed, 21 Nov 2012 09:41:52 +0200

 --4Ckj6UjgE2iN1+kY
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Disposition: inline
 
 Please try the attached patch.  It does the following:
 
 * tools/Makefile produces an error if TOOLDIR is not defined.  This
   change is independent of the others.
 
 * tools/Makefile builds host-mkdep, compat, and binstall in that order,
   before installing any of them.  It installs them in any order relative
   to each other.  The .WAIT points that used to be between these three
   tools are replaced by .ORDER and dependencies.
 
 * tools/compat/Makefile will install the library in
   ${TOOLDIR}/lib/libnbcompat.a, install the include files in
   ${TOOLDIR}/include/compat/**, and install defs.mk in
   ${TOOLDIR}/share/compat/defs.mk.  Previously, nothing from
   tools/compat was installed under TOOLDIR.
 
 * tools/compat/Makefile is adjusted to use an uninstalled copy of
   host-mkdep from the .OBJDIR of tools/host-mkdep, and an uninstalled
   copy of the install program from the .OBJDIR of tools/binstall.
   This allows it to be built after tools/host-mkdep is built but
   before tools/host-mkdep is installed; and to be installed after
   tools/binstall is built but before tools/binstall is installed.
 
 * tools/binstall/Makefile is adjusted to use an uninstalled copy of
   host-mkdep from the .OBJDIR of tools/host-mkdep.  It was already
   using an uninstalled copy of the compat library and headers from
   the .OBJDIR of tools/compat, but the way this is done has changed
   slightly.  This allows it to be built after tools/host-mkdep and
   tools/compat are built, but before they are installed; and to be
   installed after tools/binstall is built but before tools/binstall is
   installed.
 
 * tools/host-mkdep/Makefile is adjusted to look more like the Makefiles
   for other tools.  In particular, its install target uses the install
   program, instead of using "cp" commands.  In order for this to work
   after tools/binstall has been built but before tools/binstall has been
   installed, tools/host-mkdep uses the uninstalled copy of the install
   program from the the .OBJDIR of tools/binstall.
 
 * Everything else that uses libnbcompat and the associated header files
   is changed to use the versions that are installed under TOOLDIR.  This
   includes tools/Makefile.host, tools/*/Makefile, and a few Makefiles
   outside the tools directory.
 
 This has been tested via
 
        build.sh -T TOOLDIR -O OBJDIR tools
        rm -rf OBJDIR
        build.sh -T TOOLDIR -O OBJDIR -V MKTOOLS=no build
 
 --apb (Alan Barrett)
 
 --4Ckj6UjgE2iN1+kY
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="pr47188.diff"
 
 Index: bin/sh/Makefile
 ===================================================================
 --- bin/sh/Makefile    23 Aug 2011 10:47:06 -0000      1.98
 +++ bin/sh/Makefile    20 Nov 2012 21:24:16 -0000
 @@ -74,8 +74,7 @@ nodes.c nodes.h: mknodes.sh nodetypes no
        [ -f nodes.h ]
  
  .if ${USETOOLS} == "yes"
 -COMPATOBJDIR!=        cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 -NBCOMPATLIB=  -L${COMPATOBJDIR} -lnbcompat
 +NBCOMPATLIB=   -L${TOOLDIR}/lib -lnbcompat
  .endif
  
  .if make(install)
 Index: distrib/cdrom/macppc_installboot/Makefile
 ===================================================================
 --- distrib/cdrom/macppc_installboot/Makefile  25 Mar 2009 15:26:49 -0000      
1.8
 +++ distrib/cdrom/macppc_installboot/Makefile  20 Nov 2012 21:24:18 -0000
 @@ -24,9 +24,7 @@ cleaninc:
  .include <bsd.own.mk>
  
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=   cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 -.-include     "${COMPATOBJ}/defs.mk"
 -HOST_CPPFLAGS+=       -I${NETBSDSRCDIR}/tools/compat
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  .include <bsd.hostprog.mk>
 Index: distrib/cdrom/macppc_mkboothfs/Makefile
 ===================================================================
 --- distrib/cdrom/macppc_mkboothfs/Makefile    30 Mar 2009 11:22:46 -0000      
1.4
 +++ distrib/cdrom/macppc_mkboothfs/Makefile    20 Nov 2012 21:24:18 -0000
 @@ -9,9 +9,7 @@ CLEANFILES+=   boothfs
  .include <bsd.own.mk>
  
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=   cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 -.-include       "${COMPATOBJ}/defs.mk"
 -HOST_CPPFLAGS+=       -I${NETBSDSRCDIR}/tools/compat
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  
 Index: external/gpl3/gcc/usr.bin/Makefile.inc
 ===================================================================
 --- external/gpl3/gcc/usr.bin/Makefile.inc     18 Sep 2012 07:05:15 -0000      
1.11
 +++ external/gpl3/gcc/usr.bin/Makefile.inc     20 Nov 2012 21:24:16 -0000
 @@ -24,8 +24,7 @@ CPPFLAGS+=   -I.
  DPSRCS+= gmp.h mpfr.h mpf2mpfr.h mpc.h mpc-log.h
  
  .if ${USETOOLS} == "yes"
 -COMPATOBJDIR!=        cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 -NBCOMPATLIB=  -L${COMPATOBJDIR} -lnbcompat
 +NBCOMPATLIB=   -L${TOOLDIR}/lib -lnbcompat
  .endif
  
  GNUHOSTDIST=  ${DIST}
 Index: gnu/usr.bin/gcc4/Makefile.inc
 ===================================================================
 --- gnu/usr.bin/gcc4/Makefile.inc      30 May 2011 14:41:26 -0000      1.5
 +++ gnu/usr.bin/gcc4/Makefile.inc      20 Nov 2012 21:24:16 -0000
 @@ -11,8 +11,7 @@ CPPFLAGS+=   -DLOCALEDIR=\"/usr/share/loca
  HOST_CPPFLAGS+=       -I${.CURDIR}/..
  
  .if ${USETOOLS} == "yes"
 -COMPATOBJDIR!=        cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 -NBCOMPATLIB=  -L${COMPATOBJDIR} -lnbcompat
 +NBCOMPATLIB=   -L${TOOLDIR}/lib -lnbcompat
  .endif
  
  GNUHOSTDIST=  ${DIST}
 Index: tools/Makefile
 ===================================================================
 --- tools/Makefile     15 Nov 2012 23:51:54 -0000      1.159
 +++ tools/Makefile     20 Nov 2012 22:43:57 -0000
 @@ -6,6 +6,17 @@
  # plain make.
  .MAIN: build_install
  
 +# TOOLDIR must be valid, unless MKTOOLS=no
 +.if ${MKTOOLS:Uyes} != "no"
 +.if "${TOOLDIR}" == ""
 +.error "TOOLDIR is undefined or empty"
 +.elif "${TOOLDIR}:tW:M/*" == ""
 +.error "TOOLDIR is not an absolute path: ${TOOLDIR}"
 +#.elif !exists(TOOLDIR) # XXX .exists fails for directories
 +#.error "TOOLDIR does not exist: ${TOOLDIR}"
 +.endif
 +.endif # MKTOOLS != no
 +
  .if defined(HAVE_GCC) || defined(HAVE_PCC)
  TOOLCHAIN_BITS= gmake .WAIT
  .endif
 @@ -50,7 +61,7 @@ DTRACE_BITS=
  .if ${MKDTRACE} != "no"
  DTRACE_BITS+= .WAIT libelf
  DTRACE_BITS+= .WAIT libdwarf
 -DTRACE_BITS+= .WAIT libctf 
 +DTRACE_BITS+= .WAIT libctf
  DTRACE_BITS+= .WAIT ctfconvert ctfmerge
  .endif
  
 @@ -59,9 +70,28 @@ LINT_BITS=
  LINT_BITS= lint lint2
  .endif
  
 +# All of host-mkdep, compat, and binstall are needed before anything
 +# else.  Within this group, they must be built in a specific order, and
 +# all of them must be built before any of them is installed.  They may
 +# be installed in any order.  This can't be expressed using the .WAIT
 +# notation inside the SUBDIR list.
 +#
 +# XXX .ORDER does not work when multiple targets are passed on the
 +# make command line without "-j", so use dependencies in addition to .ORDER.
 +#
 +.ORDER: dependall-host-mkdep dependall-compat dependall-binstall
 +.if make(dependall-host-mkdep) && make(dependall-compat)
 +dependall-compat: dependall-host-mkdep
 +.endif
 +.if make(dependall-compat) && make(dependall-binstall)
 +dependall-binstall: dependall-compat
 +.endif
 +
  # Dependencies in SUBDIR below ordered to maximize parallel ability.
 -SUBDIR=       host-mkdep .WAIT compat .WAIT \
 -      binstall .WAIT mktemp .WAIT sed .WAIT \
 +# See above for special treatment for host-mkdep, compat, and binstall.
 +#
 +SUBDIR=       host-mkdep compat binstall \
 +      .WAIT mktemp .WAIT sed .WAIT \
                cap_mkdb crunchgen ctags genassym gencat hexdump join \
                ${LINT_BITS} \
                lorder makewhatis mkdep mtree nbperf .WAIT rpcgen tsort \
 @@ -172,12 +202,15 @@ check_MKTOOLS: .PHONY .NOTMAIN
  .endif
  
  .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"   # {
 +
 +SUBDIR= # empty
 +
  realall realdepend install: check_MKTOOLS
  
 -.for dir in ${SUBDIR:N.WAIT}
 -all-${dir} depend-${dir} dependall-${dir} install-${dir}:
 -      @true
 -.endfor
 +##.for dir in ${SUBDIR:N.WAIT}
 +##all-${dir} depend-${dir} dependall-${dir} install-${dir}:
 +##    @true
 +##.endfor
  .endif                                                        # }
  
  .include <bsd.subdir.mk>
 Index: tools/Makefile.host
 ===================================================================
 --- tools/Makefile.host        10 Apr 2011 16:52:36 -0000      1.28
 +++ tools/Makefile.host        20 Nov 2012 21:41:50 -0000
 @@ -7,8 +7,8 @@ NOMAN=         # defined
  .include <bsd.own.mk>
  
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=   cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -.-include     "${COMPATOBJ}/defs.mk"
 +# Use TOOLDIR copy of libnbcompat and associated *.h files
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  # Resolve pathnames in variables.
 Index: tools/binstall/Makefile
 ===================================================================
 --- tools/binstall/Makefile    3 Jul 2007 16:29:24 -0000       1.7
 +++ tools/binstall/Makefile    20 Nov 2012 21:24:10 -0000
 @@ -5,6 +5,21 @@ HOST_SRCDIR=  usr.bin/xinstall
  CPPFLAGS+=    -I${.CURDIR}/../compat/sys
  CPPFLAGS+=    -DTARGET_STRIP=\"${STRIP}\"
  
 +# Prevent Makefile.host from trying to use the version of libnbcompat
 +# from ${TOOLDIR}.
 +NOCOMPATLIB=
 +
  .include "${.CURDIR}/../Makefile.host"
  
 +# Use uninstalled copy of host-mkdep
 +HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR}
 +HOST_MKDEP=   ${HOST_MKDEP_OBJ}/host-mkdep
 +MKDEP=                ${HOST_MKDEP}
 +
 +# Use uninstalled copy of libnbcompat and associated *.h files
 +COMPATLIB_UNINSTALLED= yes
 +COMPATOBJ!=   cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 +.-include     "${COMPATOBJ}/defs.mk"
 +
 +# Use uninstalled copy of the install program
  INSTALL=      ./xinstall
 Index: tools/compat/Makefile
 ===================================================================
 --- tools/compat/Makefile      4 Jun 2012 19:06:45 -0000       1.59
 +++ tools/compat/Makefile      20 Nov 2012 21:41:27 -0000
 @@ -55,6 +55,7 @@ CPPFLAGS+=   -I. -I./include -I${.CURDIR} 
  
  DPSRCS+=      defs.mk
  CLEANFILES+=  config.log config.status configure.lineno *.stamp
 +CLEANDIRFILES+=       defs.mk config.cache confdefs.h
  
  # Get components of Berkeley DB.
  _CURDIR:=     ${.CURDIR}
 @@ -72,22 +73,72 @@ config.cache: include/.stamp configure n
  defs.mk: config.cache
        @touch ${.TARGET}
  
 -# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
 -# configure.ac.  See more detailed instructions in configure.ac.
 -regen:
 -      cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
 -      cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
 -
  include/.stamp:
 -      mkdir -p include/sys include/machine include/rpc include/arpa
 +      mkdir -p ${INCSUBDIRS:@d@ include/$d @}
        @touch ${.TARGET}
  
 -cleandir:
 -      -rm -f nbtool_config.h confdefs.h defs.mk
 -      -rm -r -f include
 -      -rm -f config.cache
 +INCFILES=     nbtool_config.h
 +INCSUBDIRS=   sys machine rpc arpa
 +CLEANDIRFILES+= ${INCFILES}
 +
 +# CLEANDIRFILES may not contain directory names
 +cleandir:     cleandir.include
 +cleandir.include: .PHONY
 +              rm -rf include
 +
 +# Install rules
 +
 +HOST_LIBDIR=  ${TOOLDIR}/lib
 +HOST_INCSDIR= ${TOOLDIR}/include
 +HOST_SHAREDIR= ${TOOLDIR}/share
 +
 +install:      .PHONY install.lib install.includes install.defs.mk
 +
 +# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib
 +install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a
 +${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a
 +      ${_MKTARGET_INSTALL}
 +      ${HOST_INSTALL_DIR} ${HOST_LIBDIR}
 +      ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
 +
 +# Install include files in ${TOOLDIR}/include/compat
 +install.includes: .PHONY
 +      ${_MKMSG_INSTALL} "${HOST_INCSDIR}/*"
 +      ${HOST_INSTALL_DIR} ${HOST_INCSDIR}
 +      ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat
 +      ${HOST_INSTALL_FILE} ${INCFILES} ${HOST_INCSDIR}/compat/
 +.for _d in ${INCSUBDIRS}
 +      ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat/${_d}
 +      touch include/${_d}/dummy # ensure dir is not empty
 +      ${HOST_INSTALL_FILE} include/${_d}/* ${HOST_INCSDIR}/compat/${_d}/
 +.endfor
 +
 +# Install defs.mk in ${TOOLDIR}/share/compat
 +install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
 +${HOST_SHAREDIR}/compat/defs.mk: defs.mk
 +      ${_MKTARGET_INSTALL}
 +      ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}
 +      ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat
 +      ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
 +
 +# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS
  
  HOST_CPPFLAGS:=       ${CPPFLAGS}
  CPPFLAGS:=    # empty
  
  .include <bsd.hostlib.mk>
 +
 +# Use uninstalled copy of host-mkdep
 +HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR}
 +HOST_MKDEP=   ${HOST_MKDEP_OBJ}/host-mkdep
 +MKDEP=                ${HOST_MKDEP}
 +
 +# Use uninstalled copy of the install program
 +INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
 +INSTALL=      ${INSTALL_OBJ}/xinstall
 +
 +# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
 +# configure.ac.  See more detailed instructions in configure.ac.
 +regen:
 +      cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
 +      cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
 Index: tools/compat/defs.mk.in
 ===================================================================
 --- tools/compat/defs.mk.in    14 Aug 2011 20:22:42 -0000      1.10
 +++ tools/compat/defs.mk.in    20 Nov 2012 21:24:19 -0000
 @@ -1,8 +1,72 @@
  #     $NetBSD: defs.mk.in,v 1.10 2011/08/14 20:22:42 apb Exp $
 +#
 +# Makefile fragment for building with libnbcompat and associated
 +# include files.  It can also be used for building just with
 +# the include files, without the library.
 +#
 +# This can be used when the library and include files have been installed
 +# into TOOLDIR (by "make install" in the src/tools/compat directory),
 +# or when they have not been installed into TOOLDIR but reside
 +# in the .OBJDIR associated with src/tools/compat.
 +#
 +# Variables:
 +#
 +# COMPATLIB_UNINSTALLED:
 +#             If "yes", then use the files from the .OBJDIR of
 +#             NETBSDSRCDIR/tools/compat.  Otherwise, use the files
 +#             from TOOLDIR.
 +#
 +# COMPATLIB_NO_LIB:
 +#             If "yes" then do not use the library (but still use
 +#             the include files).
 +#
 +# Examples:
 +#
 +# * Use uninstalled copy of libnbcompat and associated *.h files:
 +#
 +#     COMPATLIB_UNINSTALLED= yes
 +#     COMPATOBJ!=     cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
 +#     .-include       "${COMPATOBJ}/defs.mk"
 +#
 +# * Use TOOLDIR copy of libnbcompat and associated *.h files:
 +#
 +#     .-include       "${TOOLDIR}/share/compat/defs.mk"
 +#
 +# * Use TOOLDIR copy of compat *.h files, but do not use libnbcompat.a:
 +#
 +#     COMPATLIB_NO_LIB= yes
 +#     .-include       "${TOOLDIR}/share/compat/defs.mk"
 +#
 +# The use of ".-include" instead of ".include" above is because it's
 +# expected that the file might not exist during "make obj" or "make clean".
 +#
 +
 +.include <bsd.own.mk>
 +
 +# Use the installed (TOOLDIR) version of the library and headers by default
 +COMPATLIB_UNINSTALLED ?= no
 +# Use library and includes by default.
 +COMPATLIB_NO_LIB ?= no
  
 +.if "${COMPATLIB_UNINSTALLED}" == "yes"
 +# The library lives in the .OBJDIR.
 +#
 +# Some include files live directly in the .OBJDIR, while others
 +# live in subdirectories of .OBJDIR/include.
 +#
  COMPATOBJ:=   ${.PARSEDIR}
 -HOSTEXEEXT=   @EXEEXT@
 +COMPATLIBDIR= ${COMPATOBJ}
 +COMPATINCFLAGS=       -I${COMPATOBJ} -I${COMPATOBJ}/include
 +.else
 +# The library lives in TOOLDIR/lib.
 +#
 +# All include files live in TOOLDIR/include/comnpat, and its subdirectories.
 +#
 +COMPATLIBDIR= ${TOOLDIR}/lib
 +COMPATINCFLAGS=       -I${TOOLDIR}/include/compat
 +.endif
  
 +HOSTEXEEXT=   @EXEEXT@
  HOST_BSHELL=  @BSHELL@
  
  BUILD_OSTYPE!=  uname -s
 @@ -12,11 +76,12 @@ BUILD_OSTYPE!=  uname -s
  HOST_CPPFLAGS+=       -no-cpp-precomp
  .endif
  
 -HOST_CPPFLAGS+=       -I${COMPATOBJ} -I${COMPATOBJ}/include \
 -              -I${.CURDIR}/../compat -DHAVE_NBTOOL_CONFIG_H=1 \
 -              -D_FILE_OFFSET_BITS=64
 +HOST_CPPFLAGS+=       ${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
 +              -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
  
 -DPADD+=               ${COMPATOBJ}/libnbcompat.a
 -LDADD+=               -L${COMPATOBJ} -lnbcompat @LIBS@
 +.if "${COMPATLIB_NO_LIB}" != "yes"
 +DPADD+=               ${COMPATLIBDIR}/libnbcompat.a
 +LDADD+=               -L${COMPATLIBDIR} -lnbcompat @LIBS@
 +.endif # ! COMPATLIB_NO_LIB
  
  HAVE_PTHREAD_H=       @HAVE_PTHREAD_H@
 Index: tools/genassym/Makefile
 ===================================================================
 --- tools/genassym/Makefile    25 Oct 2008 22:15:28 -0000      1.5
 +++ tools/genassym/Makefile    20 Nov 2012 21:24:14 -0000
 @@ -4,9 +4,7 @@
  
  .PATH.sh:     ${.CURDIR}/../../usr.bin/genassym
  
 -COMPATOBJ!=   cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -.-include     "${COMPATOBJ}/defs.mk"
 -
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  
  TIMESTAMP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
  
 Index: tools/groff/Makefile
 ===================================================================
 --- tools/groff/Makefile       25 Oct 2008 22:15:28 -0000      1.29
 +++ tools/groff/Makefile       20 Nov 2012 21:24:14 -0000
 @@ -29,10 +29,9 @@ _post_conf: .USE
  
  
  .include "${.CURDIR}/../Makefile.gnuhost"
 -COMPATOBJ!=   cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -.-include     "${COMPATOBJ}/defs.mk"
 +.-include "${TOOLDIR}/share/compat/defs.mk"
  
 -.PATH:                ${.CURDIR}/../../share/tmac 
${.CURDIR}/../../gnu/usr.bin/groff/tmac
 +.PATH:        ${.CURDIR}/../../share/tmac 
${.CURDIR}/../../gnu/usr.bin/groff/tmac
  
  _installtmac: .USE
  .if ${MKUPDATE} != "no"
 Index: tools/host-mkdep/Makefile
 ===================================================================
 --- tools/host-mkdep/Makefile  19 Oct 2008 22:05:23 -0000      1.10
 +++ tools/host-mkdep/Makefile  20 Nov 2012 21:24:04 -0000
 @@ -1,27 +1,48 @@
  #     $NetBSD: Makefile,v 1.10 2008/10/19 22:05:23 apb Exp $
  
 -TIMESTAMP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
 +HOSTPROG=     host-mkdep
 +HOSTPROGNAME= ${_TOOL_PREFIX}host-mkdep
 +HOST_BINDIR=  ${TOOLDIR}/bin
 +
 +NOMAN=        # defined
 +SRCS= # empty
  
  CLEANFILES+=  config.cache config.log config.status host-mkdep
  
  .include <bsd.hostprog.mk>
  
 -# When host-mkdep is built, TOOL_AWK is not yet available, so we do not
 -# pass AWK=${TOOL_AWK:Q} to configure; we allow configure to find awk
 -# for itself (or complain if it can't find awk).
 +# XXX: The configure script needs to use awk, but we can't pass
 +# AWK=${TOOL_AWK:Q} in CONFIGURE_ENV, because TOOL_AWK is not yet
 +# available at the time that host-mkdep is built.  The configure script
 +# will try to find some other version of awk.
 +#
 +CONFIGURE_ENV=        CC=${HOST_CC:Q}
  
  realall: host-mkdep
  host-mkdep: configure host-mkdep.in
        -rm -f $@
 -      CC=${HOST_CC:Q} ${HOST_SH} ${.CURDIR}/configure 
--cache-file=config.cache
 +      ${CONFIGURE_ENV} \
 +          ${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
        chmod +x $@
  
 -# This is the only program that comes before binstall.
 -install: ${TIMESTAMP}
 -${TIMESTAMP}: host-mkdep
 -      mkdir -p ${TOOLDIR}/bin
 -      cp host-mkdep $@
 -      chmod +x $@
 +# Use uninstalled copy of the install program
 +INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
 +INSTALL=      ${INSTALL_OBJ}/xinstall
 +
 +# Install rule, copied from src/tools/Makefile.host.
 +# We can't include Makefile.host because there is no HOST_SRCDIR
 +# corresponding to host-mkdep.
 +#
 +realinstall: install.host
 +install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
 +${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
 +      ${_MKTARGET_INSTALL}
 +      mkdir -p ${HOST_BINDIR}
 +      ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
 +
 +.if ${MKUPDATE} == "no"
 +.PHONY:               ${HOST_BINDIR}/${HOSTPROGNAME}
 +.endif
  
  # Run by hand, then "configure" script committed:
  regen:
 Index: tools/libctf/Makefile
 ===================================================================
 --- tools/libctf/Makefile      17 Apr 2011 12:52:26 -0000      1.3
 +++ tools/libctf/Makefile      20 Nov 2012 21:24:14 -0000
 @@ -23,8 +23,8 @@ LIBELF_DIR=  ${.CURDIR}/../../external/bs
  CPPFLAGS+=    -DCTF_OLD_VERSIONS
  
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=     cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -CPPFLAGS+=    -I${COMPATOBJ}
 +COMPATLIB_NO_LIB= yes # only the include files, not the library
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  CPPFLAGS+=    -I${.CURDIR}/../compat \
 Index: tools/libdwarf/Makefile
 ===================================================================
 --- tools/libdwarf/Makefile    17 Apr 2011 12:52:26 -0000      1.3
 +++ tools/libdwarf/Makefile    20 Nov 2012 21:24:14 -0000
 @@ -25,8 +25,8 @@ INCS=                dwarf.h libdwarf.h
  INCSDIR=      /usr/include
  
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=     cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -CPPFLAGS+=    -I${COMPATOBJ}
 +COMPATLIB_NO_LIB= yes # only the include files, not the library
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  CPPFLAGS+=    -I${.CURDIR}/../compat -I${LIBDWARF_DIR} -I${LIBELF_DIR}
 Index: tools/libelf/Makefile
 ===================================================================
 --- tools/libelf/Makefile      17 Apr 2011 12:52:26 -0000      1.5
 +++ tools/libelf/Makefile      20 Nov 2012 21:24:14 -0000
 @@ -67,8 +67,8 @@ CPPFLAGS+=   -no-cpp-precomp
  
  CPPFLAGS+=    -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
  .ifndef NOCOMPATLIB
 -COMPATOBJ!=     cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -CPPFLAGS+=    -I${COMPATOBJ}
 +COMPATLIB_NO_LIB= yes # only the include files, not the library
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  .endif
  
  .PATH:                ${LIBELF_DIR}
 Index: tools/lorder/Makefile
 ===================================================================
 --- tools/lorder/Makefile      25 Oct 2008 22:15:28 -0000      1.11
 +++ tools/lorder/Makefile      20 Nov 2012 21:24:14 -0000
 @@ -2,8 +2,7 @@
  
  .include <bsd.own.mk>
  
 -COMPATOBJ!=   cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
 -.-include     "${COMPATOBJ}/defs.mk"
 +.-include     "${TOOLDIR}/share/compat/defs.mk"
  
  TIMESTAMP=    ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
  
 
 --4Ckj6UjgE2iN1+kY--
 


Home | Main Index | Thread Index | Old Index