Index: Makefile =================================================================== RCS file: /p/gcc-4.8.1/cvsroot/gcc/lib/libstdc++-v3/include/bits/Makefile,v retrieving revision 1.9 diff -p -r1.9 Makefile *** Makefile 24 Oct 2013 16:29:07 -0000 1.9 --- Makefile 5 Nov 2013 22:00:47 -0000 *************** INCS= ${G_bits_headers} ${G_c_base_head *** 16,26 **** INCS+= gthr.h gthr-single.h gthr-posix.h gthr-default.h INCS+= ${BUILDINCS} - INCS+= c++config.h # libsupc++ INCS+= nested_exception.h hash_bytes.h atomic_lockfree_defines.h INCS+= cxxabi_forced.h exception_defines.h exception_ptr.h INCSDIR= /usr/include/g++/bits .include "${.CURDIR}/../Makefile.includes" --- 16,31 ---- INCS+= gthr.h gthr-single.h gthr-posix.h gthr-default.h INCS+= ${BUILDINCS} # libsupc++ INCS+= nested_exception.h hash_bytes.h atomic_lockfree_defines.h INCS+= cxxabi_forced.h exception_defines.h exception_ptr.h + .if ${MKCOMPAT} != no + SUBDIR+= arch + .else + INCS+= c++config.h + .endif + INCSDIR= /usr/include/g++/bits .include "${.CURDIR}/../Makefile.includes" *************** time_members.h: $(G_CTIME_H) *** 48,50 **** --- 53,56 ---- # Get default targets including . .include + .include Index: arch/Makefile =================================================================== RCS file: arch/Makefile diff -N arch/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,35 ---- + # $NetBSD$ + + # install multilib c++config.h files + + .if ${MACHINE_ARCH} == "sparc64" + SUBDIR= sparc sparc64 + CXXCONFIGARGS= sparc64 _LP64 sparc + .endif + + .if ${MACHINE_ARCH} == "x86_64" + #SUBDIR= i386 x86_64 + CXXCONFIGARGS= x86_64 _LP64 i386 + .endif + + .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" + #SUBDIR= mips64 mips32 mipso32 + CXXCONFIGARGS= mips64 _ABI64 mipso32 _ABIO32 mips32 + .endif + + # XXX arm variants are missing + + + # now install the generated front end + + c++config.h: Makefile mkcxxconfig_h.sh + ${HOST_SH} ${.CURDIR}/mkcxxconfig_h.sh ${CXXCONFIGARGS} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + CLEANFILES+= c++config.h + + INCS+= c++config.h + #INCSNAME_c++config.h= cxxconfig.h + INCSDIR= /usr/include/g++/bits + + .include + .include Index: arch/Makefile.arch_bits =================================================================== RCS file: arch/Makefile.arch_bits diff -N arch/Makefile.arch_bits *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/Makefile.arch_bits 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,11 ---- + # $NetBSD$ + + # define GCC_MACHINE_ARCH before including this. + + INCS+= c++config.h + INCSDIR= /usr/include/g++/bits/${GCC_MACHINE_ARCH} + + .PATH: ${.CURDIR}/../../../../arch/${GCC_MACHINE_ARCH} + + # Get default targets including . + .include Index: arch/mkcxxconfig_h.sh =================================================================== RCS file: arch/mkcxxconfig_h.sh diff -N arch/mkcxxconfig_h.sh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/mkcxxconfig_h.sh 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,83 ---- + #! /bin/sh + # + # Copyright (c) 2013 Matthew R. Green + # All rights reserved. + # + # 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. The name of the author may not be used to endorse or promote products + # derived from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + + # + # Generate a c++config.h that will include the correct multilib c++config.h + # + # mkcxxconfig_h.sh [[ ] ...] + # + # generates a series of #ifdef 's with the final being the default + # + + emit_intro() { + cat <<'__EOH1__' + /* $NetBSD$ */ + + /* This file is automatically generated. DO NOT EDIT! */ + __EOH1__ + + netbsd_id=$(echo '$NetBSD$' | sed 's,[#$],,g;s,.*,&,') + cat <<__EOH2__ + /* Generated from: $netbsd_id */ + + __EOH2__ + } + + emit_final() { + echo "#endif" + } + + # $1 - arch to include + emit_include() { + echo "#include "'"'"bits/$1/c++config.h"'"' + } + + # $1 - define to ifdef + ifdef=ifdef + emit_ifdef() { + echo "#$ifdef $1" + ifdef="elif" + } + + main() { + emit_intro + while [ $# -gt 0 ]; do + if [ $# -eq 1 ]; then + echo '#else' + emit_include $1 + break + fi + emit_ifdef $2 + emit_include $1 + shift + shift + done + emit_final + } + + main "$@" Index: arch/i386/Makefile =================================================================== RCS file: arch/i386/Makefile diff -N arch/i386/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/i386/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=i386 + .include "../Makefile.arch_bits" Index: arch/mips32/Makefile =================================================================== RCS file: arch/mips32/Makefile diff -N arch/mips32/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/mips32/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=mips32 + .include "../Makefile.arch_bits" Index: arch/mips64/Makefile =================================================================== RCS file: arch/mips64/Makefile diff -N arch/mips64/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/mips64/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=mips64 + .include "../Makefile.arch_bits" Index: arch/mipso32/Makefile =================================================================== RCS file: arch/mipso32/Makefile diff -N arch/mipso32/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/mipso32/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=mipso32 + .include "../Makefile.arch_bits" Index: arch/sparc/Makefile =================================================================== RCS file: arch/sparc/Makefile diff -N arch/sparc/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/sparc/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=sparc + .include "../Makefile.arch_bits" Index: arch/sparc64/Makefile =================================================================== RCS file: arch/sparc64/Makefile diff -N arch/sparc64/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/sparc64/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=sparc64 + .include "../Makefile.arch_bits" Index: arch/x86_64/Makefile =================================================================== RCS file: arch/x86_64/Makefile diff -N arch/x86_64/Makefile *** /dev/null 1 Jan 1970 00:00:00 -0000 --- arch/x86_64/Makefile 5 Nov 2013 22:00:47 -0000 *************** *** 0 **** --- 1,4 ---- + # $NetBSD$ + + GCC_MACHINE_ARCH=x86_64 + .include "../Makefile.arch_bits"