Delete tools directory
This commit is contained in:
parent
312c559153
commit
e5f749ce80
281
tools/Makefile
281
tools/Makefile
|
|
@ -1,281 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.182 2015/07/23 08:03:26 mrg Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.endian.mk>
|
||||
|
||||
.if defined(__MINIX)
|
||||
# Some tools do not compile warning free with newer toolchains.
|
||||
NOGCCERROR= yes
|
||||
NOCLANGERROR= yes
|
||||
.endif # defined(__MINIX)
|
||||
# Make sure that the ordered build/install processing applies when using
|
||||
# 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
|
||||
|
||||
# TOOLS_BUILDRUMP == yes builds only the subset of the tools required
|
||||
# for building rump kernels and the hypervisor. It is typically used
|
||||
# when building rump kernels targeted for non-NetBSD systems (via
|
||||
# buildrump.sh), and should not be set for a regular "make build".
|
||||
TOOLS_BUILDRUMP?=no
|
||||
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
. if defined(HAVE_GCC) && ${HAVE_GCC} > 0
|
||||
TOOLCHAIN_BITS= gmake .WAIT
|
||||
TOOLCHAIN_BITS+= gmp .WAIT
|
||||
TOOLCHAIN_BITS+= mpfr .WAIT
|
||||
TOOLCHAIN_BITS+= mpc .WAIT
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= binutils .WAIT
|
||||
.endif
|
||||
|
||||
.if defined(HAVE_GCC) && ${HAVE_GCC} > 0
|
||||
. if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= gcc
|
||||
.if !defined(__MINIX)
|
||||
# The following test is broken as it still tries to create the directory
|
||||
. if ${MKCROSSGDB:Uno} != "no" || make(obj)
|
||||
TOOLCHAIN_BITS+= gdb
|
||||
. endif
|
||||
.endif # !defined(__MINIX)
|
||||
TOOLCHAIN_BITS+= .WAIT
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.if defined(HAVE_PCC)
|
||||
. if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= pcc
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.if !defined(__MINIX)
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
# XXX Eventually, we want to be able to build dbsym and mdsetimage
|
||||
# XXX if EXTERNAL_TOOLCHAIN is set.
|
||||
TOOLCHAIN_BITS+= dbsym mdsetimage
|
||||
.endif
|
||||
.endif # !defined(__MINIX)
|
||||
|
||||
DTRACE_BITS=
|
||||
.if ${MKDTRACE} != "no" || ${MKCTF} != "no"
|
||||
DTRACE_BITS+= .WAIT libelf
|
||||
DTRACE_BITS+= .WAIT libdwarf
|
||||
DTRACE_BITS+= .WAIT libctf
|
||||
.endif
|
||||
.if ${MKCTF} != "no"
|
||||
DTRACE_BITS+= .WAIT ctfconvert ctfmerge
|
||||
.endif
|
||||
|
||||
LINT_BITS=
|
||||
.if ${MKLINT} != "no"
|
||||
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.
|
||||
# See above for special treatment for host-mkdep, compat, and binstall.
|
||||
#
|
||||
SUBDIR= host-mkdep compat binstall \
|
||||
.WAIT mktemp .WAIT sed .WAIT genassym
|
||||
.if ${TOOLS_BUILDRUMP} == "no"
|
||||
SUBDIR+= gencat \
|
||||
${LINT_BITS} \
|
||||
makewhatis mtree nbperf .WAIT uudecode
|
||||
.endif
|
||||
|
||||
SUBDIR+= cat join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
|
||||
|
||||
.if ${TOOLS_BUILDRUMP} == "no"
|
||||
SUBDIR += .WAIT texinfo \
|
||||
.WAIT tic \
|
||||
.WAIT pax \
|
||||
.WAIT ${TOOLCHAIN_BITS} \
|
||||
${DTRACE_BITS} \
|
||||
cksum \
|
||||
file \
|
||||
makefs .WAIT mkcsmapper mkesdb mklocale \
|
||||
.WAIT \
|
||||
.WAIT \
|
||||
.WAIT \
|
||||
.WAIT installboot \
|
||||
pwd_mkdb strfile zic
|
||||
.endif
|
||||
SUBDIR+= stat .WAIT
|
||||
|
||||
.if defined(__MINIX)
|
||||
SUBDIR += \
|
||||
mkfs.mfs \
|
||||
partition \
|
||||
toproto
|
||||
.else
|
||||
SUBDIR+= .WAIT config
|
||||
.endif # defined(__MINIX)
|
||||
|
||||
.if ${MKLLVM} != "no"
|
||||
SUBDIR+= \
|
||||
llvm .WAIT \
|
||||
llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
|
||||
llvm-tblgen llvm-clang-tblgen .WAIT \
|
||||
llvm-include .WAIT \
|
||||
llvm-lib .WAIT \
|
||||
llvm-clang
|
||||
. if ${MKLLD} != "no"
|
||||
SUBDIR+= llvm-lld
|
||||
. endif
|
||||
. if ${MKMCLINKER} != "no"
|
||||
SUBDIR+= llvm-mcld
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
|
||||
. if ${MKGROFF} != "no"
|
||||
SUBDIR+= groff
|
||||
. endif
|
||||
SUBDIR+= mandoc
|
||||
.endif
|
||||
|
||||
.if ${TOOLS_BUILDRUMP} == "no"
|
||||
|
||||
.if ${MKMAINTAINERTOOLS:Uno} != "no"
|
||||
SUBDIR+= autoconf .WAIT gettext
|
||||
.endif
|
||||
|
||||
.if ${USE_PIGZGZIP} != "no"
|
||||
SUBDIR+= pigz
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "hppa"
|
||||
SUBDIR+= hppa-mkboot
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "ibmnws"
|
||||
SUBDIR+= ibmnws-ncdcs
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "macppc"
|
||||
SUBDIR+= macppc-fixcoff
|
||||
.endif
|
||||
|
||||
.if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
|
||||
SUBDIR+= powerpc-mkbootimage
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_ARCH} == "m68k"
|
||||
SUBDIR+= m68k-elf2aout
|
||||
.endif
|
||||
|
||||
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
|
||||
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb")
|
||||
SUBDIR+= mips-elf2ecoff
|
||||
.endif
|
||||
|
||||
.if (${MACHINE} == "sgimips")
|
||||
SUBDIR+= sgivol
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "acorn32"
|
||||
SUBDIR+= sparkcrc
|
||||
.endif
|
||||
|
||||
.if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
|
||||
SUBDIR+= fgen
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "amiga"
|
||||
SUBDIR+= amiga-elf2bb
|
||||
SUBDIR+= amiga-txlt
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "hp300"
|
||||
SUBDIR+= hp300-mkboot
|
||||
.endif
|
||||
|
||||
.if !defined(__MINIX)
|
||||
.if ${MACHINE} == "evbarm" \
|
||||
&& ${MACHINE_CPU} == "arm" \
|
||||
&& ${TARGET_ENDIANNESS} == "1234"
|
||||
SUBDIR+= elftosb
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
|
||||
${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
|
||||
SUBDIR+= mkubootimage
|
||||
.endif
|
||||
.endif # !defined(__MINIX)
|
||||
|
||||
.if ${MKX11} != "no"
|
||||
SUBDIR+= makestrs
|
||||
SUBDIR+= makekeys
|
||||
.endif
|
||||
|
||||
.endif # TOOLCHAIN_BUILDRUMP
|
||||
|
||||
check_MKTOOLS: .PHONY .NOTMAIN
|
||||
.if ${MKTOOLS:Uyes} == "no"
|
||||
@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
|
||||
@echo '*** updating your host toolchain. This should be used only as a'
|
||||
@echo '*** temporary workaround for toolchain problems, as it will result'
|
||||
@echo '*** in version skew and build errors over time!'
|
||||
.endif
|
||||
|
||||
.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # {
|
||||
SUBDIR= # empty
|
||||
realall realdepend install: check_MKTOOLS
|
||||
.endif # }
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
.include <bsd.buildinstall.mk>
|
||||
.include <bsd.obj.mk>
|
||||
|
||||
.if !defined(PREVIOUSTOOLDIR)
|
||||
. if exists(PREVIOUSTOOLDIR)
|
||||
PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
|
||||
. else
|
||||
PREVIOUSTOOLDIR=
|
||||
. endif
|
||||
.endif
|
||||
|
||||
CLEANFILES+= PREVIOUSTOOLDIR
|
||||
|
||||
realall realdepend: .MAKE
|
||||
.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
|
||||
@echo "*** WARNING: TOOLDIR has moved?"
|
||||
@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
|
||||
@echo "*** != TOOLDIR '${TOOLDIR}'"
|
||||
@echo "*** Cleaning mis-matched tools"
|
||||
rm -f PREVIOUSTOOLDIR
|
||||
(cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
|
||||
.endif
|
||||
echo ${TOOLDIR} >PREVIOUSTOOLDIR
|
||||
|
||||
cleandir:
|
||||
rm -f ${CLEANFILES}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# $NetBSD: Makefile.gmakehost,v 1.7 2012/01/20 23:01:05 christos Exp $
|
||||
#
|
||||
# Rules used when building a GNU host package. Expects MODULE to be set.
|
||||
# This version runs ${TOOL_GMAKE} instead of ${MAKE}
|
||||
#
|
||||
# There's not a lot we can do to build reliably in the face of many
|
||||
# available configuration options. To be as low-overhead as possible,
|
||||
# we follow the following scheme:
|
||||
#
|
||||
# * Configuration is only re-run when an autoconf source file (such as
|
||||
# "configure" or "config.sub") is changed.
|
||||
#
|
||||
# * "config.status" is run to rebuild Makefiles and .h files if an
|
||||
# autoconf-parsed file (such as Makefile.in) is changed.
|
||||
#
|
||||
# * If MKUPDATE != "no", "make install" is only run if a build has happened
|
||||
# since the last install in the current directory.
|
||||
|
||||
.include <bsd.own.mk>
|
||||
MAKE_PROGRAM=${TOOL_GMAKE}
|
||||
.include "Makefile.gnuhost"
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
# $NetBSD: Makefile.gnuhost,v 1.42 2013/08/13 20:41:25 drochner Exp $
|
||||
#
|
||||
# Rules used when building a GNU host package. Expects MODULE to be set.
|
||||
#
|
||||
# There's not a lot we can do to build reliably in the face of many
|
||||
# available configuration options. To be as low-overhead as possible,
|
||||
# we follow the following scheme:
|
||||
#
|
||||
# * Configuration is only re-run when an autoconf source file (such as
|
||||
# "configure" or "config.sub") is changed.
|
||||
#
|
||||
# * "config.status" is run to rebuild Makefiles and .h files if an
|
||||
# autoconf-parsed file (such as Makefile.in) is changed.
|
||||
#
|
||||
# * If MKUPDATE != "no", "make install" is only run if a build has happened
|
||||
# since the last install in the current directory.
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# Disable use of pre-compiled headers on Darwin.
|
||||
BUILD_OSTYPE!= uname -s
|
||||
.if ${BUILD_OSTYPE} == "Darwin"
|
||||
HOST_CFLAGS+=-O2 -no-cpp-precomp
|
||||
.endif
|
||||
MAKE_PROGRAM?= ${MAKE}
|
||||
|
||||
GNUHOSTDIST?= ${.CURDIR}/../../gnu/dist/${MODULE}
|
||||
|
||||
.if defined(__MINIX)
|
||||
.include "../minix/Makefile.fetchgnu"
|
||||
.endif # defined(__MINIX)
|
||||
|
||||
FIND_ARGS+= \! \( -type d \( \
|
||||
-name 'CVS' -o \
|
||||
-name 'config' -o \
|
||||
-name 'doc' -o \
|
||||
-name 'po' -o \
|
||||
-name 'nbsd.mt' -o \
|
||||
-name 'tests*' \
|
||||
\) -prune \)
|
||||
|
||||
# Do this "find" only if actually building something.
|
||||
# AL - ... and on MINIX, if the source has already being fetched
|
||||
.if (${USETOOLS} == "yes") && empty(.MAKEFLAGS:M-V*) && \
|
||||
(make(all) || make(realall) || (!make(clean) && !make(cleandir) && !make(obj))) && \
|
||||
!defined(_GNU_CFGSRC) && exists(${GNUHOSTDIST}/configure)
|
||||
|
||||
_GNU_CFGSRC!= find ${GNUHOSTDIST} ${FIND_ARGS} \
|
||||
-type f \( -name 'config*' -o -name '*.in' \) -print
|
||||
.MAKEOVERRIDES+= _GNU_CFGSRC
|
||||
.endif
|
||||
|
||||
CONFIGURE_ENV+= \
|
||||
AR=${HOST_AR:Q} \
|
||||
AWK=${TOOL_AWK:Q} \
|
||||
CC=${HOST_CC:Q} \
|
||||
CFLAGS=${HOST_CFLAGS:Q} \
|
||||
CONFIG_SHELL=${HOST_SH:Q} \
|
||||
CPPFLAGS=${HOST_CPPFLAGS:Q} \
|
||||
CXX=${HOST_CXX:Q} \
|
||||
CXXFLAGS=${HOST_CXXFLAGS:Q} \
|
||||
INSTALL=${HOST_INSTALL_FILE:Q} \
|
||||
LDFLAGS=${HOST_LDFLAGS:Q} \
|
||||
LEX=${LEX:Q} \
|
||||
M4=${TOOL_M4:Q} \
|
||||
MAKE=${MAKE_PROGRAM:Q} \
|
||||
PATH="${TOOLDIR}/bin:$$PATH" \
|
||||
RANLIB=${HOST_RANLIB:Q} \
|
||||
YACC=${YACC:Q}
|
||||
|
||||
BUILD_ENV+= ${CONFIGURE_ENV}
|
||||
|
||||
CONFIGURE_ARGS+=--prefix=${TOOLDIR}
|
||||
.if ${MKPIC} == "no"
|
||||
CONFIGURE_ARGS+=--disable-shared
|
||||
.endif
|
||||
|
||||
.if ${MAKE_PROGRAM} == ${MAKE}
|
||||
.ifndef _NOWRAPPER
|
||||
# Some systems have a small ARG_MAX. On such systems, prevent Make
|
||||
# variables set on the command line from being exported in the
|
||||
# environment (they will still be set in MAKEOVERRIDES).
|
||||
.if ${BUILD_OSTYPE} == "Darwin" || ${BUILD_OSTYPE} == "FreeBSD"
|
||||
__noenvexport= -X
|
||||
.endif
|
||||
MAKE_ARGS:= ${__noenvexport} -f ${.PARSEDIR}/Makefile.gnuwrap ${MAKE_ARGS}
|
||||
.else
|
||||
MAKE_ARGS+= _NOWRAPPER=1
|
||||
.endif
|
||||
BUILD_COMMAND= ${BUILD_ENV} ${MAKE} ${MAKE_ARGS}
|
||||
.else
|
||||
|
||||
# gmake version of this puts MAKE_ARGS in the environment to be sure that
|
||||
# sub-gmake's get them, otherwise tools/gcc tries to build libgcc and
|
||||
# fails. it also uses "env -i" to entirely clear out MAKEFLAGS.
|
||||
GMAKE_J_ARGS?= ${MAKEFLAGS:[*]:M*-j*:C/.*(-j ?[0-9]*).*/\1/W}
|
||||
BUILD_COMMAND= /usr/bin/env -i ${BUILD_ENV} ${MAKE_ARGS} ${TOOL_GMAKE} ${GMAKE_J_ARGS} -e ${MAKE_ARGS}
|
||||
|
||||
.endif
|
||||
|
||||
MAKE_ARGS+= BISON=true DESTDIR= INSTALL=${HOST_INSTALL_FILE:Q}
|
||||
|
||||
ALL_TARGET?= all
|
||||
INSTALL_TARGET?=install
|
||||
|
||||
BUILD_PLATFORM!= uname -srm | tr ' ()' '-'
|
||||
CONFIGURE_PLATFORM!= if [ -s .configure_done ]; then cat .configure_done; else echo none; fi
|
||||
.if "${BUILD_PLATFORM}" != "${CONFIGURE_PLATFORM}"
|
||||
configure_cleanup:
|
||||
@mkdir build 2>/dev/null || true
|
||||
@(echo "Cleaning stale cache files ${BUILD_PLATFORM} != ${CONFIGURE_PLATFORM}")
|
||||
@(cd build && find . -name config.cache | xargs rm -f)
|
||||
configure_cleanup=configure_cleanup
|
||||
.endif
|
||||
|
||||
# AL For MINIX, fetch the source if not there
|
||||
.configure_done: ${fetch_done} ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup}
|
||||
@mkdir build 2>/dev/null || true
|
||||
@(cd build && ${CONFIGURE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure ${CONFIGURE_ARGS})
|
||||
@echo ${BUILD_PLATFORM} > $@
|
||||
|
||||
# The .build_done timestamp is only updated if a file actually changes
|
||||
# in the build tree during "make all". This way, if nothing has changed,
|
||||
# a "make install MKUPDATE=yes" will do nothing.
|
||||
|
||||
.build_done: .configure_done
|
||||
@(cd build && ${BUILD_COMMAND} ${ALL_TARGET})
|
||||
@if [ ! -f $@ ] || [ -n "$$(find build -type f -newer .build_done -print)" ]; \
|
||||
then touch $@; fi
|
||||
|
||||
.install_done! ${BUILD:D.build_done}
|
||||
@(cd ${.OBJDIR}/build && ${BUILD_COMMAND} ${INSTALL_TARGET})
|
||||
@touch $@
|
||||
|
||||
# Mapping to standard targets.
|
||||
|
||||
.if ${USETOOLS} == "yes"
|
||||
realall: .build_done
|
||||
realinstall: .install_done
|
||||
.endif
|
||||
|
||||
clean: clean.gnu
|
||||
clean.gnu:
|
||||
-rm -r -f .*_done build
|
||||
|
||||
.include <bsd.hostprog.mk>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# $NetBSD: Makefile.gnuwrap,v 1.9 2003/03/14 05:22:51 thorpej Exp $
|
||||
#
|
||||
# Wrapper for GNU Makefiles.
|
||||
|
||||
.ifndef _WRAPPER_INCLUDED
|
||||
_WRAPPER_INCLUDED=1
|
||||
|
||||
.ifndef _NOWRAPPER
|
||||
.include "${.CURDIR}/Makefile"
|
||||
.endif
|
||||
|
||||
# Prevent targets in source directories from being rebuilt.
|
||||
|
||||
_srcdir:= ${srcdir}
|
||||
.MADE: ${.ALLTARGETS:M${_srcdir}/*} Makefile
|
||||
|
||||
# Don't rebuild .gmo files, or lex/yacc (which GNU puts in the source tree).
|
||||
.po.gmo .l.c .y.c .y.h .x.1:
|
||||
@true
|
||||
|
||||
# Make sure this file gets re-loaded recursively.
|
||||
.ifndef _NOWRAPPER
|
||||
# Some systems have a small ARG_MAX. On such systems, prevent Make
|
||||
# variables set on the command line from being exported in the
|
||||
# environment (they will still be set in MAKEOVERRIDES).
|
||||
BUILD_OSTYPE!= uname -s
|
||||
.if ${BUILD_OSTYPE} == "Darwin" || ${BUILD_OSTYPE} == "FreeBSD"
|
||||
__noenvexport= -X
|
||||
.endif
|
||||
_GNUWRAPPER:= ${.PARSEDIR}/${.PARSEFILE}
|
||||
MAKE:= ${MAKE} ${__noenvexport} -f ${_GNUWRAPPER}
|
||||
.endif
|
||||
.endif
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
# $NetBSD: Makefile.host,v 1.31 2013/06/14 16:10:02 tsutsui Exp $
|
||||
|
||||
NOINFO= # defined
|
||||
NOLINT= # defined
|
||||
NOMAN= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.ifndef NOCOMPATLIB
|
||||
# Use TOOLDIR copy of libnbcompat and associated *.h files
|
||||
.-include "${TOOLDIR}/share/compat/defs.mk"
|
||||
.elif !empty(.MAKE.OS:M*CYGWIN*)
|
||||
HOSTEXEEXT=.exe
|
||||
.endif
|
||||
|
||||
# Resolve pathnames in variables.
|
||||
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
|
||||
.for var in ${_RESOLVE_VARS}
|
||||
${var}:= ${${var}}
|
||||
.endfor
|
||||
|
||||
# Switch over to the "real" Makefile.
|
||||
.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR}
|
||||
_CURDIR:= ${.CURDIR}
|
||||
HOSTPROG?= ${PROG}
|
||||
|
||||
.CURDIR:= ${.PROGDIR}
|
||||
.PATH: ${.CURDIR}
|
||||
.include "${.CURDIR}/Makefile"
|
||||
.-include "${.CURDIR}/../Makefile.inc"
|
||||
|
||||
# Resolve pathnames from "real" Makefile, and switch .CURDIR back.
|
||||
.for var in ${_RESOLVE_VARS}
|
||||
${var}:= ${${var}}
|
||||
.endfor
|
||||
.CURDIR:= ${_CURDIR}
|
||||
.undef _CURDIR
|
||||
|
||||
# Set up the environment for <bsd.hostprog.mk>.
|
||||
.if ${USETOOLS} != "yes"
|
||||
.undef HOSTPROG
|
||||
.endif
|
||||
|
||||
HOSTPROGNAME?= ${HOSTPROG}
|
||||
HOST_BINDIR?= ${TOOLDIR}/bin
|
||||
HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
|
||||
HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
|
||||
HOST_INSTALLPROG?=${HOST_BINDIR}/${HOSTPROGNAME}${HOSTEXEEXT}
|
||||
.undef LINKS
|
||||
|
||||
SRCS?= ${HOSTPROG}.c
|
||||
SRCS+= ${HOST_SRCS}
|
||||
|
||||
.PATH: ${.PROGDIR}
|
||||
|
||||
# Install rule.
|
||||
realinstall: install.host install.files
|
||||
install.host: ${HOST_INSTALLPROG}
|
||||
${HOST_INSTALLPROG}:: ${HOSTPROG}
|
||||
${_MKTARGET_INSTALL}
|
||||
mkdir -p ${HOST_BINDIR}
|
||||
${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
|
||||
.if !empty(.MAKE.OS:M*CYGWIN*)
|
||||
${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${.TARGET}
|
||||
.endif
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
.PHONY: ${HOST_INSTALLPROG}
|
||||
.endif
|
||||
|
||||
install.files:
|
||||
.for F in ${HOSTFILES}
|
||||
install.files: ${HOST_FILESDIR}/${F}
|
||||
${HOST_FILESDIR}/${F}: ${F}
|
||||
${_MKTARGET_INSTALL}
|
||||
mkdir -p ${HOST_FILESDIR}
|
||||
${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
.PHONY: ${HOST_FILESDIR}/${F}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.include <bsd.hostprog.mk>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
# $NetBSD: Makefile.nbincludes,v 1.4 2015/01/24 16:21:33 uwe Exp $
|
||||
|
||||
# NOxxx definitions are copied from Makefile.host, and are
|
||||
# required before .include <bsd.own.mk>. The include of bsd.own.mk
|
||||
# itself is required to get definitions of TOOL_* variables used in
|
||||
# "!=" variable assignments (which are performed early).
|
||||
#
|
||||
NOINFO= # defined
|
||||
NOLINT= # defined
|
||||
NOMAN= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
_ARCHDIR= ${.CURDIR}/../../sys/arch
|
||||
_INCDIR= ${.CURDIR}/../../include
|
||||
_SYSDIR= ${.CURDIR}/../../sys/sys
|
||||
_UFSDIR= ${.CURDIR}/../../sys/ufs
|
||||
_SUBDIR!= cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
|
||||
|
||||
.if make(depend) || make(all) || make(dependall) || make(install)
|
||||
# There's no need to run these commands for "make cleandir" or "make obj",
|
||||
# and TOOL_SED will not yet have been built.
|
||||
_UFS_INCS!= cd ${_UFSDIR} && find ffs ufs -name '*.h'
|
||||
_ARCH_INCS!= ${TOOL_SED} -e 's/^\#.*//' ${.CURDIR}/../headerlist
|
||||
.endif
|
||||
|
||||
.if !defined(__MINIX)
|
||||
_ARCH_INCS+= ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
|
||||
|
||||
# for sh3/include/elf_machdep.h
|
||||
.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
|
||||
_ARCH_INCS+= ${sh3mach}/include/endian_machdep.h
|
||||
.endfor
|
||||
.endif # !defined(__MINIX)
|
||||
|
||||
_INCS= disktab.h
|
||||
_SYSINCS= bootblock.h \
|
||||
disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \
|
||||
dkbad.h \
|
||||
exec_elf.h
|
||||
|
||||
HOST_CPPFLAGS+= -I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
|
||||
|
||||
beforedepend:
|
||||
${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude
|
||||
${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/sys
|
||||
${HOST_INSTALL_DIR} ${TOOLDIR}/include/nbinclude/ufs
|
||||
cd ${_ARCHDIR} && \
|
||||
${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
|
||||
${TOOLDIR}/include/nbinclude
|
||||
cd ${_INCDIR} && \
|
||||
${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
|
||||
cd ${_SYSDIR} && \
|
||||
${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
|
||||
cd ${_UFSDIR} && \
|
||||
${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
|
||||
cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
|
||||
${HOST_INSTALL_SYMLINK} ${MACHINE} machine
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.3 2010/12/12 04:06:19 christos Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}awk
|
||||
HOST_SRCDIR= external/historical/nawk/bin
|
||||
HOST_CPPFLAGS+= -D__EXTENSIONS__ # for isblank
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.11 2013/03/16 22:32:50 christos Exp $
|
||||
|
||||
NOMAN=
|
||||
.include <bsd.own.mk>
|
||||
|
||||
HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-install
|
||||
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=
|
||||
|
||||
# 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"
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
||||
# Use uninstalled copy of the install program
|
||||
INSTALL= ./xinstall
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
makeone() {
|
||||
local name="$(basename "$1" .exe)"
|
||||
case $name in
|
||||
*instal*|*patch*|*update*|*setup*)
|
||||
;;
|
||||
*)
|
||||
return;;
|
||||
esac
|
||||
cat << _EOF > ${1%.exe}.exe.manifest
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- $NetBSD: mkmanifest,v 1.1 2013/02/17 00:36:40 christos Exp $ -->
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
name="$name"
|
||||
type="win32"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
_EOF
|
||||
}
|
||||
|
||||
for i
|
||||
do
|
||||
makeone "$i"
|
||||
done
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.24 2014/02/15 13:34:28 tsutsui Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
MODULE= binutils
|
||||
|
||||
GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/binutils/dist
|
||||
|
||||
BRANDING?= \
|
||||
--with-pkgversion="NetBSD Binutils nb1" \
|
||||
--with-bugurl="http://www.NetBSD.org/support/send-pr.html" \
|
||||
--with-lib-path="=/usr/lib" --with-sysroot
|
||||
|
||||
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
|
||||
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
||||
--disable-werror \
|
||||
${BRANDING}
|
||||
|
||||
.if defined(__MINIX) && ! exists(${GNUHOSTDIST}/gas/m68k-parse.c)
|
||||
# MINIX: LSC: Make sure we trigger the fetch rule
|
||||
.include "${.CURDIR}/../../minix/Makefile.fetchgnu"
|
||||
|
||||
${GNUHOSTDIST}/gas/m68k-parse.c: ${fetch_done}
|
||||
@true
|
||||
.endif # defined(__MINIX)
|
||||
|
||||
build/gas/m68k-parse.c: ${GNUHOSTDIST}/gas/m68k-parse.c
|
||||
@mkdir build 2>/dev/null || true
|
||||
@mkdir build/gas 2>/dev/null || true
|
||||
cat ${GNUHOSTDIST}/gas/m68k-parse.c > ${.TARGET}
|
||||
|
||||
.configure_done: build/gas/m68k-parse.c
|
||||
|
||||
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
|
||||
|
||||
ALL_TARGET= all-binutils all-gas all-ld
|
||||
INSTALL_TARGET= install-binutils install-gas install-ld
|
||||
.if ${MKCROSSGPROF:Uno} != "no"
|
||||
ALL_TARGET+= all-gprof
|
||||
INSTALL_TARGET+=install-gprof
|
||||
.endif
|
||||
|
||||
.if defined(__MINIX) && ${HAVE_GOLD:Uyes} != "no"
|
||||
ALL_TARGET+= all-gold
|
||||
INSTALL_TARGET+=install-gold
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-lto \
|
||||
--enable-plugins
|
||||
# LSC: Here we use the MK variable, as we have to select the right default
|
||||
# linker. Problem is, when Gold is not seen, USE_BITCODE is forced to
|
||||
# "no".
|
||||
.if ${MKBITCODE:Uno} == "yes"
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-ld=yes \
|
||||
--enable-gold=default
|
||||
.else
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-ld=default \
|
||||
--enable-gold=yes
|
||||
.endif # ${MKBITCODE:Uno} == "yes"
|
||||
.endif # defined(__MINIX)
|
||||
.include "${.CURDIR}/../Makefile.gnuhost"
|
||||
|
||||
CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
|
||||
|
||||
# Force avoiding possibly non-executable install-sh.
|
||||
CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
|
||||
|
||||
NEWCONFIGDIR?= ${.CURDIR}/../..
|
||||
MKNATIVE?= ${.CURDIR}/mknative-binutils
|
||||
|
||||
native-binutils: .native/.configure_done
|
||||
@echo 'Extracting GNU binutils configury for a native toolchain.'
|
||||
MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
|
||||
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
||||
|
||||
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
||||
mkdir .native 2>/dev/null || true
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
|
||||
CC_FOR_BUILD=${HOST_CC:Q} \
|
||||
CC=${CC:Q}' '${CCADDFLAGS:Q} \
|
||||
CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
|
||||
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
||||
CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
|
||||
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
||||
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
||||
LIBS=-lintl \
|
||||
ac_cv_prog_cc_cross=yes \
|
||||
ac_cv_func_strcoll_works=yes \
|
||||
${HOST_SH} ${GNUHOSTDIST}/configure \
|
||||
--build=`${GNUHOSTDIST}/config.guess` \
|
||||
--host=${MACHINE_GNU_PLATFORM} \
|
||||
--target=${MACHINE_GNU_PLATFORM} \
|
||||
${BRANDING} \
|
||||
)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native && ${MAKE} configure-host)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/bfd && ${MAKE} bfd.h bfdver.h)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/ld && ${MAKE} ldemul-list.h)
|
||||
@touch $@
|
||||
|
||||
clean: clean.native
|
||||
clean.native:
|
||||
-rm -r -f .native
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp $
|
||||
#
|
||||
# Shell script for generating all the constants needed for a native
|
||||
# platform build of src/external/gpl3/binutils
|
||||
#
|
||||
|
||||
# initialise
|
||||
|
||||
_TMPDIR=$2
|
||||
_TOP=$3
|
||||
_PLATFORM=$4
|
||||
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
|
||||
|
||||
. $_TOP/tools/gcc/mknative.common
|
||||
|
||||
##### external/gpl3/binutils/lib/libbfd #####
|
||||
|
||||
get_libbfd () {
|
||||
mkdir -p $_TOP/external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars bfd/Makefile \
|
||||
libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
|
||||
INCLUDES TDEFAULTS
|
||||
} | write_mk external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h
|
||||
write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfdver.h <$_TMPDIR/bfd/bfdver.h
|
||||
write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfd_stdint.h <$_TMPDIR/bfd/bfd_stdint.h
|
||||
|
||||
{
|
||||
cat $_TMPDIR/bfd/config.h
|
||||
} | write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/config.h
|
||||
}
|
||||
|
||||
##### external/gpl3/binutils/lib/libopcodes #####
|
||||
|
||||
get_libopcodes () {
|
||||
mkdir -p $_TOP/external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars opcodes/Makefile \
|
||||
archdefs BFD_MACHINES libopcodes_la_SOURCES
|
||||
} | write_mk external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
{
|
||||
cat $_TMPDIR/opcodes/config.h
|
||||
} | write_c external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/config.h
|
||||
}
|
||||
|
||||
##### external/gpl3/binutils/lib/libiberty #####
|
||||
|
||||
get_libiberty () {
|
||||
mkdir -p $_TOP/external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH
|
||||
|
||||
getvars libiberty/Makefile \
|
||||
ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
|
||||
| write_mk external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c external/gpl3/binutils/lib/libiberty/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/libiberty/config.h
|
||||
}
|
||||
|
||||
##### external/gpl3/binutils/usr.bin #####
|
||||
|
||||
get_binutils () {
|
||||
### common
|
||||
|
||||
mkdir -p $_TOP/external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars binutils/Makefile \
|
||||
VERSION DEFS INCLUDES PROGRAMS
|
||||
getvars binutils/doc/Makefile \
|
||||
man_MANS TEXINFOS
|
||||
getvars bfd/doc/Makefile \
|
||||
PKGVERSION | sed 's,\\\(.\),\1,'
|
||||
getvars bfd/doc/Makefile \
|
||||
REPORT_BUGS_TEXI
|
||||
|
||||
for f in `getvars binutils/Makefile PROGRAMS | sed 'y,-,_,;s,^[^=]*=,,'`; do
|
||||
getvars binutils/Makefile ${f}_OBJECTS ${f}_DEPENDENCIES
|
||||
done
|
||||
} | write_mk external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c external/gpl3/binutils/usr.bin/common/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/binutils/config.h
|
||||
|
||||
### gas
|
||||
|
||||
mkdir -p $_TOP/external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH
|
||||
|
||||
grep -v DEPDIR "$_TMPDIR/gas/Makefile" > "$_TMPDIR/gas/Makefile.nodeps"
|
||||
getvars gas/Makefile.nodeps \
|
||||
DEFS INCLUDES as_new_OBJECTS as_new_LDADD |
|
||||
sed -e s/G_as_new_OBJECTS/G_OBJS/ \
|
||||
-e s/G_as_new_LDADD=/G_OBJS+=/ \
|
||||
-e 's/\.\..*a//' |
|
||||
write_mk external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
for f in config itbl-cpu obj-format targ-cpu targ-env; do
|
||||
write_c external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gas/$f.h
|
||||
done
|
||||
|
||||
### gprof
|
||||
|
||||
mkdir -p $_TOP/external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH
|
||||
|
||||
getvars gprof/Makefile \
|
||||
DEFS gprof_OBJECTS INCLUDES TEXINFOS \
|
||||
| write_mk external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c external/gpl3/binutils/usr.bin/gprof/arch/$MACHINE_ARCH/gconfig.h <$_TMPDIR/gprof/gconfig.h
|
||||
|
||||
### ld
|
||||
|
||||
mkdir -p $_TOP/external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars ld/Makefile \
|
||||
DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS
|
||||
getvars ld/Makefile \
|
||||
target_alias | sed 's,[\._0-9A-Z]*$,,'
|
||||
getvars ld/Makefile \
|
||||
enable_initfini_array
|
||||
} | write_mk external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
for f in config ldemul-list; do
|
||||
write_c external/gpl3/binutils/usr.bin/ld/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/ld/$f.h
|
||||
done
|
||||
}
|
||||
|
||||
##### main #####
|
||||
|
||||
case $1 in
|
||||
all|binutils) # everything (uses "canadian cross" temp environment)
|
||||
get_binutils
|
||||
get_libbfd
|
||||
get_libopcodes
|
||||
get_libiberty
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*) echo invalid arguments; exit 1;;
|
||||
esac
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2002/12/08 20:19:58 thorpej Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}cat
|
||||
HOST_SRCDIR= bin/cat
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.3 2006/10/29 06:17:08 dogcow Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}cksum
|
||||
HOST_SRCDIR= usr.bin/cksum
|
||||
CPPFLAGS+= -I${.CURDIR}/../compat/sys
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.76 2015/09/17 14:25:43 christos Exp $
|
||||
|
||||
HOSTLIB= nbcompat
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
|
||||
dprintf.c fgetln.c flock.c fparseln.c fpurge.c \
|
||||
getcap.c getline.c getmode.c getopt_long.c gettemp.c \
|
||||
heapsort.c \
|
||||
issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
|
||||
md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
|
||||
mi_vector_hash.c mkdtemp.c \
|
||||
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
|
||||
pw_scan.c \
|
||||
raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \
|
||||
setenv.c setgroupent.c \
|
||||
setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
|
||||
sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
|
||||
stat_flags.c strlcat.c strlcpy.c strmode.c \
|
||||
strndup.c strnlen.c \
|
||||
strsep.c strsuftoll.c strtoll.c \
|
||||
strtoi.c strtou.c \
|
||||
unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
|
||||
vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \
|
||||
fts.c glob.c efun.c
|
||||
|
||||
BUILD_OSTYPE!= uname -s
|
||||
|
||||
# Disable use of pre-compiled headers on Darwin.
|
||||
.if ${BUILD_OSTYPE} == "Darwin"
|
||||
CPPFLAGS+= -no-cpp-precomp
|
||||
.endif
|
||||
|
||||
# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
|
||||
# other file ops, on many systems, without changing function names.
|
||||
|
||||
CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
|
||||
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
|
||||
|
||||
.PATH: ${.CURDIR}/../../lib/libc/cdb \
|
||||
${.CURDIR}/../../lib/libc/gen \
|
||||
${.CURDIR}/../../lib/libc/hash \
|
||||
${.CURDIR}/../../lib/libc/hash/md2 \
|
||||
${.CURDIR}/../../lib/libc/hash/md5 \
|
||||
${.CURDIR}/../../lib/libc/hash/rmd160 \
|
||||
${.CURDIR}/../../lib/libc/hash/sha1 \
|
||||
${.CURDIR}/../../lib/libc/hash/sha2 \
|
||||
${.CURDIR}/../../lib/libc/md \
|
||||
${.CURDIR}/../../lib/libc/stdio \
|
||||
${.CURDIR}/../../lib/libc/stdlib \
|
||||
${.CURDIR}/../../lib/libc/string \
|
||||
${.CURDIR}/../../lib/libutil \
|
||||
${.CURDIR}/../../common/lib/libc/cdb \
|
||||
${.CURDIR}/../../common/lib/libc/string \
|
||||
${.CURDIR}/../../common/lib/libc/hash/rmd160 \
|
||||
${.CURDIR}/../../common/lib/libc/hash/sha1 \
|
||||
${.CURDIR}/../../common/lib/libc/hash/sha2 \
|
||||
${.CURDIR}/../../common/lib/libc/md \
|
||||
${.CURDIR}/../../common/lib/libc/stdlib \
|
||||
${.CURDIR}/../../common/lib/libutil \
|
||||
${.CURDIR}/../../external/bsd/flex/dist
|
||||
|
||||
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}
|
||||
.CURDIR:= ${_CURDIR}/../../lib/libc
|
||||
.include "${.CURDIR}/db/Makefile.inc"
|
||||
.CURDIR:= ${_CURDIR}
|
||||
|
||||
SRCS:= ${SRCS:M*.c}
|
||||
|
||||
config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
|
||||
rm -f ${.TARGET}
|
||||
CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
|
||||
${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
|
||||
|
||||
defs.mk: config.cache
|
||||
@touch ${.TARGET}
|
||||
|
||||
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
|
||||
|
||||
include/.stamp:
|
||||
mkdir -p ${INCSUBDIRS:@d@ include/$d @}
|
||||
@touch ${.TARGET}
|
||||
|
||||
# Install rules
|
||||
|
||||
HOST_LIBDIR= ${TOOLDIR}/lib
|
||||
HOST_INCSDIR= ${TOOLDIR}/include
|
||||
HOST_SHAREDIR= ${TOOLDIR}/share
|
||||
|
||||
install: .PHONY install.lib 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}
|
||||
|
||||
.for _f in ${INCFILES}
|
||||
HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f}
|
||||
${HOST_INCSDIR}/compat/${_f}: ${_f}
|
||||
${_MKTARGET_INSTALL}
|
||||
${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
|
||||
.endfor
|
||||
|
||||
.for _d in ${INCSUBDIRS}
|
||||
HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d}
|
||||
${HOST_INCSDIR}/compat/${_d}:
|
||||
${_MKTARGET_INSTALL}
|
||||
${HOST_INSTALL_DIR} ${.TARGET}
|
||||
.endfor
|
||||
|
||||
# Install include files in ${TOOLDIR}/include/compat
|
||||
includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES}
|
||||
@(cd include && find . -name '*.h' -print | while read f ; do \
|
||||
${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \
|
||||
done)
|
||||
|
||||
|
||||
# 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
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: cdbr.h,v 1.2 2013/12/11 01:24:08 joerg Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD cdbr(3) in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/cdbr.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: cdbw.h,v 1.1 2012/06/03 21:02:50 joerg Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD cdbw(3) in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../include/cdbw.h"
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,17 +0,0 @@
|
|||
/* $NetBSD: compat_getopt.h,v 1.2 2007/11/08 20:30:59 christos Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD getopt.h in libnbcompat. */
|
||||
|
||||
#if HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#define option __nbcompat_option
|
||||
#define getopt_long __nbcompat_getopt_long
|
||||
|
||||
#undef no_argument
|
||||
#undef required_argument
|
||||
#undef optional_argument
|
||||
#undef _GETOPT_H_
|
||||
|
||||
#include "../../include/getopt.h"
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/* $NetBSD: compat_pwd.h,v 1.6 2009/01/18 01:44:09 christos 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _COMPAT_PWD_H_
|
||||
#define _COMPAT_PWD_H_
|
||||
|
||||
/* A very special version of <pwd.h> for pwd_mkdb(8) and __nbcompat_pwscan(3). */
|
||||
|
||||
#include "../../include/pwd.h"
|
||||
|
||||
#define passwd __nbcompat_passwd
|
||||
#define pw_scan __nbcompat_pw_scan
|
||||
#ifdef LOGIN_NAME_MAX
|
||||
#undef LOGIN_NAME_MAX
|
||||
#endif
|
||||
/* Taken from syslimits.h. Need the NetBSD def, not the local system def */
|
||||
#define LOGIN_NAME_MAX 17
|
||||
|
||||
/* All elements exactly sized: */
|
||||
struct passwd {
|
||||
char *pw_name;
|
||||
char *pw_passwd;
|
||||
int32_t pw_uid;
|
||||
int32_t pw_gid;
|
||||
int64_t pw_change;
|
||||
char *pw_class;
|
||||
char *pw_gecos;
|
||||
char *pw_dir;
|
||||
char *pw_shell;
|
||||
int64_t pw_expire;
|
||||
};
|
||||
|
||||
int pw_scan(char *, struct passwd *, int *);
|
||||
|
||||
#endif /* !_PWD_H_ */
|
||||
8848
tools/compat/configure
vendored
8848
tools/compat/configure
vendored
File diff suppressed because it is too large
Load Diff
|
|
@ -1,252 +0,0 @@
|
|||
# $NetBSD: configure.ac,v 1.84 2015/07/26 14:01:53 kamil Exp $
|
||||
#
|
||||
# Autoconf definition file for libnbcompat.
|
||||
#
|
||||
# When you edit configure.ac:
|
||||
# 0. Create the tools versions of autoconf and autoheader:
|
||||
# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools
|
||||
# (This might not work if you try it after editing configure.ac.)
|
||||
# 1. edit configure.ac
|
||||
# 2. Regenerate "configure" and "nbtool_config.h.in" from "configure.ac":
|
||||
# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen
|
||||
# (Please don't use a non-tools version of autoconf or autoheader.)
|
||||
# 3. Test that the tools still build:
|
||||
# mv ${TOOLDIR} ${TOOLDIR}.bak
|
||||
# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools
|
||||
# 4. cvs commit files that you edited.
|
||||
# 5. Regen again, to pick up changed RCS IDs from the above commit:
|
||||
# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen
|
||||
# 6. cvs commit files that were generated.
|
||||
#
|
||||
|
||||
AC_INIT([libnbcompat], [noversion], [lib-bug-people@NetBSD.org])
|
||||
AC_CONFIG_HEADERS(nbtool_config.h)
|
||||
AC_CONFIG_FILES(defs.mk)
|
||||
|
||||
# Autoheader header and footer
|
||||
AH_TOP([/* $][NetBSD$ */
|
||||
|
||||
#ifndef __NETBSD_NBTOOL_CONFIG_H__
|
||||
#define __NETBSD_NBTOOL_CONFIG_H__])
|
||||
|
||||
AH_BOTTOM([#include "compat_defs.h"
|
||||
#endif /* !__NETBSD_NBTOOL_CONFIG_H__ */])
|
||||
|
||||
AC_DEFUN([AC_NETBSD],
|
||||
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
|
||||
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
||||
AC_MSG_CHECKING([for NetBSD or MINIX3])
|
||||
AC_EGREP_CPP(yes,
|
||||
[#if defined(__NetBSD__) || defined(__minix)
|
||||
yes
|
||||
#endif
|
||||
],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([_POSIX_SOURCE], 1, [Define for NetBSD headers.])
|
||||
AC_DEFINE([_POSIX_C_SOURCE], 200112L, [Define for NetBSD headers.])
|
||||
AC_DEFINE([_XOPEN_SOURCE], 600, [Define for NetBSD headers.])],
|
||||
[AC_MSG_RESULT([no])])
|
||||
])# AC_NETBSD
|
||||
|
||||
AC_NETBSD
|
||||
AC_PATH_PROG(BSHELL, sh, )
|
||||
if test x"$BSHELL" = x; then
|
||||
AC_MSG_ERROR([sh must be somewhere on \$PATH])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([PATH_BSHELL], "$BSHELL", [Path to sh(1).])
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
AC_HEADER_STDC
|
||||
|
||||
# Confirm existence of zlib. (This is available as a default install
|
||||
# option on many OS's; this could be added as a reachover build in the
|
||||
# future.)
|
||||
AC_CHECK_HEADER(zlib.h,,
|
||||
AC_MSG_ERROR([zlib must be installed in a compiler-visible path]))
|
||||
AC_CHECK_LIB(z, gzdopen,,
|
||||
AC_MSG_ERROR([zlib must be installed in a compiler-visible path]))
|
||||
|
||||
# Make sure certain required headers are available.
|
||||
# These are not necessarily required by the code, but they are not
|
||||
# currently conditionalized.
|
||||
AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h sys/param.h \
|
||||
sys/socket.h sys/stat.h sys/time.h sys/types.h sys/utsname.h \
|
||||
sys/wait.h assert.h ctype.h errno.h fcntl.h grp.h limits.h locale.h \
|
||||
netdb.h pwd.h signal.h stdarg.h stdio.h stdlib.h string.h \
|
||||
termios.h unistd.h,,
|
||||
AC_MSG_ERROR([standard system header file not found]))
|
||||
|
||||
# Find headers that may not be available.
|
||||
AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \
|
||||
getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h)
|
||||
AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \
|
||||
sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \
|
||||
stdint.h util.h resolv.h arpa/nameser.h,,
|
||||
[test -f include/$ac_header || touch include/$ac_header])
|
||||
AC_CHECK_HEADERS(rpc/types.h netconfig.h,,
|
||||
[echo '#include "nbtool_config.h"' >include/$ac_header.new
|
||||
echo '#include "'$srcdir/../../include/$ac_header'"' \
|
||||
>>include/$ac_header.new
|
||||
if cmp include/$ac_header.new include/$ac_header >/dev/null 2>&1; then
|
||||
rm -f include/$ac_header.new
|
||||
else
|
||||
mv -f include/$ac_header.new include/$ac_header
|
||||
fi])
|
||||
|
||||
# Typedefs.
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t])
|
||||
AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1,
|
||||
[Define if you have the socklen_t type.])],,
|
||||
[#include <sys/types.h>
|
||||
#ifdef HAVE_RPC_TYPES_H
|
||||
#include <rpc/types.h>
|
||||
#endif
|
||||
#include <sys/socket.h>])
|
||||
|
||||
dnl XXX - This is UGLY. Need a better way to homogenize the bitsized types,
|
||||
dnl including use of compiler primitive types via AC_CHECK_SIZEOF.
|
||||
dnl
|
||||
define([NB_CHECK_INTTYPE], [
|
||||
AC_CHECK_TYPE(uint][$1][_t,, [
|
||||
AC_CHECK_TYPE(u_int][$1][_t,
|
||||
AC_DEFINE(uint][$1][_t, u_int][$1][_t, \
|
||||
[Define if you have u_int][$1][_t, but not uint][$1][_t.]),
|
||||
AC_MSG_ERROR([cannot find a suitable type for uint][$1][_t]))
|
||||
])
|
||||
AC_CHECK_TYPE(u_int][$1][_t,, [
|
||||
AC_CHECK_TYPE(uint][$1][_t,
|
||||
AC_DEFINE(u_int][$1][_t, uint][$1][_t, \
|
||||
[Define if you have uint][$1][_t, but not u_int][$1][_t.]),
|
||||
AC_MSG_ERROR([cannot find a suitable type for u_int][$1][_t]))
|
||||
])
|
||||
])
|
||||
|
||||
NB_CHECK_INTTYPE(8)
|
||||
NB_CHECK_INTTYPE(16)
|
||||
NB_CHECK_INTTYPE(32)
|
||||
NB_CHECK_INTTYPE(64)
|
||||
|
||||
# Struct members.
|
||||
AC_CHECK_MEMBERS([DIR.dd_fd, DIR.__dd_fd, struct dirent.d_namlen],,,
|
||||
[#include <sys/types.h>
|
||||
#include <dirent.h>])
|
||||
AC_CHECK_MEMBERS([struct stat.st_flags, struct stat.st_gen,
|
||||
struct stat.st_birthtime, struct stat.st_birthtimensec,
|
||||
struct stat.st_atim, struct stat.st_mtimensec],,,
|
||||
[#include <sys/stat.h>])
|
||||
AC_CHECK_MEMBERS(struct statvfs.f_iosize,,, [#include <sys/statvfs.h>])
|
||||
AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
|
||||
|
||||
# Global variable decls.
|
||||
AC_CHECK_DECLS([optind, optreset],,, [
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
])
|
||||
AC_CHECK_DECLS(sys_signame,,, [#include <signal.h>])
|
||||
|
||||
# Library functions (where a .h check isn't enough).
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \
|
||||
dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
|
||||
getopt getopt_long group_from_gid gid_from_group \
|
||||
heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
|
||||
mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
|
||||
pwrite raise_default_signal random reallocarr setenv \
|
||||
setgroupent setprogname setpassent \
|
||||
snprintb_m snprintf strlcat strlcpy strmode \
|
||||
strndup strnlen strsep strsuftoll strtoi strtoll strtou \
|
||||
user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
|
||||
|
||||
AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
|
||||
#include <pwd.h>
|
||||
])
|
||||
AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
|
||||
#include <grp.h>
|
||||
])
|
||||
AC_CHECK_DECLS([strndup, strnlen],,,[#include <string.h>])
|
||||
AC_CHECK_DECLS([strsuftoll],,,[#include <stdlib.h>])
|
||||
AC_CHECK_DECLS([lchflags, lchmod, lchown],,,[
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
])
|
||||
|
||||
AC_CHECK_DECLS([errc, verrc, warnc, vwarnc],,, [
|
||||
#ifdef HAVE_ERR_H
|
||||
#include <err.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
AC_CHECK_DECLS([htobe16, htobe32, htobe64, htole16, htole32, htole64,
|
||||
be16toh, be32toh, be64toh, le16toh, le32toh, le64toh],,,
|
||||
[#include <sys/types.h>])
|
||||
|
||||
AC_CHECK_DECLS([bswap16, bswap32, bswap64],,, [#include <machine/bswap.h>])
|
||||
|
||||
AC_CHECK_DECLS([be16enc, le16enc, be16dec, le16dec, be32enc, le32enc,
|
||||
be32dec, le32dec, be64enc, le64enc, be64dec, le64dec],,,
|
||||
[#include <sys/endian.h>])
|
||||
|
||||
AC_CHECK_DECLS([fstatvfs],,, [#include <sys/statvfs.h>])
|
||||
|
||||
AC_CHECK_DECLS([setgroupent, setpassent],,, [
|
||||
#include <sys/types.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
])
|
||||
|
||||
# regcomp() and regexec() are also names of functions in the old V8
|
||||
# regexp package. To avoid them, we need to find out who has regfree().
|
||||
|
||||
dnl # Cygwin: We *MUST* look at -lregex *before* the "no libs" condition.
|
||||
dnl # Thus AC_CHECK_LIB(regex...) comes first, and AC_SEARCHLIBS next.
|
||||
AC_CHECK_LIB(regex, regfree)
|
||||
AC_SEARCH_LIBS(regfree, rx posix)
|
||||
|
||||
AC_CHECK_LIB(rt, clock_gettime)
|
||||
|
||||
AC_CHECK_FUNCS(fparseln, [
|
||||
AC_MSG_CHECKING(if fparseln seems to work)
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#define _NETBSD_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define CONFTEST "conftest.fparseln"
|
||||
#define COMMENT '#'
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
static const char delim[3] = { '\0', '\0', COMMENT };
|
||||
FILE *fp;
|
||||
char *ptr;
|
||||
fp = fopen(CONFTEST, "w+");
|
||||
if (fp != NULL) {
|
||||
unlink(CONFTEST);
|
||||
ungetc(COMMENT, fp);
|
||||
ptr = fparseln(fp, NULL, NULL, delim,
|
||||
FPARSELN_UNESCALL);
|
||||
fclose(fp);
|
||||
if (ptr == NULL)
|
||||
exit(0);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
]])],
|
||||
[AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BROKEN_FPARSELN, 1,
|
||||
[Define to 1 if your `fparseln' function is broken.])],
|
||||
[AC_MSG_WARN([cross compiling: not checking farseln])]
|
||||
)
|
||||
])
|
||||
|
||||
# Variables substituted via @VARNAME@ in defs.mk.in
|
||||
AC_SUBST(HAVE_PTHREAD_H, $ac_cv_header_pthread_h)
|
||||
|
||||
AC_OUTPUT
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: rmd160.h,v 1.2 2006/10/27 22:32:45 mrg Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD RMD160 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/rmd160.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: sha2.h,v 1.2 2006/10/27 22:32:45 mrg Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD SHA2 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../../sys/sys/sha2.h"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
/* $NetBSD: db.h,v 1.4 2006/10/16 19:44:23 apb Exp $ */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
#ifndef __BIT_TYPES_DEFINED__
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
#endif
|
||||
#include "../../include/db.h"
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
# $NetBSD: defs.mk.in,v 1.12 2012/12/02 13:05:14 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}
|
||||
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
|
||||
|
||||
# Disable use of pre-compiled headers on Darwin.
|
||||
.if ${BUILD_OSTYPE} == "Darwin"
|
||||
HOST_CPPFLAGS+= -no-cpp-precomp
|
||||
.endif
|
||||
|
||||
HOST_CPPFLAGS+= ${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
|
||||
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
|
||||
|
||||
.if "${COMPATLIB_NO_LIB}" != "yes"
|
||||
DPADD+= ${COMPATLIBDIR}/libnbcompat.a
|
||||
LDADD+= -L${COMPATLIBDIR} -lnbcompat @LIBS@
|
||||
.endif # ! COMPATLIB_NO_LIB
|
||||
|
||||
HAVE_PTHREAD_H= @HAVE_PTHREAD_H@
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/* $NetBSD: clock_subr.h,v 1.3 2014/12/22 18:08:39 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Gordon W. Ross
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _DEV_CLOCK_SUBR_H_
|
||||
#define _DEV_CLOCK_SUBR_H_
|
||||
|
||||
/*
|
||||
* This is a slightly stripped down version of src/sys/dev/clock_subr.h
|
||||
*/
|
||||
|
||||
/*
|
||||
* "POSIX time" to/from "YY/MM/DD/hh/mm/ss"
|
||||
*/
|
||||
struct clock_ymdhms {
|
||||
uint64_t dt_year;
|
||||
u_char dt_mon;
|
||||
u_char dt_day;
|
||||
u_char dt_wday; /* Day of week */
|
||||
u_char dt_hour;
|
||||
u_char dt_min;
|
||||
u_char dt_sec;
|
||||
};
|
||||
|
||||
time_t clock_ymdhms_to_secs(struct clock_ymdhms *);
|
||||
int clock_secs_to_ymdhms(time_t, struct clock_ymdhms *);
|
||||
|
||||
#endif /* _DEV_CLOCK_SUBR_H_ */
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/* $NetBSD: dprintf.c,v 1.2 2013/03/05 16:29:09 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013 NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#if !HAVE_DPRINTF
|
||||
#include <stdlib.h>
|
||||
#ifndef HAVE_NBTOOL_CONFIG_H
|
||||
/* These headers are required, but included from nbtool_config.h */
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
dprintf(int fd, const char *fmt, ...)
|
||||
{
|
||||
FILE *fp;
|
||||
int e;
|
||||
va_list ap;
|
||||
|
||||
if ((e = dup(fd)) == -1)
|
||||
return -1;
|
||||
|
||||
if ((fp = fdopen(e, "r+")) == NULL) {
|
||||
(void)close(e);
|
||||
return -1;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
e = vfprintf(fp, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
(void)fclose(fp);
|
||||
return e;
|
||||
}
|
||||
|
||||
#endif /* HAVE_DPRINTF */
|
||||
|
||||
#ifdef TEST
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
dprintf(1, "Hello %s\n", "world");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
/* $NetBSD: fgetln.c,v 1.12 2015/10/09 14:42:40 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 Joerg Jung <jung@openbsd.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* portable fgetln() version
|
||||
*/
|
||||
|
||||
#ifdef HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#if !HAVE_FGETLN
|
||||
#include <stdlib.h>
|
||||
#ifndef HAVE_NBTOOL_CONFIG_H
|
||||
/* These headers are required, but included from nbtool_config.h */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
char *
|
||||
fgetln(FILE *fp, size_t *len)
|
||||
{
|
||||
static char *buf = NULL;
|
||||
static size_t bufsz = 0;
|
||||
size_t r = 0;
|
||||
char *p;
|
||||
int c, e;
|
||||
|
||||
if (!fp || !len) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
if (!buf) {
|
||||
if (!(buf = calloc(1, BUFSIZ)))
|
||||
return NULL;
|
||||
bufsz = BUFSIZ;
|
||||
}
|
||||
while ((c = getc(fp)) != EOF) {
|
||||
buf[r++] = c;
|
||||
if (r == bufsz) {
|
||||
/*
|
||||
* Original uses reallocarray() but we don't have it
|
||||
* in tools.
|
||||
*/
|
||||
if (!(p = realloc(buf, 2 * bufsz))) {
|
||||
e = errno;
|
||||
free(buf);
|
||||
errno = e;
|
||||
buf = NULL, bufsz = 0;
|
||||
return NULL;
|
||||
}
|
||||
buf = p, bufsz = 2 * bufsz;
|
||||
}
|
||||
if (c == '\n')
|
||||
break;
|
||||
}
|
||||
return (*len = r) ? buf : NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef TEST
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
while ((p = fgetln(stdin, &len)) != NULL) {
|
||||
(void)printf("%zu %s", len, p);
|
||||
free(p);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/* $NetBSD: flock.c,v 1.6 2008/04/28 20:24:12 martin 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Emulate flock() with fcntl(), where available.
|
||||
* Otherwise, don't do locking; just pretend success.
|
||||
*/
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_FLOCK
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int flock(int fd, int op) {
|
||||
int rc = 0;
|
||||
|
||||
#if defined(F_SETLK) && defined(F_SETLKW)
|
||||
struct flock fl = {0};
|
||||
|
||||
switch (op & (LOCK_EX|LOCK_SH|LOCK_UN)) {
|
||||
case LOCK_EX:
|
||||
fl.l_type = F_WRLCK;
|
||||
break;
|
||||
|
||||
case LOCK_SH:
|
||||
fl.l_type = F_RDLCK;
|
||||
break;
|
||||
|
||||
case LOCK_UN:
|
||||
fl.l_type = F_UNLCK;
|
||||
break;
|
||||
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fl.l_whence = SEEK_SET;
|
||||
rc = fcntl(fd, op & LOCK_NB ? F_SETLK : F_SETLKW, &fl);
|
||||
|
||||
if (rc && (errno == EAGAIN))
|
||||
errno = EWOULDBLOCK;
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/* $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pretend...
|
||||
*/
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_FPURGE
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
void
|
||||
fpurge(FILE *fp)
|
||||
{
|
||||
#if HAVE___FPURGE
|
||||
__fpurge(fp);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/bootsect.h"
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/bpb.h"
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/denode.h"
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/direntry.h"
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/fat.h"
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "../../../../sys/fs/msdosfs/msdosfsmount.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: fts.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD fts(3) in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../include/fts.h"
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
/* $NetBSD: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#if !HAVE_GETLINE
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef HAVE_NBTOOL_CONFIG_H
|
||||
/* These headers are required, but included from nbtool_config.h */
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
ssize_t
|
||||
getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp)
|
||||
{
|
||||
char *ptr, *eptr;
|
||||
|
||||
|
||||
if (*buf == NULL || *bufsiz == 0) {
|
||||
*bufsiz = BUFSIZ;
|
||||
if ((*buf = malloc(*bufsiz)) == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (ptr = *buf, eptr = *buf + *bufsiz;;) {
|
||||
int c = fgetc(fp);
|
||||
if (c == -1) {
|
||||
if (feof(fp)) {
|
||||
ssize_t diff = (ssize_t)(ptr - *buf);
|
||||
if (diff != 0) {
|
||||
*ptr = '\0';
|
||||
return diff;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
*ptr++ = c;
|
||||
if (c == delimiter) {
|
||||
*ptr = '\0';
|
||||
return ptr - *buf;
|
||||
}
|
||||
if (ptr + 2 >= eptr) {
|
||||
char *nbuf;
|
||||
size_t nbufsiz = *bufsiz * 2;
|
||||
ssize_t d = ptr - *buf;
|
||||
if ((nbuf = realloc(*buf, nbufsiz)) == NULL)
|
||||
return -1;
|
||||
*buf = nbuf;
|
||||
*bufsiz = nbufsiz;
|
||||
eptr = nbuf + nbufsiz;
|
||||
ptr = nbuf + d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ssize_t
|
||||
getline(char **buf, size_t *bufsiz, FILE *fp)
|
||||
{
|
||||
return getdelim(buf, bufsiz, '\n', fp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *p = NULL;
|
||||
ssize_t len;
|
||||
size_t n = 0;
|
||||
|
||||
while ((len = getline(&p, &n, stdin)) != -1)
|
||||
(void)printf("%zd %s", len, p);
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/* $NetBSD: getmode.c,v 1.8 2008/11/04 23:31:32 dbj 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "nbtool_config.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void *
|
||||
setmode(const char *str)
|
||||
{
|
||||
mode_t *mp = malloc(sizeof(mode_t));
|
||||
|
||||
*mp = strtoul(str, NULL, 8);
|
||||
|
||||
return mp;
|
||||
}
|
||||
|
||||
mode_t
|
||||
getmode(const void *mp, mode_t mode)
|
||||
{
|
||||
mode_t m;
|
||||
|
||||
m = *((const mode_t *)mp);
|
||||
|
||||
mode &= ~ALLPERMS; /* input mode less RWX permissions */
|
||||
m &= ALLPERMS; /* new RWX permissions */
|
||||
|
||||
return m | mode;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: glob.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD glob(3) in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../include/glob.h"
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/* $NetBSD: issetugid.c,v 1.2 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Written by Ben Harris, 2002
|
||||
* This file is in the Public Domain
|
||||
*/
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_ISSETUGID
|
||||
int
|
||||
issetugid(void)
|
||||
{
|
||||
|
||||
/*
|
||||
* Assume that anything linked against libnbcompat will be installed
|
||||
* without special privileges.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
/* $NetBSD: lchflags.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Luke Mewburn.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate lchflags(2), checking path with lstat(2) first to ensure that
|
||||
* it's not a symlink, and then call chflags(2) */
|
||||
|
||||
#if !defined(__minix) && !defined(_LIBC)
|
||||
#include "nbtool_config.h"
|
||||
#else
|
||||
#define HAVE_STRUCT_STAT_ST_FLAGS 1
|
||||
#endif /* !defined(__minix) && !defined(_LIBC) */
|
||||
|
||||
#if !HAVE_LCHFLAGS && HAVE_STRUCT_STAT_ST_FLAGS
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
lchflags(const char *path, u_long flags)
|
||||
{
|
||||
struct stat psb;
|
||||
|
||||
if (lstat(path, &psb) == -1)
|
||||
return -1;
|
||||
if (S_ISLNK(psb.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
#if defined(__minix)
|
||||
return 0;
|
||||
#else
|
||||
return (chflags(path, flags));
|
||||
#endif /* defined(__minix) */
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
/* $NetBSD: lchmod.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Luke Mewburn.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate lchmod(2), checking path with lstat(2) first to ensure that
|
||||
* it's not a symlink, and then call chmod(2) */
|
||||
|
||||
#if !defined(__minix) && !defined(_LIBC)
|
||||
#include "nbtool_config.h"
|
||||
#endif /* !defined(__minix) && !defined(_LIBC) */
|
||||
|
||||
#if !HAVE_LCHMOD
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
lchmod(const char *path, mode_t mode)
|
||||
{
|
||||
struct stat psb;
|
||||
|
||||
if (lstat(path, &psb) == -1)
|
||||
return -1;
|
||||
if (S_ISLNK(psb.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
return (chmod(path, mode));
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* $NetBSD: lchown.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Luke Mewburn.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate lchown(2), checking path with lstat(2) first to ensure that
|
||||
* it's not a symlink, and then call chown(2) */
|
||||
|
||||
#if !defined(__minix) && !defined(_LIBC)
|
||||
#include "nbtool_config.h"
|
||||
#endif /* !defined(__minix) && !defined(_LIBC) */
|
||||
|
||||
#if !HAVE_LCHOWN
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(__minix) && defined(__weak_alias) && defined(_LIBC)
|
||||
__weak_alias(__posix_lchown, lchown)
|
||||
#endif /* defined(__minix) && defined(__weak_alias) && defined(_LIBC) */
|
||||
|
||||
int
|
||||
lchown(const char *path, uid_t owner, gid_t group)
|
||||
{
|
||||
struct stat psb;
|
||||
|
||||
if (lstat(path, &psb) == -1)
|
||||
return -1;
|
||||
if (S_ISLNK(psb.st_mode)) {
|
||||
return 0;
|
||||
}
|
||||
return (chown(path, owner, group));
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: md2.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD MD2 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../include/md2.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: md4.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD MD4 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/md4.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: md5.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD MD5 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/md5.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: mpool.h,v 1.1 2002/01/21 20:04:37 tv Exp $ */
|
||||
|
||||
#include "../../include/mpool.h"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
/* $NetBSD: namespace.h,v 1.3 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Mainly empty header to make reachover bits of libc happy.
|
||||
*
|
||||
* Since all reachover bits will include this, it's a good place to pull
|
||||
* in nbtool_config.h.
|
||||
*/
|
||||
#include "nbtool_config.h"
|
||||
|
||||
/* No aliases in reachover-based libc sources. */
|
||||
#undef __indr_reference
|
||||
#undef __weak_alias
|
||||
#undef __warn_references
|
||||
|
|
@ -1,687 +0,0 @@
|
|||
/* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
|
||||
/* $NetBSD: nbtool_config.h.in,v 1.37 2015/07/26 14:01:53 kamil Exp $ */
|
||||
|
||||
#ifndef __NETBSD_NBTOOL_CONFIG_H__
|
||||
#define __NETBSD_NBTOOL_CONFIG_H__
|
||||
|
||||
/* Define to 1 if your `fparseln' function is broken. */
|
||||
#undef BROKEN_FPARSELN
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have the <arpa/nameser.h> header file. */
|
||||
#undef HAVE_ARPA_NAMESER_H
|
||||
|
||||
/* Define if you have the `asnprintf' function. */
|
||||
#undef HAVE_ASNPRINTF
|
||||
|
||||
/* Define if you have the `asprintf' function. */
|
||||
#undef HAVE_ASPRINTF
|
||||
|
||||
/* Define if you have the <assert.h> header file. */
|
||||
#undef HAVE_ASSERT_H
|
||||
|
||||
/* Define if you have the `atoll' function. */
|
||||
#undef HAVE_ATOLL
|
||||
|
||||
/* Define if you have the `basename' function. */
|
||||
#undef HAVE_BASENAME
|
||||
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#undef HAVE_CTYPE_H
|
||||
|
||||
/* Define to 1 if you have the declaration of `be16dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE16DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be16enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE16ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE16TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `be32dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE32DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be32enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE32ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be32toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE32TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `be64dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE64DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be64enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE64ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `be64toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BE64TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap16', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BSWAP16
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap32', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BSWAP32
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap64', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_BSWAP64
|
||||
|
||||
/* Define to 1 if you have the declaration of `errc', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_ERRC
|
||||
|
||||
/* Define to 1 if you have the declaration of `fstatvfs', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_FSTATVFS
|
||||
|
||||
/* Define to 1 if you have the declaration of `gid_from_group', and to 0 if
|
||||
you don't. */
|
||||
#undef HAVE_DECL_GID_FROM_GROUP
|
||||
|
||||
/* Define to 1 if you have the declaration of `group_from_gid', and to 0 if
|
||||
you don't. */
|
||||
#undef HAVE_DECL_GROUP_FROM_GID
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe16', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOBE16
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe32', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOBE32
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe64', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOBE64
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole16', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOLE16
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole32', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOLE32
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole64', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_HTOLE64
|
||||
|
||||
/* Define to 1 if you have the declaration of `lchflags', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LCHFLAGS
|
||||
|
||||
/* Define to 1 if you have the declaration of `lchmod', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_LCHMOD
|
||||
|
||||
/* Define to 1 if you have the declaration of `lchown', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_LCHOWN
|
||||
|
||||
/* Define to 1 if you have the declaration of `le16dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE16DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le16enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE16ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le16toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE16TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `le32dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE32DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le32enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE32ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le32toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE32TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `le64dec', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE64DEC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le64enc', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE64ENC
|
||||
|
||||
/* Define to 1 if you have the declaration of `le64toh', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_LE64TOH
|
||||
|
||||
/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_OPTIND
|
||||
|
||||
/* Define to 1 if you have the declaration of `optreset', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_OPTRESET
|
||||
|
||||
/* Define to 1 if you have the declaration of `pwcache_groupdb', and to 0 if
|
||||
you don't. */
|
||||
#undef HAVE_DECL_PWCACHE_GROUPDB
|
||||
|
||||
/* Define to 1 if you have the declaration of `pwcache_userdb', and to 0 if
|
||||
you don't. */
|
||||
#undef HAVE_DECL_PWCACHE_USERDB
|
||||
|
||||
/* Define to 1 if you have the declaration of `setgroupent', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SETGROUPENT
|
||||
|
||||
/* Define to 1 if you have the declaration of `setpassent', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SETPASSENT
|
||||
|
||||
/* Define to 1 if you have the declaration of `strndup', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRNDUP
|
||||
|
||||
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRNLEN
|
||||
|
||||
/* Define to 1 if you have the declaration of `strsuftoll', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRSUFTOLL
|
||||
|
||||
/* Define to 1 if you have the declaration of `sys_signame', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SYS_SIGNAME
|
||||
|
||||
/* Define to 1 if you have the declaration of `uid_from_user', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_UID_FROM_USER
|
||||
|
||||
/* Define to 1 if you have the declaration of `user_from_uid', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_USER_FROM_UID
|
||||
|
||||
/* Define to 1 if you have the declaration of `verrc', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_VERRC
|
||||
|
||||
/* Define to 1 if you have the declaration of `vwarnc', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_VWARNC
|
||||
|
||||
/* Define to 1 if you have the declaration of `warnc', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_WARNC
|
||||
|
||||
/* Define if you have the `devname' function. */
|
||||
#undef HAVE_DEVNAME
|
||||
|
||||
/* Define if you have the <dirent.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the `dirfd' function. */
|
||||
#undef HAVE_DIRFD
|
||||
|
||||
/* Define if you have the `dirname' function. */
|
||||
#undef HAVE_DIRNAME
|
||||
|
||||
/* Define if `dd_fd' is member of `DIR'. */
|
||||
#undef HAVE_DIR_DD_FD
|
||||
|
||||
/* Define if `__dd_fd' is member of `DIR'. */
|
||||
#undef HAVE_DIR___DD_FD
|
||||
|
||||
/* Define if you have the `dprintf' function. */
|
||||
#undef HAVE_DPRINTF
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#undef HAVE_ERR_H
|
||||
|
||||
/* Define if you have the `esetfunc' function. */
|
||||
#undef HAVE_ESETFUNC
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <features.h> header file. */
|
||||
#undef HAVE_FEATURES_H
|
||||
|
||||
/* Define if you have the `fgetln' function. */
|
||||
#undef HAVE_FGETLN
|
||||
|
||||
/* Define if you have the `flock' function. */
|
||||
#undef HAVE_FLOCK
|
||||
|
||||
/* Define if you have the `fparseln' function. */
|
||||
#undef HAVE_FPARSELN
|
||||
|
||||
/* Define if you have the `fpurge' function. */
|
||||
#undef HAVE_FPURGE
|
||||
|
||||
/* Define if you have the `futimes' function. */
|
||||
#undef HAVE_FUTIMES
|
||||
|
||||
/* Define if you have the `getline' function. */
|
||||
#undef HAVE_GETLINE
|
||||
|
||||
/* Define if you have the `getopt' function. */
|
||||
#undef HAVE_GETOPT
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* Define if you have the `getopt_long' function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Define if you have the `gid_from_group' function. */
|
||||
#undef HAVE_GID_FROM_GROUP
|
||||
|
||||
/* Define if you have the `group_from_gid' function. */
|
||||
#undef HAVE_GROUP_FROM_GID
|
||||
|
||||
/* Define if you have the <grp.h> header file. */
|
||||
#undef HAVE_GRP_H
|
||||
|
||||
/* Define if you have the `heapsort' function. */
|
||||
#undef HAVE_HEAPSORT
|
||||
|
||||
/* Define if the system has the type `id_t'. */
|
||||
#undef HAVE_ID_T
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the `isblank' function. */
|
||||
#undef HAVE_ISBLANK
|
||||
|
||||
/* Define if you have the `issetugid' function. */
|
||||
#undef HAVE_ISSETUGID
|
||||
|
||||
/* Define if you have the `lchflags' function. */
|
||||
#undef HAVE_LCHFLAGS
|
||||
|
||||
/* Define if you have the `lchmod' function. */
|
||||
#undef HAVE_LCHMOD
|
||||
|
||||
/* Define if you have the `lchown' function. */
|
||||
#undef HAVE_LCHOWN
|
||||
|
||||
/* Define if you have the <libgen.h> header file. */
|
||||
#undef HAVE_LIBGEN_H
|
||||
|
||||
/* Define if you have the `regex' library (-lregex). */
|
||||
#undef HAVE_LIBREGEX
|
||||
|
||||
/* Define if you have the `rt' library (-lrt). */
|
||||
#undef HAVE_LIBRT
|
||||
|
||||
/* Define if you have the `z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if the system has the type `long long'. */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define if you have the `lutimes' function. */
|
||||
#undef HAVE_LUTIMES
|
||||
|
||||
/* Define if you have the <machine/bswap.h> header file. */
|
||||
#undef HAVE_MACHINE_BSWAP_H
|
||||
|
||||
/* Define if you have the <machine/endian.h> header file. */
|
||||
#undef HAVE_MACHINE_ENDIAN_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the `mkdtemp' function. */
|
||||
#undef HAVE_MKDTEMP
|
||||
|
||||
/* Define if you have the `mkstemp' function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <netconfig.h> header file. */
|
||||
#undef HAVE_NETCONFIG_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <paths.h> header file. */
|
||||
#undef HAVE_PATHS_H
|
||||
|
||||
/* Define if you have the `poll' function. */
|
||||
#undef HAVE_POLL
|
||||
|
||||
/* Define if you have the `pread' function. */
|
||||
#undef HAVE_PREAD
|
||||
|
||||
/* Define if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/* Define if you have the `putc_unlocked' function. */
|
||||
#undef HAVE_PUTC_UNLOCKED
|
||||
|
||||
/* Define if you have the `pwcache_groupdb' function. */
|
||||
#undef HAVE_PWCACHE_GROUPDB
|
||||
|
||||
/* Define if you have the `pwcache_userdb' function. */
|
||||
#undef HAVE_PWCACHE_USERDB
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the `pwrite' function. */
|
||||
#undef HAVE_PWRITE
|
||||
|
||||
/* Define if you have the `raise_default_signal' function. */
|
||||
#undef HAVE_RAISE_DEFAULT_SIGNAL
|
||||
|
||||
/* Define if you have the `random' function. */
|
||||
#undef HAVE_RANDOM
|
||||
|
||||
/* Define if you have the `reallocarr' function. */
|
||||
#undef HAVE_REALLOCARR
|
||||
|
||||
/* Define if you have the <resolv.h> header file. */
|
||||
#undef HAVE_RESOLV_H
|
||||
|
||||
/* Define if you have the <rpc/types.h> header file. */
|
||||
#undef HAVE_RPC_TYPES_H
|
||||
|
||||
/* Define if you have the `setenv' function. */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the `setgroupent' function. */
|
||||
#undef HAVE_SETGROUPENT
|
||||
|
||||
/* Define if you have the `setpassent' function. */
|
||||
#undef HAVE_SETPASSENT
|
||||
|
||||
/* Define if you have the `setprogname' function. */
|
||||
#undef HAVE_SETPROGNAME
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define if you have the `snprintb_m' function. */
|
||||
#undef HAVE_SNPRINTB_M
|
||||
|
||||
/* Define if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the socklen_t type. */
|
||||
#undef HAVE_SOCKLEN_T
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the `strlcat' function. */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the `strlcpy' function. */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the `strmode' function. */
|
||||
#undef HAVE_STRMODE
|
||||
|
||||
/* Define if you have the `strndup' function. */
|
||||
#undef HAVE_STRNDUP
|
||||
|
||||
/* Define if you have the `strnlen' function. */
|
||||
#undef HAVE_STRNLEN
|
||||
|
||||
/* Define if you have the `strsep' function. */
|
||||
#undef HAVE_STRSEP
|
||||
|
||||
/* Define if you have the `strsuftoll' function. */
|
||||
#undef HAVE_STRSUFTOLL
|
||||
|
||||
/* Define if you have the `strtoi' function. */
|
||||
#undef HAVE_STRTOI
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
/* Define if you have the `strtou' function. */
|
||||
#undef HAVE_STRTOU
|
||||
|
||||
/* Define if `d_namlen' is member of `struct dirent'. */
|
||||
#undef HAVE_STRUCT_DIRENT_D_NAMLEN
|
||||
|
||||
/* Define if `f_iosize' is member of `struct statvfs'. */
|
||||
#undef HAVE_STRUCT_STATVFS_F_IOSIZE
|
||||
|
||||
/* Define if `st_atim' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATIM
|
||||
|
||||
/* Define if `st_birthtime' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
||||
|
||||
/* Define if `st_birthtimensec' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
|
||||
|
||||
/* Define if `st_flags' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_FLAGS
|
||||
|
||||
/* Define if `st_gen' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_GEN
|
||||
|
||||
/* Define if `st_mtimensec' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_MTIMENSEC
|
||||
|
||||
/* Define if `tm_gmtoff' is member of `struct tm'. */
|
||||
#undef HAVE_STRUCT_TM_TM_GMTOFF
|
||||
|
||||
/* Define if you have the <sys/bswap.h> header file. */
|
||||
#undef HAVE_SYS_BSWAP_H
|
||||
|
||||
/* Define if you have the <sys/cdefs.h> header file. */
|
||||
#undef HAVE_SYS_CDEFS_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/endian.h> header file. */
|
||||
#undef HAVE_SYS_ENDIAN_H
|
||||
|
||||
/* Define if you have the <sys/featuretest.h> header file. */
|
||||
#undef HAVE_SYS_FEATURETEST_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the <sys/mman.h> header file. */
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
|
||||
/* Define if you have the <sys/mtio.h> header file. */
|
||||
#undef HAVE_SYS_MTIO_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/poll.h> header file. */
|
||||
#undef HAVE_SYS_POLL_H
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/syslimits.h> header file. */
|
||||
#undef HAVE_SYS_SYSLIMITS_H
|
||||
|
||||
/* Define if you have the <sys/sysmacros.h> header file. */
|
||||
#undef HAVE_SYS_SYSMACROS_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the <sys/utsname.h> header file. */
|
||||
#undef HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the `uid_from_user' function. */
|
||||
#undef HAVE_UID_FROM_USER
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the `user_from_uid' function. */
|
||||
#undef HAVE_USER_FROM_UID
|
||||
|
||||
/* Define if you have the <util.h> header file. */
|
||||
#undef HAVE_UTIL_H
|
||||
|
||||
/* Define if the system has the type `u_char'. */
|
||||
#undef HAVE_U_CHAR
|
||||
|
||||
/* Define if the system has the type `u_int'. */
|
||||
#undef HAVE_U_INT
|
||||
|
||||
/* Define if the system has the type `u_long'. */
|
||||
#undef HAVE_U_LONG
|
||||
|
||||
/* Define if the system has the type `u_quad_t'. */
|
||||
#undef HAVE_U_QUAD_T
|
||||
|
||||
/* Define if the system has the type `u_short'. */
|
||||
#undef HAVE_U_SHORT
|
||||
|
||||
/* Define if you have the `vasnprintf' function. */
|
||||
#undef HAVE_VASNPRINTF
|
||||
|
||||
/* Define if you have the `vasprintf' function. */
|
||||
#undef HAVE_VASPRINTF
|
||||
|
||||
/* Define if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define if you have the `__fpurge' function. */
|
||||
#undef HAVE___FPURGE
|
||||
|
||||
/* Path to sh(1). */
|
||||
#undef PATH_BSHELL
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your processor stores words with the most significant byte first
|
||||
(like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define for NetBSD headers. */
|
||||
#undef _POSIX_C_SOURCE
|
||||
|
||||
/* Define for NetBSD headers. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define for NetBSD headers. */
|
||||
#undef _XOPEN_SOURCE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have uint16_t, but not u_int16_t. */
|
||||
#undef u_int16_t
|
||||
|
||||
/* Define if you have uint32_t, but not u_int32_t. */
|
||||
#undef u_int32_t
|
||||
|
||||
/* Define if you have uint64_t, but not u_int64_t. */
|
||||
#undef u_int64_t
|
||||
|
||||
/* Define if you have uint8_t, but not u_int8_t. */
|
||||
#undef u_int8_t
|
||||
|
||||
/* Define if you have u_int16_t, but not uint16_t. */
|
||||
#undef uint16_t
|
||||
|
||||
/* Define if you have u_int32_t, but not uint32_t. */
|
||||
#undef uint32_t
|
||||
|
||||
/* Define if you have u_int64_t, but not uint64_t. */
|
||||
#undef uint64_t
|
||||
|
||||
/* Define if you have u_int8_t, but not uint8_t. */
|
||||
#undef uint8_t
|
||||
|
||||
#include "compat_defs.h"
|
||||
#endif /* !__NETBSD_NBTOOL_CONFIG_H__ */
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
/* $NetBSD: ndbm.h,v 1.1 2010/02/03 15:34:44 roy Exp $ */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
#ifndef DBM_SUFFIX
|
||||
#define DBM_SUFFIX ".db"
|
||||
#endif
|
||||
#include "../../include/ndbm.h"
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
/* $NetBSD: nl_types.h,v 1.3 2014/11/12 15:08:52 joerg Exp $ */
|
||||
|
||||
#if defined(_NLS_PRIVATE)
|
||||
|
||||
/* #if defined(__minix) */
|
||||
/* <sys/cdefs> defines __format_arg, but on some other platforms it doesn't.
|
||||
* <nl_types.h> includes <sys/cdefs> because it needs __format_arg. As it might
|
||||
* not be defined, we do it here as a work around. */
|
||||
#ifndef __format_arg
|
||||
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
|
||||
#endif
|
||||
/* #endif defined(__minix) */
|
||||
|
||||
#include "../../include/nl_types.h"
|
||||
#elif defined(__GNUC__)
|
||||
#include_next <nl_types.h>
|
||||
#endif
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/* $NetBSD: pread.c,v 1.4 2008/04/28 20:24:12 martin 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate pread() with lseek()/read()/lseek(). Not thread-safe, of course. */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_PREAD
|
||||
#include <unistd.h>
|
||||
|
||||
ssize_t pread(int d, void *buf, size_t nbytes, off_t offset) {
|
||||
off_t oldoff = lseek(d, offset, SEEK_SET);
|
||||
int olderrno;
|
||||
ssize_t nr;
|
||||
|
||||
if (oldoff < 0)
|
||||
return -1;
|
||||
|
||||
nr = read(d, buf, nbytes);
|
||||
|
||||
olderrno = errno;
|
||||
lseek(d, oldoff, SEEK_SET);
|
||||
errno = olderrno;
|
||||
|
||||
return nr;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/* $NetBSD: putc_unlocked.c,v 1.4 2008/04/28 20:24:12 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jason R. Thorpe.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate putc_unlocked(). */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_PUTC_UNLOCKED
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef putc_unlocked
|
||||
int
|
||||
putc_unlocked(int c, FILE *stream)
|
||||
{
|
||||
|
||||
putc(c, stream);
|
||||
}
|
||||
#endif /* putc_unlocked */
|
||||
#endif
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/* $NetBSD: pwrite.c,v 1.4 2008/04/28 20:24:12 martin 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate pwrite() with lseek()/write()/lseek(). Not thread-safe, of course. */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_PWRITE
|
||||
#include <unistd.h>
|
||||
|
||||
ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset) {
|
||||
off_t oldoff = lseek(d, offset, SEEK_SET);
|
||||
int olderrno;
|
||||
ssize_t nw;
|
||||
|
||||
if (oldoff < 0)
|
||||
return -1;
|
||||
|
||||
nw = write(d, buf, nbytes);
|
||||
|
||||
olderrno = errno;
|
||||
lseek(d, oldoff, SEEK_SET);
|
||||
errno = olderrno;
|
||||
|
||||
return nw;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: rmd160.h,v 1.4 2013/02/07 20:30:29 christos Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD rmd160 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/rmd160.h"
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/* $NetBSD: setenv.c,v 1.4 2008/04/28 20:24:12 martin 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Emulate setenv() with getenv()/malloc()/putenv(). */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_SETENV
|
||||
int setenv(const char *name, const char *value, int overwrite) {
|
||||
char *buf;
|
||||
|
||||
if (!overwrite && getenv(name))
|
||||
return 0;
|
||||
|
||||
/* Include sizes plus '=' and trailing null. */
|
||||
if (!(buf = malloc(strlen(name) + strlen(value) + 2)))
|
||||
return -1;
|
||||
|
||||
sprintf(buf, "%s=%s", name, value);
|
||||
putenv(buf);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/* $NetBSD: setgroupent.c,v 1.4 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_SETGROUPENT || !HAVE_DECL_SETGROUPENT
|
||||
#include <grp.h>
|
||||
|
||||
int setgroupent(int stayopen) {
|
||||
setgrent();
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/* $NetBSD: setpassent.c,v 1.4 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_SETPASSENT || !HAVE_DECL_SETPASSENT
|
||||
#include <pwd.h>
|
||||
|
||||
int setpassent(int stayopen) {
|
||||
setpwent();
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* $NetBSD: setprogname.c,v 1.5 2008/04/28 20:24:12 martin 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "nbtool_config.h"
|
||||
|
||||
#if !HAVE_SETPROGNAME
|
||||
#include <string.h>
|
||||
|
||||
static const char *__progname = "command line";
|
||||
|
||||
void
|
||||
setprogname(const char *progname)
|
||||
{
|
||||
__progname = strrchr(progname, '/');
|
||||
if (__progname == NULL)
|
||||
__progname = progname;
|
||||
else
|
||||
__progname++;
|
||||
}
|
||||
|
||||
const char *
|
||||
getprogname(void)
|
||||
{
|
||||
return __progname;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: sha1.h,v 1.5 2013/02/07 20:30:29 christos Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD sha1 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/sha1.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: sha2.h,v 1.2 2013/02/07 20:31:52 christos Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD sha2 in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../sys/sys/sha2.h"
|
||||
|
|
@ -1,663 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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.
|
||||
*/
|
||||
|
||||
/* From heimdal lib/roken/snprintf.c. */
|
||||
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
RCSID("$Id: snprintf.c,v 1.3 2003/10/27 00:12:43 lukem Exp $");
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#if 0
|
||||
#include <roken.h>
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#undef max
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
enum format_flags {
|
||||
minus_flag = 1,
|
||||
plus_flag = 2,
|
||||
space_flag = 4,
|
||||
alternate_flag = 8,
|
||||
zero_flag = 16
|
||||
};
|
||||
|
||||
/*
|
||||
* Common state
|
||||
*/
|
||||
|
||||
struct state {
|
||||
unsigned char *str;
|
||||
unsigned char *s;
|
||||
unsigned char *theend;
|
||||
size_t sz;
|
||||
size_t max_sz;
|
||||
void (*append_char)(struct state *, unsigned char);
|
||||
/* XXX - methods */
|
||||
};
|
||||
|
||||
#if TEST_SNPRINTF
|
||||
#include "snprintf-test.h"
|
||||
#endif /* TEST_SNPRINTF */
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF)
|
||||
static int
|
||||
sn_reserve (struct state *state, size_t n)
|
||||
{
|
||||
return state->s + n > state->theend;
|
||||
}
|
||||
|
||||
static void
|
||||
sn_append_char (struct state *state, unsigned char c)
|
||||
{
|
||||
if (!sn_reserve (state, 1))
|
||||
*state->s++ = c;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
as_reserve (struct state *state, size_t n)
|
||||
{
|
||||
if (state->s + n > state->theend) {
|
||||
int off = state->s - state->str;
|
||||
unsigned char *tmp;
|
||||
|
||||
if (state->max_sz && state->sz >= state->max_sz)
|
||||
return 1;
|
||||
|
||||
state->sz = max(state->sz * 2, state->sz + n);
|
||||
if (state->max_sz)
|
||||
state->sz = min(state->sz, state->max_sz);
|
||||
tmp = realloc (state->str, state->sz);
|
||||
if (tmp == NULL)
|
||||
return 1;
|
||||
state->str = tmp;
|
||||
state->s = state->str + off;
|
||||
state->theend = state->str + state->sz - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
as_append_char (struct state *state, unsigned char c)
|
||||
{
|
||||
if(!as_reserve (state, 1))
|
||||
*state->s++ = c;
|
||||
}
|
||||
|
||||
/* longest integer types */
|
||||
|
||||
#ifdef HAVE_LONG_LONG
|
||||
typedef unsigned long long u_longest;
|
||||
typedef long long longest;
|
||||
#else
|
||||
typedef unsigned long u_longest;
|
||||
typedef long longest;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* is # supposed to do anything?
|
||||
*/
|
||||
|
||||
static int
|
||||
use_alternative (int flags, u_longest num, unsigned base)
|
||||
{
|
||||
return flags & alternate_flag && (base == 16 || base == 8) && num != 0;
|
||||
}
|
||||
|
||||
static int
|
||||
append_number(struct state *state,
|
||||
u_longest num, unsigned base, char *rep,
|
||||
int width, int prec, int flags, int minusp)
|
||||
{
|
||||
int len = 0;
|
||||
int i;
|
||||
u_longest n = num;
|
||||
|
||||
/* given precision, ignore zero flag */
|
||||
if(prec != -1)
|
||||
flags &= ~zero_flag;
|
||||
else
|
||||
prec = 1;
|
||||
/* zero value with zero precision -> "" */
|
||||
if(prec == 0 && n == 0)
|
||||
return 0;
|
||||
do{
|
||||
(*state->append_char)(state, rep[n % base]);
|
||||
++len;
|
||||
n /= base;
|
||||
} while(n);
|
||||
prec -= len;
|
||||
/* pad with prec zeros */
|
||||
while(prec-- > 0){
|
||||
(*state->append_char)(state, '0');
|
||||
++len;
|
||||
}
|
||||
/* add length of alternate prefix (added later) to len */
|
||||
if(use_alternative(flags, num, base))
|
||||
len += base / 8;
|
||||
/* pad with zeros */
|
||||
if(flags & zero_flag){
|
||||
width -= len;
|
||||
if(minusp || (flags & space_flag) || (flags & plus_flag))
|
||||
width--;
|
||||
while(width-- > 0){
|
||||
(*state->append_char)(state, '0');
|
||||
len++;
|
||||
}
|
||||
}
|
||||
/* add alternate prefix */
|
||||
if(use_alternative(flags, num, base)){
|
||||
if(base == 16)
|
||||
(*state->append_char)(state, rep[10] + 23); /* XXX */
|
||||
(*state->append_char)(state, '0');
|
||||
}
|
||||
/* add sign */
|
||||
if(minusp){
|
||||
(*state->append_char)(state, '-');
|
||||
++len;
|
||||
} else if(flags & plus_flag) {
|
||||
(*state->append_char)(state, '+');
|
||||
++len;
|
||||
} else if(flags & space_flag) {
|
||||
(*state->append_char)(state, ' ');
|
||||
++len;
|
||||
}
|
||||
if(flags & minus_flag)
|
||||
/* swap before padding with spaces */
|
||||
for(i = 0; i < len / 2; i++){
|
||||
char c = state->s[-i-1];
|
||||
state->s[-i-1] = state->s[-len+i];
|
||||
state->s[-len+i] = c;
|
||||
}
|
||||
width -= len;
|
||||
while(width-- > 0){
|
||||
(*state->append_char)(state, ' ');
|
||||
++len;
|
||||
}
|
||||
if(!(flags & minus_flag))
|
||||
/* swap after padding with spaces */
|
||||
for(i = 0; i < len / 2; i++){
|
||||
char c = state->s[-i-1];
|
||||
state->s[-i-1] = state->s[-len+i];
|
||||
state->s[-len+i] = c;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* return length
|
||||
*/
|
||||
|
||||
static int
|
||||
append_string (struct state *state,
|
||||
const unsigned char *arg,
|
||||
int width,
|
||||
int prec,
|
||||
int flags)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
if(arg == NULL)
|
||||
arg = (const unsigned char*)"(null)";
|
||||
|
||||
if(prec != -1)
|
||||
width -= prec;
|
||||
else
|
||||
width -= strlen((const char *)arg);
|
||||
if(!(flags & minus_flag))
|
||||
while(width-- > 0) {
|
||||
(*state->append_char) (state, ' ');
|
||||
++len;
|
||||
}
|
||||
if (prec != -1) {
|
||||
while (*arg && prec--) {
|
||||
(*state->append_char) (state, *arg++);
|
||||
++len;
|
||||
}
|
||||
} else {
|
||||
while (*arg) {
|
||||
(*state->append_char) (state, *arg++);
|
||||
++len;
|
||||
}
|
||||
}
|
||||
if(flags & minus_flag)
|
||||
while(width-- > 0) {
|
||||
(*state->append_char) (state, ' ');
|
||||
++len;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
static int
|
||||
append_char(struct state *state,
|
||||
unsigned char arg,
|
||||
int width,
|
||||
int flags)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
while(!(flags & minus_flag) && --width > 0) {
|
||||
(*state->append_char) (state, ' ') ;
|
||||
++len;
|
||||
}
|
||||
(*state->append_char) (state, arg);
|
||||
++len;
|
||||
while((flags & minus_flag) && --width > 0) {
|
||||
(*state->append_char) (state, ' ');
|
||||
++len;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This can't be made into a function...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LONG_LONG
|
||||
|
||||
#define PARSE_INT_FORMAT(res, arg, unsig) \
|
||||
if (long_long_flag) \
|
||||
res = (unsig long long)va_arg(arg, unsig long long); \
|
||||
else if (long_flag) \
|
||||
res = (unsig long)va_arg(arg, unsig long); \
|
||||
else if (short_flag) \
|
||||
res = (unsig short)va_arg(arg, unsig int); \
|
||||
else \
|
||||
res = (unsig int)va_arg(arg, unsig int)
|
||||
|
||||
#else
|
||||
|
||||
#define PARSE_INT_FORMAT(res, arg, unsig) \
|
||||
if (long_flag) \
|
||||
res = (unsig long)va_arg(arg, unsig long); \
|
||||
else if (short_flag) \
|
||||
res = (unsig short)va_arg(arg, unsig int); \
|
||||
else \
|
||||
res = (unsig int)va_arg(arg, unsig int)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* zyxprintf - return length, as snprintf
|
||||
*/
|
||||
|
||||
static int
|
||||
xyzprintf (struct state *state, const char *char_format, va_list ap)
|
||||
{
|
||||
const unsigned char *format = (const unsigned char *)char_format;
|
||||
unsigned char c;
|
||||
int len = 0;
|
||||
|
||||
while((c = *format++)) {
|
||||
if (c == '%') {
|
||||
int flags = 0;
|
||||
int width = 0;
|
||||
int prec = -1;
|
||||
int long_long_flag = 0;
|
||||
int long_flag = 0;
|
||||
int short_flag = 0;
|
||||
|
||||
/* flags */
|
||||
while((c = *format++)){
|
||||
if(c == '-')
|
||||
flags |= minus_flag;
|
||||
else if(c == '+')
|
||||
flags |= plus_flag;
|
||||
else if(c == ' ')
|
||||
flags |= space_flag;
|
||||
else if(c == '#')
|
||||
flags |= alternate_flag;
|
||||
else if(c == '0')
|
||||
flags |= zero_flag;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if((flags & space_flag) && (flags & plus_flag))
|
||||
flags ^= space_flag;
|
||||
|
||||
if((flags & minus_flag) && (flags & zero_flag))
|
||||
flags ^= zero_flag;
|
||||
|
||||
/* width */
|
||||
if (isdigit(c))
|
||||
do {
|
||||
width = width * 10 + c - '0';
|
||||
c = *format++;
|
||||
} while(isdigit(c));
|
||||
else if(c == '*') {
|
||||
width = va_arg(ap, int);
|
||||
c = *format++;
|
||||
}
|
||||
|
||||
/* precision */
|
||||
if (c == '.') {
|
||||
prec = 0;
|
||||
c = *format++;
|
||||
if (isdigit(c))
|
||||
do {
|
||||
prec = prec * 10 + c - '0';
|
||||
c = *format++;
|
||||
} while(isdigit(c));
|
||||
else if (c == '*') {
|
||||
prec = va_arg(ap, int);
|
||||
c = *format++;
|
||||
}
|
||||
}
|
||||
|
||||
/* size */
|
||||
|
||||
if (c == 'h') {
|
||||
short_flag = 1;
|
||||
c = *format++;
|
||||
} else if (c == 'l') {
|
||||
long_flag = 1;
|
||||
c = *format++;
|
||||
if (c == 'l') {
|
||||
long_long_flag = 1;
|
||||
c = *format++;
|
||||
}
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 'c' :
|
||||
append_char(state, va_arg(ap, int), width, flags);
|
||||
++len;
|
||||
break;
|
||||
case 's' :
|
||||
len += append_string(state,
|
||||
va_arg(ap, unsigned char*),
|
||||
width,
|
||||
prec,
|
||||
flags);
|
||||
break;
|
||||
case 'd' :
|
||||
case 'i' : {
|
||||
longest arg;
|
||||
u_longest num;
|
||||
int minusp = 0;
|
||||
|
||||
PARSE_INT_FORMAT(arg, ap, signed);
|
||||
|
||||
if (arg < 0) {
|
||||
minusp = 1;
|
||||
num = -arg;
|
||||
} else
|
||||
num = arg;
|
||||
|
||||
len += append_number (state, num, 10, "0123456789",
|
||||
width, prec, flags, minusp);
|
||||
break;
|
||||
}
|
||||
case 'u' : {
|
||||
u_longest arg;
|
||||
|
||||
PARSE_INT_FORMAT(arg, ap, unsigned);
|
||||
|
||||
len += append_number (state, arg, 10, "0123456789",
|
||||
width, prec, flags, 0);
|
||||
break;
|
||||
}
|
||||
case 'o' : {
|
||||
u_longest arg;
|
||||
|
||||
PARSE_INT_FORMAT(arg, ap, unsigned);
|
||||
|
||||
len += append_number (state, arg, 010, "01234567",
|
||||
width, prec, flags, 0);
|
||||
break;
|
||||
}
|
||||
case 'x' : {
|
||||
u_longest arg;
|
||||
|
||||
PARSE_INT_FORMAT(arg, ap, unsigned);
|
||||
|
||||
len += append_number (state, arg, 0x10, "0123456789abcdef",
|
||||
width, prec, flags, 0);
|
||||
break;
|
||||
}
|
||||
case 'X' :{
|
||||
u_longest arg;
|
||||
|
||||
PARSE_INT_FORMAT(arg, ap, unsigned);
|
||||
|
||||
len += append_number (state, arg, 0x10, "0123456789ABCDEF",
|
||||
width, prec, flags, 0);
|
||||
break;
|
||||
}
|
||||
case 'p' : {
|
||||
unsigned long arg = (unsigned long)va_arg(ap, void*);
|
||||
|
||||
len += append_number (state, arg, 0x10, "0123456789ABCDEF",
|
||||
width, prec, flags, 0);
|
||||
break;
|
||||
}
|
||||
case 'n' : {
|
||||
int *arg = va_arg(ap, int*);
|
||||
*arg = state->s - state->str;
|
||||
break;
|
||||
}
|
||||
case '\0' :
|
||||
--format;
|
||||
/* FALLTHROUGH */
|
||||
case '%' :
|
||||
(*state->append_char)(state, c);
|
||||
++len;
|
||||
break;
|
||||
default :
|
||||
(*state->append_char)(state, '%');
|
||||
(*state->append_char)(state, c);
|
||||
len += 2;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
(*state->append_char) (state, c);
|
||||
++len;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
snprintf (char *str, size_t sz, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int ret;
|
||||
|
||||
va_start(args, format);
|
||||
ret = vsnprintf (str, sz, format, args);
|
||||
va_end(args);
|
||||
|
||||
#ifdef PARANOIA
|
||||
{
|
||||
int ret2;
|
||||
char *tmp;
|
||||
|
||||
tmp = malloc (sz);
|
||||
if (tmp == NULL)
|
||||
abort ();
|
||||
|
||||
va_start(args, format);
|
||||
ret2 = vsprintf (tmp, format, args);
|
||||
va_end(args);
|
||||
if (ret != ret2 || strcmp(str, tmp))
|
||||
abort ();
|
||||
free (tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ASPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
asprintf (char **ret, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int val;
|
||||
|
||||
va_start(args, format);
|
||||
val = vasprintf (ret, format, args);
|
||||
|
||||
#ifdef PARANOIA
|
||||
{
|
||||
int ret2;
|
||||
char *tmp;
|
||||
tmp = malloc (val + 1);
|
||||
if (tmp == NULL)
|
||||
abort ();
|
||||
|
||||
ret2 = vsprintf (tmp, format, args);
|
||||
if (val != ret2 || strcmp(*ret, tmp))
|
||||
abort ();
|
||||
free (tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
va_end(args);
|
||||
return val;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ASNPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
asnprintf (char **ret, size_t max_sz, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
int val;
|
||||
|
||||
va_start(args, format);
|
||||
val = vasnprintf (ret, max_sz, format, args);
|
||||
|
||||
#ifdef PARANOIA
|
||||
{
|
||||
int ret2;
|
||||
char *tmp;
|
||||
tmp = malloc (val + 1);
|
||||
if (tmp == NULL)
|
||||
abort ();
|
||||
|
||||
ret2 = vsprintf (tmp, format, args);
|
||||
if (val != ret2 || strcmp(*ret, tmp))
|
||||
abort ();
|
||||
free (tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
va_end(args);
|
||||
return val;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_VASPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
vasprintf (char **ret, const char *format, va_list args)
|
||||
{
|
||||
return vasnprintf (ret, 0, format, args);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(HAVE_VASNPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
|
||||
{
|
||||
int st;
|
||||
struct state state;
|
||||
|
||||
state.max_sz = max_sz;
|
||||
state.sz = 1;
|
||||
state.str = malloc(state.sz);
|
||||
if (state.str == NULL) {
|
||||
*ret = NULL;
|
||||
return -1;
|
||||
}
|
||||
state.s = state.str;
|
||||
state.theend = state.s + state.sz - 1;
|
||||
state.append_char = as_append_char;
|
||||
|
||||
st = xyzprintf (&state, format, args);
|
||||
if (st > state.sz) {
|
||||
free (state.str);
|
||||
*ret = NULL;
|
||||
return -1;
|
||||
} else {
|
||||
char *tmp;
|
||||
|
||||
*state.s = '\0';
|
||||
tmp = realloc (state.str, st+1);
|
||||
if (tmp == NULL) {
|
||||
free (state.str);
|
||||
*ret = NULL;
|
||||
return -1;
|
||||
}
|
||||
*ret = tmp;
|
||||
return st;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF)
|
||||
int
|
||||
vsnprintf (char *str, size_t sz, const char *format, va_list args)
|
||||
{
|
||||
struct state state;
|
||||
int ret;
|
||||
unsigned char *ustr = (unsigned char *)str;
|
||||
|
||||
state.max_sz = 0;
|
||||
state.sz = sz;
|
||||
state.str = ustr;
|
||||
state.s = ustr;
|
||||
state.theend = ustr + sz - (sz > 0);
|
||||
state.append_char = sn_append_char;
|
||||
|
||||
ret = xyzprintf (&state, format, args);
|
||||
if (state.s != NULL)
|
||||
*state.s = '\0';
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: null.h,v 1.1 2007/07/19 13:49:12 jmmv Exp $ */
|
||||
|
||||
#include "../../../sys/sys/null.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: queue.h,v 1.1 2002/01/21 20:04:37 tv Exp $ */
|
||||
|
||||
#include "../../../sys/sys/queue.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: rmd160.h,v 1.1 2006/10/27 22:32:45 mrg Exp $ */
|
||||
|
||||
#include "../../../sys/sys/rmd160.h"
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
/* $NetBSD: sha1.h,v 1.2 2013/03/12 01:52:55 christos Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD SHA1 in libnbcompat. */
|
||||
#include "../../sys/sys/sha1.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: sha2.h,v 1.1 2006/10/27 22:32:45 mrg Exp $ */
|
||||
|
||||
#include "../../../sys/sys/sha2.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: verified_exec.h,v 1.1 2006/12/20 22:03:20 agc Exp $ */
|
||||
|
||||
#include "../../sys/sys/verified_exec.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: tzfile.h,v 1.1 2002/01/31 22:43:49 tv Exp $ */
|
||||
|
||||
#include "../../include/tzfile.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: ffs_extern.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ffs/ffs_extern.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: fs.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ffs/fs.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: dinode.h,v 1.1 2003/05/14 00:30:26 dbj Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ufs/dinode.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: dir.h,v 1.1 2003/05/14 00:30:27 dbj Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ufs/dir.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: quota.h,v 1.1 2011/03/07 02:02:36 joerg Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ufs/quota.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: ufs_bswap.h,v 1.1 2003/05/14 00:30:27 dbj Exp $ */
|
||||
|
||||
#include "../../../../sys/ufs/ufs/ufs_bswap.h"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* $NetBSD: vis.h,v 1.2 2003/10/27 00:12:43 lukem Exp $ */
|
||||
|
||||
/* We unconditionally use the NetBSD vis(3) in libnbcompat. */
|
||||
#include "nbtool_config.h"
|
||||
#include "../../include/vis.h"
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Enumerate repository files and guess which are C++23 upgraded.
|
||||
|
||||
The script walks the directory tree rooted at the repository and prints a
|
||||
summary of file types. It also inspects C++ source files and uses simple
|
||||
heuristics to determine whether they likely use C++23 features.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import mimetypes
|
||||
from dataclasses import dataclass
|
||||
from typing import Iterator, List
|
||||
|
||||
|
||||
CXX_EXTENSIONS = {".cpp", ".cc", ".cxx", ".C", ".hpp", ".hh", ".hxx"}
|
||||
|
||||
CXX23_MARKERS = [
|
||||
"consteval", # keyword introduced in C++20, relevant for 23
|
||||
"std::expected", # library feature from C++23
|
||||
"std::print", # print facility in C++23
|
||||
"std::format", # improved in C++23
|
||||
"std::ranges", # ranges library
|
||||
"co_await", # coroutine keyword
|
||||
"#if __cplusplus >= 202302L", # direct version check
|
||||
]
|
||||
|
||||
|
||||
@dataclass
|
||||
class FileInfo:
|
||||
"""Simple container for file information."""
|
||||
|
||||
path: str
|
||||
file_type: str
|
||||
upgraded_cpp23: bool = False
|
||||
|
||||
|
||||
def guess_file_type(path: str) -> str:
|
||||
"""Return a best-effort string describing the file type."""
|
||||
mime, _ = mimetypes.guess_type(path)
|
||||
return mime or "unknown"
|
||||
|
||||
|
||||
def walk_files(root: str) -> Iterator[str]:
|
||||
"""Yield all file paths under *root*."""
|
||||
for current, _, files in os.walk(root):
|
||||
for name in files:
|
||||
yield os.path.join(current, name)
|
||||
|
||||
|
||||
def inspect_file(path: str) -> FileInfo:
|
||||
"""Inspect *path* and return collected information."""
|
||||
ext = os.path.splitext(path)[1]
|
||||
file_type = guess_file_type(path)
|
||||
upgraded = False
|
||||
if ext in CXX_EXTENSIONS:
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8", errors="ignore") as source:
|
||||
data = source.read()
|
||||
except OSError:
|
||||
data = ""
|
||||
upgraded = any(marker in data for marker in CXX23_MARKERS)
|
||||
return FileInfo(path, file_type, upgraded)
|
||||
|
||||
|
||||
def analyze(root: str) -> tuple[list[FileInfo], list[str], list[str]]:
|
||||
"""Analyze the directory tree starting at *root*."""
|
||||
tree: List[FileInfo] = []
|
||||
upgraded: List[str] = []
|
||||
not_upgraded: List[str] = []
|
||||
for path in walk_files(root):
|
||||
info = inspect_file(path)
|
||||
tree.append(info)
|
||||
if os.path.splitext(path)[1] in CXX_EXTENSIONS:
|
||||
(upgraded if info.upgraded_cpp23 else not_upgraded).append(path)
|
||||
return tree, upgraded, not_upgraded
|
||||
|
||||
|
||||
def print_summary(
|
||||
tree: list[FileInfo], upgraded: list[str], not_upgraded: list[str]
|
||||
) -> None:
|
||||
"""Print the collected summary to stdout."""
|
||||
print("File tree and types:\n")
|
||||
for info in tree:
|
||||
print(f"{info.path}: {info.file_type}")
|
||||
print("\nC++23 upgraded files:")
|
||||
for path in upgraded:
|
||||
print(path)
|
||||
print("\nFiles not upgraded to C++23:")
|
||||
for path in not_upgraded:
|
||||
print(path)
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
"""Parse command line arguments."""
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument(
|
||||
"root", nargs="?", default=".", help="Root directory to scan"
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Entry point for command line execution."""
|
||||
args = parse_args()
|
||||
tree, upgraded, not_upgraded = analyze(args.root)
|
||||
print_summary(tree, upgraded, not_upgraded)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.7 2012/04/15 08:37:33 mrg Exp $
|
||||
#
|
||||
|
||||
GNUHOSTDIST= ${.CURDIR}/../../external/bsd/file/dist
|
||||
|
||||
CONFIGURE_ENV+= CC=${HOST_CC:Q} \
|
||||
CFLAGS=${HOST_CFLAGS:Q} \
|
||||
CPPFLAGS=${HOST_CPPFLAGS:Q} \
|
||||
CXX=${HOST_CXX:Q}
|
||||
|
||||
CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX} --disable-shared \
|
||||
--disable-warnings
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
.include "${.CURDIR}/../Makefile.gnuhost"
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} != "Minix"
|
||||
# Force avoiding possibly non-executable install-sh.
|
||||
CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
|
||||
.endif
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Generate a report of the repository file tree with file types."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import os
|
||||
from typing import Iterable, Tuple
|
||||
|
||||
|
||||
def scan_tree(start: str) -> Iterable[Tuple[str, str]]:
|
||||
"""Yield each filesystem entry path and a human-readable type."""
|
||||
for root, dirs, files in os.walk(start):
|
||||
for name in dirs:
|
||||
path = os.path.join(root, name)
|
||||
yield path, "directory"
|
||||
for name in files:
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
yield path, "symlink"
|
||||
else:
|
||||
yield path, "file"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Parse command line arguments and print the file tree report."""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Generate a file tree report with file types"
|
||||
)
|
||||
parser.add_argument(
|
||||
"start",
|
||||
nargs="?",
|
||||
default=".",
|
||||
help="directory to start scanning (default: current directory)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
for path, ftype in scan_tree(args.start):
|
||||
print(f"{path}\t{ftype}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.74 2015/01/16 20:10:26 christos Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
GCC_LANGUAGES=c c++ objc
|
||||
MODULE= gcc4
|
||||
|
||||
GCCDIST= ${.CURDIR}/../../external/gpl3/${EXTERNAL_GCC_SUBDIR}/dist
|
||||
GNUHOSTDIST= ${GCCDIST}
|
||||
|
||||
.if ${HAVE_GCC} == 48
|
||||
CC_FOR_BUILD= ${HOST_CXX:Q}
|
||||
LIB_INTL=
|
||||
.elif ${HAVE_GCC} == 45
|
||||
UNWIND_H=unwind.h
|
||||
MKNATIVE= ${.CURDIR}/mknative-gcc.old
|
||||
.endif
|
||||
|
||||
# Defaults
|
||||
CC_FOR_BUILD?= ${HOST_CC:Q}
|
||||
LIB_INTL?= "LIBS=-lintl"
|
||||
MKNATIVE?= ${.CURDIR}/mknative-gcc
|
||||
|
||||
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64"
|
||||
MULTILIB_ARGS= --enable-multilib
|
||||
.else
|
||||
MULTILIB_ARGS= --disable-multilib
|
||||
.endif
|
||||
|
||||
.if ${MKSOFTFLOAT} != "no" && ${MACHINE_CPU} != "m68k" \
|
||||
&& ${MACHINE_CPU} != "or1k"
|
||||
SOFTFLOAT_ARGS= -with-float=soft
|
||||
.endif
|
||||
|
||||
.include "gcc-version.mk"
|
||||
|
||||
COMMON_CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} \
|
||||
--enable-long-long \
|
||||
--enable-threads \
|
||||
--with-bugurl=http://www.NetBSD.org/Misc/send-pr.html \
|
||||
--with-pkgversion="NetBSD ${NETBSD_GCC_VERSION}" \
|
||||
--with-system-zlib \
|
||||
--enable-__cxa_atexit \
|
||||
# MINIX: --enable-libstdcxx-threads
|
||||
|
||||
.if defined(__MINIX)
|
||||
COMMON_CONFIGURE_ARGS+= \
|
||||
--disable-libssp \
|
||||
--enable-visibility \
|
||||
--disable-threads \
|
||||
--disable-tls
|
||||
|
||||
CONFIGURE_ENV+= gcc_cv_ld_hidden=yes
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
CONFIGURE_ENV+= LDFLAGS=-lm
|
||||
.endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
|
||||
.endif # defined(__MINIX)
|
||||
|
||||
.if defined(GCC_CONFIG_ARCH.${MACHINE_ARCH})
|
||||
COMMON_CONFIGURE_ARGS+= --with-arch=${GCC_CONFIG_ARCH.${MACHINE_ARCH}}
|
||||
.endif
|
||||
.if defined(GCC_CONFIG_TUNE.${MACHINE_ARCH})
|
||||
COMMON_CONFIGURE_ARGS+= --with-tune=${GCC_CONFIG_TUNE.${MACHINE_ARCH}}
|
||||
.endif
|
||||
|
||||
.if ${HAVE_GCC} == 48
|
||||
COMMON_CONFIGURE_ARGS+= --enable-libstdcxx-time=rt --enable-lto
|
||||
.endif
|
||||
|
||||
CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-sysroot=${DESTDIR} \
|
||||
--with-mpc=${TOOLDIR} \
|
||||
--with-mpfr=${TOOLDIR} \
|
||||
--with-gmp=${TOOLDIR} \
|
||||
--disable-nls \
|
||||
${MULTILIB_ARGS} \
|
||||
${SOFTFLOAT_ARGS} \
|
||||
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
||||
--enable-languages="${GCC_LANGUAGES}"
|
||||
|
||||
GCC_CPPFLAGS= -DNETBSD_TOOLS -DTARGET_SYSTEM_ROOT=0 \
|
||||
-DTARGET_SYSTEM_ROOT_RELOCATABLE
|
||||
|
||||
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
|
||||
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
|
||||
EXTRA_PARTS= CPPFLAGS=${GCC_CPPFLAGS:Q} \
|
||||
AR=${HOST_AR:Q} RANLIB=${HOST_RANLIB:Q}
|
||||
|
||||
CONFIGURE_ENV+= gcc_cv_libc_provides_ssp=yes \
|
||||
gcc_cv_as_sparc_gotdata_op=no
|
||||
|
||||
ALL_TARGET= all-gcc
|
||||
INSTALL_TARGET= install-gcc
|
||||
|
||||
.include "${.CURDIR}/../Makefile.gmakehost"
|
||||
BUILD_MAKE=${TOOL_GMAKE}
|
||||
|
||||
#
|
||||
# mknative-gcc specific stuff
|
||||
#
|
||||
|
||||
MKNATIVE_CONFIG_TARGET_LIBS=
|
||||
|
||||
.if ${HAVE_GCC} == 48
|
||||
MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgcc
|
||||
MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgomp
|
||||
MKNATIVE_TARGET= gcc48
|
||||
.elif ${HAVE_GCC} == 45
|
||||
MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgomp
|
||||
MKNATIVE_TARGET= gcc45
|
||||
.endif
|
||||
|
||||
MKNATIVE_CONFIG_TARGET_LIBS+= \
|
||||
configure-target-libstdc++-v3 \
|
||||
configure-target-libobjc
|
||||
|
||||
BINENV= /usr/bin/env -i
|
||||
|
||||
|
||||
MKNATIVE_ENV= ${BINENV} ${CONFIGURE_ENV:NC*:NLD*} \
|
||||
CC_FOR_BUILD=${CC_FOR_BUILD:Q} \
|
||||
CXX_FOR_BUILD=${HOST_CXX:Q} \
|
||||
CFLAGS_FOR_BUILD="-I${TOOLDIR}/include" \
|
||||
CC=${CC:Q}' '${CCADDFLAGS:Q} \
|
||||
CXX=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
|
||||
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
||||
CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
|
||||
AS=${AS:Q} AWK=${TOOL_AWK:Q} LD=${LD:Q} \
|
||||
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
||||
NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \
|
||||
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
||||
${LIB_INTL} \
|
||||
ac_cv_prog_cc_cross=yes \
|
||||
ac_cv_func_strcoll_works=yes \
|
||||
ac_cv_func_elf_getshstrndx=no \
|
||||
gcc_cv_func_printf_ptr=yes \
|
||||
gcc_cv_libc_provides_ssp=yes \
|
||||
gdb_cv_printf_has_long_double=yes \
|
||||
gdb_cv_printf_has_long_long=yes \
|
||||
gdb_cv_scanf_has_long_double=yes \
|
||||
gcc_cv_as_sparc_gotdata_op=no
|
||||
|
||||
CXXADDFLAGS= --sysroot=${DESTDIR}
|
||||
CCADDFLAGS= --sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
|
||||
|
||||
# NEWCONFIGDIR can be set to a read-write location of the source tree
|
||||
# in case the version being used is not.
|
||||
NEWCONFIGDIR?= ${.CURDIR}/../..
|
||||
|
||||
bootstrap-libgcc: .configure_done
|
||||
@echo 'Creating files needed for libgcc by a native bootstrap build.'
|
||||
(cd ${.OBJDIR}/build && ${BUILD_COMMAND} configure-target-libgcc)
|
||||
@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET}-bootstrap \
|
||||
${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
|
||||
${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
|
||||
|
||||
.if ${HAVE_GCC} == "48"
|
||||
bootstrap-libstdc++: .configure_done
|
||||
@echo 'Creating files needed for libstdc++ by a native bootstrap build.'
|
||||
(cd ${.OBJDIR}/build && ${BUILD_COMMAND} configure-target-libstdc++-v3)
|
||||
@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} libstdc++-bootstrap \
|
||||
${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
|
||||
${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
|
||||
.endif
|
||||
|
||||
native-gcc: .native/.configure_done
|
||||
@echo 'Extracting GNU GCC configury for a native toolchain.'
|
||||
@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} ${MKNATIVE_TARGET} \
|
||||
${.OBJDIR}/.native ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
|
||||
${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
|
||||
|
||||
NATIVE_CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
|
||||
MPC= ${NETBSDSRCDIR}/external/lgpl3/mpc
|
||||
MPFR= ${NETBSDSRCDIR}/external/lgpl3/mpfr
|
||||
GMP= ${NETBSDSRCDIR}/external/lgpl3/gmp
|
||||
MPCOBJ!= cd ${MPC}/lib/libmpc && ${PRINTOBJDIR}
|
||||
MPFROBJ!= cd ${MPFR}/lib/libmpfr && ${PRINTOBJDIR}
|
||||
GMPOBJ!= cd ${GMP}/lib/libgmp && ${PRINTOBJDIR}
|
||||
|
||||
GMP_MACHINE_ARCH?= ${MACHINE_ARCH:S/earmv4/arm/:C/armv[5-7]/arm/}
|
||||
|
||||
NATIVE_CONFIGURE_ARGS+= \
|
||||
--with-mpc-lib=${MPCOBJ} \
|
||||
--with-mpfr-lib=${MPFROBJ} \
|
||||
--with-gmp-lib=${GMPOBJ} \
|
||||
--with-mpc-include=${MPC}/dist/src \
|
||||
--with-mpfr-include=${MPFR}/dist/src \
|
||||
--with-gmp-include=${GMP}/lib/libgmp/arch/${GMP_MACHINE_ARCH}
|
||||
|
||||
.if !defined(__MINIX)
|
||||
.if ${MACHINE_ARCH} != "vax"
|
||||
NATIVE_CONFIGURE_ARGS+= --enable-tls
|
||||
.endif
|
||||
.endif # !defined(__MINIX)
|
||||
.if !empty(MACHINE_ARCH:Mearm*)
|
||||
NATIVE_CONFIGURE_ARGS+= --enable-initfini-array
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_ARCH} == "m68000"
|
||||
NATIVE_CONFIGURE_ARGS+= --disable-shared
|
||||
.endif
|
||||
|
||||
NATIVE_CONFIGURE_ARGS+= \
|
||||
--disable-multilib \
|
||||
--disable-symvers \
|
||||
--disable-libstdcxx-pch \
|
||||
--build=`${GCCDIST}/config.guess` \
|
||||
--host=${MACHINE_GNU_PLATFORM} \
|
||||
--with-sysroot=${DESTDIR}
|
||||
MKENV_BUILD_MAKE=cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE}
|
||||
|
||||
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
||||
mkdir .native 2>/dev/null || true
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native && ${MKNATIVE_ENV} \
|
||||
${HOST_SH} ${GNUHOSTDIST}/configure \
|
||||
${NATIVE_CONFIGURE_ARGS}) && \
|
||||
(${MKENV_BUILD_MAKE} all-build-libiberty) && \
|
||||
([ "${HAVE_GCC}" = "48" ] && \
|
||||
(${MKENV_BUILD_MAKE} all-libcpp) && \
|
||||
(${MKENV_BUILD_MAKE} all-libbacktrace) && \
|
||||
(${MKENV_BUILD_MAKE} all-libdecnumber) || true)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(${MKENV_BUILD_MAKE} configure-gcc configure-libcpp) && \
|
||||
(${MKENV_BUILD_MAKE} configure-libiberty) && \
|
||||
(${MKENV_BUILD_MAKE} configure-libdecnumber)
|
||||
# edit Makefile so that maybe-all-gcc does not depend on all-gcc any more.
|
||||
(cd .native && mv Makefile Makefile.config && \
|
||||
${TOOL_SED} -e 's/\(maybe-all-gcc:\) all-gcc/\1/' \
|
||||
-e 's/\(maybe-all-target-libgcc:\) all-target-libgcc/\1/' \
|
||||
< Makefile.config > Makefile)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e tree-check.h config.h multilib.h gcov-iov.h)
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e libgcc.mvars tconfig.h ${UNWIND_H})
|
||||
(cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 gcc/libgcc.a gcc/libgcc_s.so)
|
||||
.for _lib in ${MKNATIVE_CONFIG_TARGET_LIBS}
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} \
|
||||
${_lib} \
|
||||
ALL_GCC_C= ALL_GCC_CXX= \
|
||||
CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \
|
||||
CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
|
||||
RAW_CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
|
||||
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
||||
ac_cv_prog_cc_cross=yes) && \
|
||||
true
|
||||
.endfor
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/${MACHINE_GNU_PLATFORM}/libstdc++-v3/include && \
|
||||
${MKNATIVE_ENV} ${BUILD_MAKE} \
|
||||
CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \
|
||||
CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
|
||||
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
||||
all-local) && \
|
||||
true
|
||||
.if 0
|
||||
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
||||
(cd .native/${MACHINE_GNU_PLATFORM}/libiberty && \
|
||||
${MKNATIVE_ENV} ${BUILD_MAKE} needed-list)
|
||||
.endif
|
||||
@touch $@
|
||||
|
||||
clean: clean.native
|
||||
clean.native:
|
||||
-rm -r -f .native
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# $NetBSD: gcc-version.mk,v 1.3 2015/01/15 08:42:14 skrll Exp $
|
||||
|
||||
# common location for tools and native build
|
||||
|
||||
NETBSD_GCC_VERSION=nb2 20150115
|
||||
|
|
@ -1,435 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $NetBSD: mknative-gcc,v 1.81 2015/01/31 08:50:01 mrg Exp $
|
||||
#
|
||||
# Shell script for generating all the constants needed for a native
|
||||
# platform build of gcc.
|
||||
#
|
||||
|
||||
# initialise
|
||||
|
||||
_TMPDIR=$2
|
||||
_TOP=$3
|
||||
_SRC=$4
|
||||
_PLATFORM=$5
|
||||
_DESTDIR=$6
|
||||
_TOOLDIR=$7
|
||||
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
|
||||
_GNU_DIST=`cd ${_VPATH}; pwd`
|
||||
|
||||
if [ -z "$_DESTDIR" ]; then
|
||||
echo "\$_DESTDIR is empty" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $_TOP/tools/gcc/mknative.common
|
||||
|
||||
# default to GCC 4.1 for now
|
||||
_OUTDIR="$_TOP/gnu"
|
||||
_OUTDIRBASE="gnu"
|
||||
|
||||
sanitise_includes () {
|
||||
sed \
|
||||
-e "s,-I$_DESTDIR/usr/include,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/mpfr/dist/src,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/mpc/dist/src,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/[a-z_0-9-]*,,g" \
|
||||
-e "s,-I$_TOOLDIR/include,,g" \
|
||||
-e "s,-I/usr/include/[^ ]*,,"
|
||||
}
|
||||
|
||||
##### lib/crtstuff #####
|
||||
|
||||
get_crtstuff () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch
|
||||
|
||||
getvars gcc/Makefile \
|
||||
INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
|
||||
tm_defines xm_file xm_defines \
|
||||
| sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
|
||||
}
|
||||
|
||||
##### lib/libg2c #####
|
||||
|
||||
get_libg2c () {
|
||||
mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH
|
||||
|
||||
write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
|
||||
write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
|
||||
|
||||
{
|
||||
getvars $_PLATFORM/libf2c/Makefile \
|
||||
F2CEXT
|
||||
getvars $_PLATFORM/libf2c/libF77/Makefile \
|
||||
ALL_CFLAGS OBJS
|
||||
getvars $_PLATFORM/libf2c/libI77/Makefile \
|
||||
ALL_CFLAGS OBJS | sed 's,=,+=,'
|
||||
getvars $_PLATFORM/libf2c/libU77/Makefile \
|
||||
ALL_CFLAGS OBJS | sed 's,=,+=,'
|
||||
} | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk
|
||||
}
|
||||
|
||||
##### lib/libgcc #####
|
||||
|
||||
get_libgcc () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/lib/lib$_subdir/arch
|
||||
|
||||
# DPBIT, FPBIT only used on mn10[23]00, we don't need them.
|
||||
# XXX we should probably grab everything Just In Case for
|
||||
# the future.
|
||||
|
||||
mkdir -p $_OUTDIR/lib/lib$_subdir/arch/$MACHINE_ARCH
|
||||
cd $_TMPDIR/$_PLATFORM/libgcc
|
||||
{
|
||||
getvars $_PLATFORM/libgcc/Makefile \
|
||||
INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \
|
||||
LIB1ASMFUNCS LIB1ASMSRC \
|
||||
LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
|
||||
LIB2FUNCS_EXTRA \
|
||||
LIBGCC2_CFLAGS \
|
||||
SHLIB_MKMAP SHLIB_MKMAP_OPTS \
|
||||
SHLIB_MAPFILES SHLIB_NM_FLAGS
|
||||
getvars gcc/Makefile \
|
||||
NOEXCEPTION_FLAGS EXTRA_HEADERS
|
||||
getlinks config.status libgcc
|
||||
} | sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
if [ "${MACHINE_ARCH}" = "m68000" ]
|
||||
then
|
||||
ex <<__EOF__ $_OUTDIR/lib/lib$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
/G_LIBGCC2_CFLAGS/ s/-fPIC//
|
||||
wq
|
||||
__EOF__
|
||||
fi
|
||||
|
||||
for f in auto-target.h; do
|
||||
write_c $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/$f \
|
||||
<$_TMPDIR/$_PLATFORM/libgcc/$f
|
||||
done
|
||||
}
|
||||
|
||||
##### lib/libgcov #####
|
||||
|
||||
get_libgcov () {
|
||||
_subdir="$1"
|
||||
_mf="$2"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars $_mf \
|
||||
LIBGCOV
|
||||
} | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \
|
||||
<$_TMPDIR/gcc/gcov-iov.h
|
||||
|
||||
}
|
||||
|
||||
##### lib/libiberty #####
|
||||
|
||||
get_gcc_libiberty () {
|
||||
_subdir="$1"
|
||||
_libibertydir="lib/libiberty"
|
||||
mkdir -p $_OUTDIR/$_libibertydir/arch/$MACHINE_ARCH
|
||||
|
||||
getvars libiberty/Makefile \
|
||||
ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
|
||||
| write_mk $_OUTDIRBASE/$_libibertydir/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/$_libibertydir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/libiberty/config.h
|
||||
}
|
||||
|
||||
##### lib/libdecnumber #####
|
||||
|
||||
get_libdecnumber () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/libdecnumber/config.h
|
||||
}
|
||||
|
||||
##### lib/libgomp #####
|
||||
|
||||
get_libgomp () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/config.h
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp_f.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h
|
||||
write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp.spec \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/omp.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/omp.h
|
||||
}
|
||||
|
||||
##### lib/libbacktrace #####
|
||||
|
||||
get_libbacktrace () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/$_subdir/config.h
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/backtrace-supported.h \
|
||||
<$_TMPDIR/$_subdir/backtrace-supported.h
|
||||
}
|
||||
|
||||
##### lib/libobjc #####
|
||||
|
||||
get_libobjc () {
|
||||
_subdir="$1/arch/$MACHINE_ARCH"
|
||||
_options="ALL_OPT_FILES"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir
|
||||
|
||||
{
|
||||
if [ -n "$_options" ]; then
|
||||
getvars gcc/Makefile $_options
|
||||
fi
|
||||
getvars $_PLATFORM/libobjc/Makefile \
|
||||
ALL_CFLAGS INCLUDES OBJC_SOURCE_FILES C_SOURCE_FILES OBJC_H \
|
||||
| sed "s,$_GNU_DIST,\${GNUHOSTDIST},g"
|
||||
getlinks $_TMPDIR/$_PLATFORM/libgcc/config.status libgcc
|
||||
} | sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/config.h \
|
||||
<$_TMPDIR/$_PLATFORM/libobjc/config.h
|
||||
}
|
||||
|
||||
##### lib/libstdc++-v3 #####
|
||||
|
||||
get_libstdcxx_v3 () {
|
||||
_subdir="$1"
|
||||
_ver="$2"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
|
||||
|
||||
_build_headers="c++config.h cxxabi_tweaks.h gthr-posix.h gthr-single.h gthr.h"
|
||||
_headers1="c_base_headers_extra_install"
|
||||
_headers1="$_headers1 tr1_headers tr2_headers decimal_headers c_compatibility_headers_install"
|
||||
_headers1="$_headers1 debug_headers parallel_headers"
|
||||
_headers2="host_headers thread_host_headers"
|
||||
_pf_headers="profile_headers profile_impl_headers"
|
||||
_pb_headers="pb_headers1 pb_headers2 pb_headers3 pb_headers4 pb_headers5 pb_headers6 pb_headers7"
|
||||
|
||||
# build files
|
||||
for h in $_build_headers; do
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/$h \
|
||||
<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h
|
||||
done
|
||||
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/gstdint.h \
|
||||
<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h
|
||||
|
||||
{
|
||||
# libsupc++
|
||||
getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
|
||||
sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/'
|
||||
getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
|
||||
c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/'
|
||||
|
||||
# includes
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
c_base_headers std_headers | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
|
||||
|
||||
# src
|
||||
getvars $_PLATFORM/libstdc++-v3/src/Makefile \
|
||||
libstdc___la_SOURCES | sed 's/^G_libstdc___la_SOURCES=/G_SRC_SOURCES=/'
|
||||
getvars $_PLATFORM/libstdc++-v3/src/c++11/Makefile \
|
||||
libc__11convenience_la_SOURCES | sed 's/^G_libc__11convenience_la_SOURCES=/G_CPP11_SOURCES=/'
|
||||
getvars $_PLATFORM/libstdc++-v3/src/c++98/Makefile \
|
||||
libc__98convenience_la_SOURCES | sed 's/^G_libc__98convenience_la_SOURCES=/G_CPP98_SOURCES=/'
|
||||
getvars $_PLATFORM/libstdc++-v3/Makefile ATOMICITY_SRCDIR \
|
||||
BASIC_FILE_CC CLOCALE_CC CCODECVT_CC CCOLLATE_CC \
|
||||
CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC \
|
||||
CPU_OPT_BITS_RANDOM
|
||||
|
||||
# includes
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
backward_headers c_base_headers_extra $_headers1 $_pb_headers | \
|
||||
sed -e 's#\${GNUHOSTDIST}/libstdc++-v3/include/##g'
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
bits_headers ext_headers $_headers2 | \
|
||||
sed -e 's#\${GNUHOSTDIST}/libstdc++-v3/include/##g' -e 's#\${GNUHOSTDIST}/libstdc++-v3/config/##g'
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
$_pf_headers | sed -e 's#\${GNUHOSTDIST}/libstdc++-v3/include/profile/##g'
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
BASIC_FILE_H ALLOCATOR_H CSTDIO_H CLOCALE_H CMESSAGES_H CTIME_H
|
||||
getlinks $_TMPDIR/$_PLATFORM/libgcc/config.status libgcc
|
||||
} | sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
}
|
||||
|
||||
##### usr.bin/gcc* #####
|
||||
|
||||
get_gcc_bootstrap () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
for f in auto-host tm config; do
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
|
||||
done
|
||||
}
|
||||
|
||||
get_gcc () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
mkdir -p $_OUTDIR/usr.bin/libcpp/arch/$MACHINE_ARCH
|
||||
mkdir -p $_OUTDIR/usr.bin/include/arch
|
||||
_buildname="BUILD_"
|
||||
_libcppsubdir=""
|
||||
_extravars="TM_H ALL_OPT_FILES"
|
||||
_hconfig_h=""
|
||||
_extravars2="tm_file_list build_xm_include_list"
|
||||
_extravars3="tm_p_include_list"
|
||||
|
||||
{
|
||||
getvars gcc/Makefile \
|
||||
${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \
|
||||
${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY \
|
||||
${_buildname}MD | \
|
||||
sed -e 's#build/errors.o#build-errors.o#g' \
|
||||
-e 's#build/print-rtl.o#build-print-rtl.o#g' \
|
||||
-e 's#build/rtl.o#build-rtl.o#g' \
|
||||
-e 's#build/varray.o#build-varray.o#g' \
|
||||
-e 's#build/ggc-none.o#build-ggc-none.o#g' \
|
||||
-e 's#build/##g'
|
||||
getvars gcc/Makefile \
|
||||
ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \
|
||||
GCC_OBJS GCOV_OBJS GXX_OBJS GTM_H PROTO_OBJS ${_extravars1} \
|
||||
INCLUDES md_file OBJC_OBJS OBJS out_file version \
|
||||
BUILD_PREFIX RTL_H RTL_BASE_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \
|
||||
GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \
|
||||
GTFILES GTFILES_LANG_DIR_NAMES NOEXCEPTION_FLAGS \
|
||||
NATIVE_SYSTEM_HEADER_DIR \
|
||||
tm_defines host_xm_file host_xm_defines tm_p_file \
|
||||
target_cpu_default ${_extravars} ${_extravars2} \
|
||||
lang_specs_files ${_extravars3} \
|
||||
common_out_file \
|
||||
| sanitise_includes
|
||||
getvars gcc/Makefile \
|
||||
LIB2ADDEHDEP | sed 's/unwind.inc//'
|
||||
getvars gcc/Makefile \
|
||||
CXX_OBJS CXX_C_OBJS | sed 's/cp\///g'
|
||||
getvars gcc/Makefile \
|
||||
F77_OBJS | sed 's/f\///g'
|
||||
getvars libcpp/Makefile \
|
||||
libcpp_a_OBJS
|
||||
getvars gcc/Makefile \
|
||||
ENABLE_SHARED
|
||||
echo G_SHLIB_LINK="$CC -shared"
|
||||
echo G_SHLIB_MULTILIB=.
|
||||
} | write_mk $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
getvars gcc/Makefile \
|
||||
EXTRA_HEADERS \
|
||||
| write_mk $_OUTDIRBASE/usr.bin/include/arch/$MACHINE_ARCH.mk
|
||||
|
||||
write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
|
||||
hfiles='auto-host configargs config bconfig bversion plugin-version multilib tm'
|
||||
for f in $hfiles; do
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
|
||||
if [ "${MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
|
||||
then
|
||||
ex <<__EOF__ $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h
|
||||
/configuration_arguments/ s/$//
|
||||
ya
|
||||
i
|
||||
#ifdef _SOFT_FLOAT
|
||||
.
|
||||
pu
|
||||
s/";$/ -with-float=soft";/
|
||||
a
|
||||
#else
|
||||
#endif
|
||||
.
|
||||
. m +1
|
||||
/configure_default_options/ s/{ NULL.*$//
|
||||
a
|
||||
#ifdef _SOFT_FLOAT
|
||||
{ "float", "soft" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
.
|
||||
wq
|
||||
__EOF__
|
||||
fi
|
||||
if [ "${f}" = "configargs" ]
|
||||
then
|
||||
_srcquoted=$(echo "$_SRC" | sed 's/\//\\\//g')
|
||||
ex <<__EOF__ $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h
|
||||
/static const char configuration_arguments/ s/$_srcquoted/\/usr\/src/g
|
||||
wq
|
||||
__EOF__
|
||||
fi
|
||||
done
|
||||
|
||||
# keep identical
|
||||
for f in all-tree.def; do
|
||||
cp $_TMPDIR/gcc/$f $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
|
||||
done
|
||||
|
||||
# special transforms
|
||||
for f in gtyp-input.list; do
|
||||
sed -e 's/^.*external\/gpl3\/gcc\/dist/SRCDIR/' < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
|
||||
done
|
||||
|
||||
# special platforms
|
||||
if [ "${MACHINE_ARCH}" = "sh3el" -o "${MACHINE_ARCH}" = "sh3eb" ]; then
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/sysroot-suffix.h <$_TMPDIR/gcc/sysroot-suffix.h
|
||||
fi
|
||||
}
|
||||
|
||||
##### main #####
|
||||
|
||||
case "$1" in
|
||||
# .mk and .h files for libgcc bootstrap (from host build)
|
||||
|
||||
libgcc*-bootstrap)
|
||||
_OUTDIR="$_TOP/external/gpl3/gcc"
|
||||
_OUTDIRBASE="external/gpl3/gcc"
|
||||
get_libgcc gcc
|
||||
get_libgcov gcc $_PLATFORM/libgcc/Makefile
|
||||
get_crtstuff crtstuff
|
||||
get_gcc_bootstrap gcc
|
||||
exit 0
|
||||
;;
|
||||
|
||||
libstdc++-bootstrap)
|
||||
_OUTDIR="$_TOP/external/gpl3/gcc"
|
||||
_OUTDIRBASE="external/gpl3/gcc"
|
||||
get_libstdcxx_v3 libstdc++-v3 gcc
|
||||
exit 0
|
||||
;;
|
||||
|
||||
gcc*)
|
||||
_OUTDIR="$_TOP/external/gpl3/gcc"
|
||||
_OUTDIRBASE="external/gpl3/gcc"
|
||||
get_gcc gcc
|
||||
get_libgcc gcc
|
||||
get_libgcov gcc $_PLATFORM/libgcc/Makefile
|
||||
get_crtstuff crtstuff
|
||||
get_gcc_libiberty gcc
|
||||
get_libobjc libobjc
|
||||
get_libstdcxx_v3 libstdc++-v3 gcc
|
||||
get_libdecnumber libdecnumber
|
||||
get_libgomp libgomp
|
||||
get_libbacktrace libbacktrace
|
||||
exit 0
|
||||
;;
|
||||
|
||||
|
||||
*)
|
||||
echo invalid arguments;
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,746 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $NetBSD: mknative-gcc.old,v 1.1 2014/02/26 09:54:34 mrg Exp $
|
||||
#
|
||||
# was: NetBSD: mknative-gcc,v 1.75 2014/02/16 11:26:31 skrll Exp
|
||||
#
|
||||
# Shell script for generating all the constants needed for a native
|
||||
# platform build of gcc.
|
||||
#
|
||||
|
||||
# XXX split out GCC 4.1 support
|
||||
|
||||
# initialise
|
||||
|
||||
_TMPDIR=$2
|
||||
_TOP=$3
|
||||
_SRC=$4
|
||||
_PLATFORM=$5
|
||||
_DESTDIR=$6
|
||||
_ABI=$7
|
||||
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
|
||||
_GNU_DIST=`cd ${_VPATH}; pwd`
|
||||
|
||||
if [ -z "$_DESTDIR" ]; then
|
||||
echo "\$_DESTDIR is empty" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $_TOP/tools/gcc/mknative.common
|
||||
|
||||
# default to GCC 4.1 for now
|
||||
_OUTDIR="$_TOP/gnu"
|
||||
_OUTDIRBASE="gnu"
|
||||
|
||||
sanitise_includes () {
|
||||
sed \
|
||||
-e "s,-I$_DESTDIR/usr/include,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/mpfr/dist/src,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/mpc/dist/src,,g" \
|
||||
-e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/$MACHINE_ARCH,,g" \
|
||||
-e "s,-I/usr/include/[^ ]*,,"
|
||||
}
|
||||
|
||||
##### gnu/lib/crtstuff #####
|
||||
|
||||
get_crtstuff () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch
|
||||
|
||||
getvars gcc/Makefile \
|
||||
INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
|
||||
tm_defines xm_file xm_defines \
|
||||
| sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
|
||||
}
|
||||
|
||||
##### gnu/lib/libg2c #####
|
||||
|
||||
get_libg2c () {
|
||||
mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH
|
||||
|
||||
write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
|
||||
write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
|
||||
|
||||
{
|
||||
getvars $_PLATFORM/libf2c/Makefile \
|
||||
F2CEXT
|
||||
getvars $_PLATFORM/libf2c/libF77/Makefile \
|
||||
ALL_CFLAGS OBJS
|
||||
getvars $_PLATFORM/libf2c/libI77/Makefile \
|
||||
ALL_CFLAGS OBJS | sed 's,=,+=,'
|
||||
getvars $_PLATFORM/libf2c/libU77/Makefile \
|
||||
ALL_CFLAGS OBJS | sed 's,=,+=,'
|
||||
} | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk
|
||||
}
|
||||
|
||||
##### gnu/lib/libgcc #####
|
||||
|
||||
get_libgcc_list_funcs_asm () {
|
||||
{
|
||||
getvars gcc/Makefile LIB1ASMFUNCS | {
|
||||
# print newline separated list
|
||||
sed -e '
|
||||
s,^.*=,,
|
||||
s, *$,,
|
||||
s, *, ,g
|
||||
s, ,\
|
||||
,g'
|
||||
}
|
||||
getvars gcc/Makefile LIB2FUNCS_EXTRA | {
|
||||
# print newline separated list
|
||||
sed -e '
|
||||
s,^.*=,,
|
||||
s, *$,,
|
||||
s, *, ,g
|
||||
s, ,\
|
||||
,g' | \
|
||||
sed -ne '
|
||||
/\.S$/ { s,^.*/,,; s,\.S$,,; p; }
|
||||
/\.asm$/ { s,^.*/,,; s,\.asm$,,; p; }
|
||||
'
|
||||
}
|
||||
} | {
|
||||
# print foo and foo_s
|
||||
sed -ne '
|
||||
/./ {
|
||||
p
|
||||
s,$,_s,
|
||||
p
|
||||
}
|
||||
'
|
||||
} | sort
|
||||
}
|
||||
|
||||
get_libgcc_list_funcs_lib () {
|
||||
local _lib=$1
|
||||
local _lib_prefix=${_lib%.*}
|
||||
local _lib_suffix=${_lib#*.}
|
||||
local _abi=${2:-'\.'}
|
||||
|
||||
cat build/gcc/libgcc.mk | \
|
||||
grep '/'${_abi}'/' | \
|
||||
sed -ne '
|
||||
/^'${_abi}'\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ {
|
||||
s,^.*/,,
|
||||
s,\.o$,,
|
||||
p
|
||||
}
|
||||
' | sort
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_libs () {
|
||||
local _abi=${1:-'\.'}
|
||||
|
||||
cat build/gcc/libgcc.mk | \
|
||||
grep '/'${_abi}'/' | \
|
||||
egrep '^'${_abi}'\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \
|
||||
sed -e '
|
||||
s,^'${_abi}'\/,,
|
||||
s,: .*/, ,
|
||||
s,^\(.*\) \(.*\)$,\2 \1,
|
||||
' | sort
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_srcs () {
|
||||
local _abi=${1:-'\.'} # XXX not used
|
||||
|
||||
if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
|
||||
comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
|
||||
sed -e 's,\(.*\),\1.o \1.c,'
|
||||
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
|
||||
comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
|
||||
sed -e 's,\(.*\),\1.o \1.S,'
|
||||
else
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
|
||||
sed -e 's,\(.*\),\1.o \1.c,'
|
||||
fi | sort
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_tmplsrcs () {
|
||||
local _abi=${1:-'\.'}
|
||||
|
||||
grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
|
||||
grep '/'${_abi}'/' | \
|
||||
sed -ne '
|
||||
s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1,
|
||||
# basename
|
||||
/\$/ { s,\$.*/,,; }
|
||||
/\// { s,\/.*/,,; }
|
||||
p
|
||||
' | sort -u
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_xflags () {
|
||||
local _flags=$1
|
||||
local _abi=${2:-'\.'}
|
||||
|
||||
grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
|
||||
grep '/'${_abi}'/' | \
|
||||
sed -n '
|
||||
x
|
||||
:loop
|
||||
g
|
||||
s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p
|
||||
g
|
||||
s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/
|
||||
h
|
||||
t loop
|
||||
' | sort
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_cppflags () {
|
||||
get_libgcc_list_objs_xflags D $1
|
||||
}
|
||||
|
||||
get_libgcc_list_objs_copts () {
|
||||
get_libgcc_list_objs_xflags fmx $1
|
||||
}
|
||||
|
||||
get_libgcc_list_tmplsrcs () {
|
||||
local _lib=$1
|
||||
local _abi=$2 # XXX not used
|
||||
local _tmplallsrcs=$( mktemp /tmp/mknative-gcc._tmplallsrcs.XXXXXX )
|
||||
|
||||
touch $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
|
||||
touch $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
|
||||
touch $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
|
||||
|
||||
# all files
|
||||
local _lib_prefix=${_lib%.*}
|
||||
local _lib_suffix=${_lib#*.}
|
||||
join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmplsrcs | \
|
||||
grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \
|
||||
$_tmplallsrcs
|
||||
|
||||
# TMPLFPSRCS = [fdp]p-bit.c
|
||||
grep '[fdt]p-bit\.c' <$_tmplallsrcs | sort -u | \
|
||||
writefile ${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
|
||||
|
||||
# TMPLASMSRCS = $(LIB1ASMSRC)
|
||||
grep '\$(LIB1ASMSRC)' <$_tmplallsrcs | sort -u | \
|
||||
writefile ${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
|
||||
|
||||
# TMPLSRCS is anything else; exclude TMPLFPSRCS and TMPLASMSRCS
|
||||
cat $_tmplallsrcs | \
|
||||
comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} | \
|
||||
comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \
|
||||
writefile ${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
|
||||
|
||||
rm -f $_tmplallsrcs
|
||||
}
|
||||
|
||||
get_libgcc_new_analyze () {
|
||||
local _abi=$1
|
||||
|
||||
mkdir -p $_TOP/${_machine_arch_subdir}
|
||||
|
||||
touch $_TOP/${libgcc_db_funcs}.S
|
||||
get_libgcc_list_funcs_asm | \
|
||||
writefile ${libgcc_db_funcs}.S
|
||||
|
||||
for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
|
||||
touch $_TOP/${libgcc_db_funcs}.${_lib%.*}
|
||||
get_libgcc_list_funcs_lib $_lib $_abi | \
|
||||
writefile ${libgcc_db_funcs}.${_lib%.*}
|
||||
done
|
||||
|
||||
get_libgcc_list_objs_libs $_abi | writefile ${libgcc_db_objs_libs}
|
||||
get_libgcc_list_objs_srcs $_abi | writefile ${libgcc_db_objs_srcs}
|
||||
get_libgcc_list_objs_tmplsrcs $_abi | writefile ${libgcc_db_objs_tmplsrcs}
|
||||
get_libgcc_list_objs_cppflags $_abi | writefile ${libgcc_db_objs_cppflags}
|
||||
get_libgcc_list_objs_copts $_abi | writefile ${libgcc_db_objs_copts}
|
||||
|
||||
for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
|
||||
get_libgcc_list_tmplsrcs $_lib $_abi
|
||||
done
|
||||
}
|
||||
|
||||
#####
|
||||
|
||||
get_libgcc_gen_tmplsrcs_tmplsrcs () {
|
||||
local _lib=$1
|
||||
|
||||
printf '\n'
|
||||
printf 'TMPLSRCS.%s = \\\n' $_lib
|
||||
sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
|
||||
}
|
||||
|
||||
get_libgcc_gen_tmplsrcs_tmplfpsrcs () {
|
||||
local _lib=$1
|
||||
|
||||
printf '\n'
|
||||
printf 'TMPLFPSRCS.%s = \\\n' $_lib
|
||||
sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
|
||||
}
|
||||
|
||||
get_libgcc_gen_tmplsrcs_tmplasmsrcs () {
|
||||
local _lib=$1
|
||||
|
||||
printf '\n'
|
||||
printf 'TMPLASMSRCS.%s = \\\n' $_lib
|
||||
sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \
|
||||
sed -e 's,LIB1ASMSRC,G_&,'
|
||||
}
|
||||
|
||||
get_libgcc_gen_srcs () {
|
||||
local _lib=$1
|
||||
|
||||
printf '\n'
|
||||
printf 'SRCS.%s = \\\n' $_lib
|
||||
if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
|
||||
comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
|
||||
sed -e 's,$,.c,; s,^,tmp_,'
|
||||
comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
|
||||
sed -e 's,$,.S,; s,^,tmp_,'
|
||||
else
|
||||
cat $_TOP/${libgcc_db_funcs}.${_lib%.*} | \
|
||||
sed -e 's,$,.c,; s,^,tmp_,'
|
||||
fi | sort | \
|
||||
sed -e 's,^, ,; s,$, \\,'
|
||||
}
|
||||
|
||||
_lookup_objs () {
|
||||
local _obj=$1; local _key=$2
|
||||
|
||||
eval grep \^$_obj\\\ \$_TOP/\${libgcc_db_objs_${_key}} | cut -f2
|
||||
}
|
||||
|
||||
get_libgcc_gen_srcs_tmplsrcs () {
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | \
|
||||
while read _obj; do
|
||||
printf 'SRCS.tmp_%s=%s\n' \
|
||||
"$( _lookup_objs $_obj srcs )" \
|
||||
"$( _lookup_objs $_obj tmplsrcs )"
|
||||
done | \
|
||||
sed -e 's,\$(\(.*\)),${G_\1},'
|
||||
}
|
||||
|
||||
get_libgcc_gen_srcs_cppflags () {
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | \
|
||||
while read _obj; do
|
||||
printf '_CPPFLAGS.tmp_%s=%s\n' \
|
||||
"$( _lookup_objs $_obj srcs )" \
|
||||
"$( _lookup_objs $_obj cppflags | xargs )"
|
||||
done
|
||||
}
|
||||
|
||||
get_libgcc_gen_srcs_copts () {
|
||||
cut -f1 $_TOP/${libgcc_db_objs_libs} | \
|
||||
while read _obj; do
|
||||
printf 'COPTS.tmp_%s=%s\n' \
|
||||
"$( _lookup_objs $_obj srcs )" \
|
||||
"$( _lookup_objs $_obj copts | xargs )"
|
||||
done
|
||||
}
|
||||
|
||||
get_libgcc_new_generate () {
|
||||
local _abi=$1
|
||||
|
||||
for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
|
||||
for _tmpl in tmplsrcs tmplfpsrcs tmplasmsrcs; do
|
||||
eval get_libgcc_gen_tmplsrcs_${_tmpl} $_lib | \
|
||||
write_mk ${libgcc_libs_mk}.${_lib%.*}.tmplsrcs.${_tmpl}.mk
|
||||
done
|
||||
|
||||
get_libgcc_gen_srcs $_lib | \
|
||||
write_mk ${libgcc_libs_mk}.${_lib%.*}.srcs.mk
|
||||
done
|
||||
|
||||
for _arg in tmplsrcs cppflags copts; do
|
||||
eval get_libgcc_gen_srcs_${_arg} | \
|
||||
eval writefile \$libgcc_srcs_mk_${_arg}
|
||||
done
|
||||
}
|
||||
|
||||
#####
|
||||
|
||||
get_libgcc_new () {
|
||||
_subdir="$1"
|
||||
_abi="$2"
|
||||
|
||||
# List of generated files.
|
||||
|
||||
_machine_arch_subdir=$_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH/$_abi
|
||||
|
||||
libgcc_db_funcs=${_machine_arch_subdir}/funcs
|
||||
libgcc_db_tmplsrcs=${_machine_arch_subdir}/tmplsrcs
|
||||
libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs
|
||||
libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs
|
||||
libgcc_db_objs_tmplsrcs=${_machine_arch_subdir}/objs.tmplsrcs
|
||||
libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags
|
||||
libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts
|
||||
|
||||
get_libgcc_new_analyze $_abi
|
||||
|
||||
libgcc_libs_mk=${_machine_arch_subdir}/libs
|
||||
libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk
|
||||
libgcc_srcs_mk_tmplsrcs=${_machine_arch_subdir}/srcs.tmplsrcs.mk
|
||||
libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk
|
||||
libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk
|
||||
|
||||
get_libgcc_new_generate $_abi
|
||||
}
|
||||
|
||||
get_libgcc () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/lib/lib$_subdir/arch
|
||||
|
||||
case "$_subdir" in
|
||||
gcc4|gcc)
|
||||
_extravars="COLLECT2 UNWIND_H xm_include_list"
|
||||
_archsubdir=""
|
||||
;;
|
||||
esac
|
||||
|
||||
# DPBIT, FPBIT only used on mn10[23]00, we don't need them.
|
||||
# XXX we should probably grab everything Just In Case for
|
||||
# the future.
|
||||
{
|
||||
getvars gcc/Makefile \
|
||||
INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \
|
||||
LIB1ASMFUNCS LIB1ASMSRC \
|
||||
LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
|
||||
LIB2FUNCS_EXTRA \
|
||||
LIBGCC2_CFLAGS \
|
||||
SHLIB_MKMAP SHLIB_MKMAP_OPTS \
|
||||
SHLIB_MAPFILES SHLIB_NM_FLAGS \
|
||||
EXTRA_HEADERS xm_defines \
|
||||
tm_defines ${_extravars}
|
||||
} | sanitise_includes \
|
||||
| write_mk $_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH.mk
|
||||
|
||||
# Generate new style files.
|
||||
if [ -n "${MKNATIVE_LIBGCC_NEW}" ]; then
|
||||
get_libgcc_new $_subdir $_ABI
|
||||
fi
|
||||
}
|
||||
|
||||
##### gnu/lib/libgcov #####
|
||||
|
||||
get_libgcov () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH
|
||||
|
||||
{
|
||||
getvars gcc/Makefile \
|
||||
LIBGCOV
|
||||
} | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \
|
||||
<$_TMPDIR/gcc/gcov-iov.h
|
||||
|
||||
}
|
||||
|
||||
##### gnu/usr.bin/gcc[34]/libiberty #####
|
||||
|
||||
get_gcc_libiberty () {
|
||||
_subdir="$1"
|
||||
case "$_subdir" in
|
||||
gcc4)
|
||||
_libibertydir="usr.bin/$_subdir/libiberty"
|
||||
;;
|
||||
gcc)
|
||||
_libibertydir="lib/libiberty"
|
||||
;;
|
||||
esac
|
||||
mkdir -p $_OUTDIR/$_libibertydir/arch/$MACHINE_ARCH
|
||||
|
||||
getvars libiberty/Makefile \
|
||||
ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
|
||||
| write_mk $_OUTDIRBASE/$_libibertydir/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/$_libibertydir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/libiberty/config.h
|
||||
}
|
||||
|
||||
##### lib/libdecnumber #####
|
||||
|
||||
get_libdecnumber () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/libdecnumber/config.h
|
||||
}
|
||||
|
||||
##### lib/libgomp #####
|
||||
|
||||
get_libgomp () {
|
||||
_subdir="$1"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/config.h
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp_f.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h
|
||||
write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp.spec \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/omp.h \
|
||||
<$_TMPDIR/$_PLATFORM/libgomp/omp.h
|
||||
}
|
||||
|
||||
##### gnu/lib/libobjc #####
|
||||
|
||||
get_libobjc () {
|
||||
_subdir="$1/arch/$MACHINE_ARCH"
|
||||
_options="ALL_OPT_FILES"
|
||||
_unwind="UNWIND_H"
|
||||
|
||||
mkdir -p $_OUTDIR/lib/$_subdir
|
||||
|
||||
{
|
||||
if [ -n "$_options" ]; then
|
||||
getvars gcc/Makefile $_options
|
||||
fi
|
||||
getvars $_PLATFORM/libobjc/Makefile \
|
||||
ALL_CFLAGS INCLUDES OBJS OBJC_H \
|
||||
| sed "s,$_GNU_DIST,\${GNUHOSTDIST},g"
|
||||
if [ -n "$_unwind" ]; then
|
||||
getvars gcc/Makefile $_unwind
|
||||
fi
|
||||
} | write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
|
||||
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/config.h \
|
||||
<$_TMPDIR/$_PLATFORM/libobjc/config.h
|
||||
}
|
||||
|
||||
##### gnu/lib/libstdc++-v3 #####
|
||||
|
||||
get_libstdcxx_v3 () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
|
||||
|
||||
case ${_subdir} in
|
||||
*)
|
||||
_src_CC_files="atomicity_file CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC CLOCALE_CC BASIC_FILE_CC"
|
||||
_headers1="host_headers debug_headers tr1_headers c_compatibility_headers_extra tr1_impl_headers parallel_headers decimal_headers"
|
||||
_headers2="thread_host_headers host_headers_extra"
|
||||
_build_headers="c++allocator.h c++config.h cxxabi_tweaks.h gthr-default.h gthr-posix.h gthr-single.h gthr-tpf.h gthr.h"
|
||||
_unwind="UNWIND_H"
|
||||
;;
|
||||
esac
|
||||
|
||||
# build files
|
||||
for h in $_build_headers; do
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/$h \
|
||||
<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h
|
||||
done
|
||||
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
|
||||
<$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h
|
||||
write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/gstdint.h \
|
||||
<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h
|
||||
|
||||
{
|
||||
# libsupc++
|
||||
getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
|
||||
sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/'
|
||||
getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
|
||||
c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/'
|
||||
|
||||
# src
|
||||
getvars $_PLATFORM/libstdc++-v3/src/Makefile \
|
||||
sources $_src_CC_files SECTION_FLAGS | sed 's/^G_sources=/G_SRC_SOURCES=/'
|
||||
|
||||
# include
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
c_base_headers std_headers | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
bits_headers backward_headers ext_headers c_base_headers_extra \
|
||||
$_headers1 | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
|
||||
getvars $_PLATFORM/libstdc++-v3/include/Makefile \
|
||||
$_headers2 | sed -e 's#\./[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
|
||||
|
||||
if [ -n "$_unwind" ]; then
|
||||
getvars gcc/Makefile $_unwind
|
||||
fi
|
||||
} | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
}
|
||||
|
||||
##### gnu/usr.bin/gcc* #####
|
||||
|
||||
get_gcc_bootstrap () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
for f in auto-host tm config gthr-default; do
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
|
||||
done
|
||||
}
|
||||
|
||||
get_gcc () {
|
||||
_subdir="$1"
|
||||
mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
|
||||
mkdir -p $_OUTDIR/usr.bin/libcpp/arch/$MACHINE_ARCH
|
||||
case ${_subdir} in
|
||||
gcc4)
|
||||
_buildname="BUILD_"
|
||||
_libcppsubdir=""
|
||||
_extravars="TM_H ALL_OPT_FILES"
|
||||
_hconfig_h=""
|
||||
_extravars2="tm_file_list build_xm_include_list"
|
||||
_extravars3="tm_p_include_list"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
_buildname="BUILD_"
|
||||
_libcppsubdir=""
|
||||
_extravars="TM_H ALL_OPT_FILES"
|
||||
_hconfig_h=""
|
||||
_extravars2="tm_file_list build_xm_include_list"
|
||||
_extravars3="tm_p_include_list"
|
||||
;;
|
||||
esac
|
||||
|
||||
{
|
||||
getvars gcc/Makefile \
|
||||
${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \
|
||||
${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY | \
|
||||
sed -e 's#build/errors.o#build-errors.o#g' \
|
||||
-e 's#build/print-rtl.o#build-print-rtl.o#g' \
|
||||
-e 's#build/rtl.o#build-rtl.o#g' \
|
||||
-e 's#build/varray.o#build-varray.o#g' \
|
||||
-e 's#build/ggc-none.o#build-ggc-none.o#g' \
|
||||
-e 's#build/##g'
|
||||
getvars gcc/Makefile \
|
||||
ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \
|
||||
GCOV_OBJS PROTO_OBJS ${_extravars1} \
|
||||
INCLUDES md_file OBJC_OBJS OBJS out_file version \
|
||||
BUILD_PREFIX RTL_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \
|
||||
GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \
|
||||
GTFILES GTFILES_LANG_DIR_NAMES \
|
||||
tm_defines host_xm_file host_xm_defines tm_p_file \
|
||||
target_cpu_default ${_extravars} ${_extravars2} \
|
||||
lang_specs_files ${_extravars3} \
|
||||
| sanitise_includes
|
||||
getvars gcc/Makefile \
|
||||
LIB2ADDEHDEP | sed 's/unwind.inc//'
|
||||
getvars gcc/Makefile \
|
||||
CXX_OBJS CXX_C_OBJS | sed 's/cp\///g'
|
||||
getvars gcc/Makefile \
|
||||
F77_OBJS | sed 's/f\///g'
|
||||
case ${_subdir} in
|
||||
gcc4 | gcc)
|
||||
getvars libcpp/Makefile \
|
||||
libcpp_a_OBJS
|
||||
;;
|
||||
esac
|
||||
getvars gcc/Makefile \
|
||||
ENABLE_SHARED
|
||||
case ${_subdir} in
|
||||
gcc4 | gcc)
|
||||
echo G_SHLIB_LINK="$CC -shared"
|
||||
echo G_SHLIB_MULTILIB=.
|
||||
;;
|
||||
esac
|
||||
} | write_mk $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/defs.mk
|
||||
|
||||
case "$_subdir" in
|
||||
gcc4)
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
|
||||
hfiles='auto-host gencheck configargs gthr-default tm bconfig config multilib'
|
||||
;;
|
||||
gcc)
|
||||
write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
|
||||
hfiles='auto-host configargs gthr-default tm bconfig config multilib bversion plugin-version'
|
||||
;;
|
||||
esac
|
||||
for f in $hfiles; do
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
|
||||
if [ "${MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
|
||||
then
|
||||
ex <<__EOF__ $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h
|
||||
/configuration_arguments/ s/$//
|
||||
ya
|
||||
i
|
||||
#ifdef _SOFT_FLOAT
|
||||
.
|
||||
pu
|
||||
s/";$/ -with-float=soft";/
|
||||
a
|
||||
#else
|
||||
#endif
|
||||
.
|
||||
. m +1
|
||||
/configure_default_options/ s/{ NULL.*$//
|
||||
a
|
||||
#ifdef _SOFT_FLOAT
|
||||
{ "float", "soft" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
.
|
||||
wq
|
||||
__EOF__
|
||||
fi
|
||||
done
|
||||
|
||||
# keep identical
|
||||
for f in all-tree.def; do
|
||||
cp $_TMPDIR/gcc/$f $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
|
||||
done
|
||||
|
||||
# special transforms
|
||||
for f in gtyp-input.list; do
|
||||
sed -e 's/^.*external\/gpl3\/gcc\.old\/dist/SRCDIR/' < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
|
||||
done
|
||||
|
||||
# special platforms
|
||||
if [ "${MACHINE_ARCH}" = "sh3el" -o "${MACHINE_ARCH}" = "sh3eb" ]; then
|
||||
write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/sysroot-suffix.h <$_TMPDIR/gcc/sysroot-suffix.h
|
||||
fi
|
||||
}
|
||||
|
||||
##### main #####
|
||||
|
||||
case "$1" in
|
||||
# .mk and .h files for libgcc bootstrap (from host build)
|
||||
|
||||
libgcc4)
|
||||
get_libgcc gcc4
|
||||
get_crtstuff crtstuff4
|
||||
exit 0
|
||||
;;
|
||||
|
||||
libgcc45)
|
||||
_OUTDIR="$_TOP/external/gpl3/gcc.old"
|
||||
_OUTDIRBASE="external/gpl3/gcc.old"
|
||||
get_libgcc gcc
|
||||
get_crtstuff crtstuff
|
||||
get_libgcov gcc
|
||||
get_gcc_bootstrap gcc
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# gcc files
|
||||
gcc4)
|
||||
get_gcc gcc4
|
||||
get_libgcc gcc4
|
||||
get_libgcov gcc4
|
||||
get_crtstuff crtstuff4
|
||||
get_gcc_libiberty gcc4
|
||||
get_libobjc libobjc4
|
||||
get_libstdcxx_v3 libstdc++-v3_4
|
||||
exit 0
|
||||
;;
|
||||
|
||||
gcc45)
|
||||
_OUTDIR="$_TOP/external/gpl3/gcc.old"
|
||||
_OUTDIRBASE="external/gpl3/gcc.old"
|
||||
get_gcc gcc
|
||||
get_libgcc gcc
|
||||
get_libgcov gcc
|
||||
get_crtstuff crtstuff
|
||||
get_gcc_libiberty gcc
|
||||
get_libobjc libobjc
|
||||
get_libstdcxx_v3 libstdc++-v3
|
||||
get_libdecnumber libdecnumber
|
||||
get_libgomp libgomp
|
||||
exit 0
|
||||
;;
|
||||
|
||||
|
||||
*) echo invalid arguments; exit 1;;
|
||||
esac
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
# $NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $
|
||||
#
|
||||
# from: NetBSD: mknative,v 1.12 2003/03/05 06:17:17 mrg Exp
|
||||
#
|
||||
# shell-fragment common to all "mknative" scripts
|
||||
|
||||
bomb()
|
||||
{
|
||||
echo >&2 "ABORT: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Make sure we can run OK.
|
||||
if [ -x "$MAKE" ]; then
|
||||
:
|
||||
else
|
||||
bomb "MAKE not set"
|
||||
fi
|
||||
|
||||
# usage: getvars MAKEFILE VARNAME [VARNAME...]
|
||||
#
|
||||
getvars()
|
||||
{
|
||||
_mf="$1"; shift
|
||||
case "$MAKE" in
|
||||
*gmake)
|
||||
env MAKEFLAGS= $MAKE --quiet -f - -f "$_TMPDIR/$_mf" _x_ <<EOF || bomb "getvars $_mf $* failed"
|
||||
define echo_var
|
||||
@echo G_\${var}="\${\${var}}" | sed -e 's,\([^\.]\)\./\([a-zA-Z0-9_-]*\.o\),\1\2,g' -e 's,$_VPATH,\$\${GNUHOSTDIST},g' -e 's,$_GNU_DIST,\$\${GNUHOSTDIST},g'
|
||||
|
||||
endef
|
||||
_x_:
|
||||
\$(foreach var,$*,\$(echo_var))
|
||||
EOF
|
||||
;;
|
||||
*)
|
||||
$MAKE -B -f - _x_ <<EOF || bomb "getvars $_mf $* failed"
|
||||
_x_:
|
||||
.for var in $*
|
||||
@echo G_\${var}=\${\${var}:Q} | sed -e 's,\([^\.]\)\./\([a-zA-Z0-9_-]*\.o\),\1\2,g' -e 's,$_VPATH,\$\${GNUHOSTDIST},g' -e 's,$_GNU_DIST,\$\${GNUHOSTDIST},g'
|
||||
.endfor
|
||||
.include "$_TMPDIR/$_mf"
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# usage: getlinks <config.status> <subdir>
|
||||
#
|
||||
getlinks()
|
||||
{
|
||||
_cs="$1"; shift
|
||||
_dir="$1"; shift
|
||||
echo -n G_CONFIGLINKS=
|
||||
grep "^config_links=" $_cs | sed -e 's@config_links="\([^"]*\)"@\1@g' -e "s@\([^:]*\):\([^ ]*\)@\${GNUHOSTDIST}/${_dir}/\2 \1 @g"
|
||||
}
|
||||
|
||||
# usage: write_c FILENAME
|
||||
#
|
||||
write_c()
|
||||
{
|
||||
echo '/* This file is automatically generated. DO NOT EDIT! */' >$_TOP/$1.tmp || \
|
||||
bomb "cannot create $1"
|
||||
grep '$''NetBSD' $0 | sed 's,[ #$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
|
||||
echo '$NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $' | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
|
||||
echo '' >>$_TOP/$1.tmp
|
||||
writefile $1
|
||||
}
|
||||
|
||||
# usage: write_mk FILENAME
|
||||
#
|
||||
write_mk()
|
||||
{
|
||||
echo '# This file is automatically generated. DO NOT EDIT!' >$_TOP/$1.tmp || \
|
||||
bomb "cannot create $1"
|
||||
grep '$''NetBSD' $0 | sed 's,[ #$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
|
||||
echo '$NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp $' | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
|
||||
echo '#' >>$_TOP/$1.tmp
|
||||
writefile $1
|
||||
}
|
||||
|
||||
writefile()
|
||||
{
|
||||
sed -e 's,netbsd\(elf\)*1[0-9\.]*\(_\)*[A-Z]*,netbsd\1,' \
|
||||
-e 's,^/\* #undef HAVE_MMAP \*/$,#define HAVE_MMAP 1,' \
|
||||
>>$_TOP/$1.tmp
|
||||
|
||||
# Compare new file, sans "generated from" comments and RCS Id,
|
||||
# to old file. If they match, don't change anything.
|
||||
rm -f $_TMPDIR/.1 $_TMPDIR/.2
|
||||
grep -v 'Generated from:' $_TOP/$1 >$_TMPDIR/.1 2>/dev/null
|
||||
grep -v 'Generated from:' $_TOP/$1.tmp >$_TMPDIR/.2
|
||||
|
||||
# will not overwrite a file that has the same content
|
||||
if cmp $_TMPDIR/.1 $_TMPDIR/.2 >/dev/null 2>&1; then
|
||||
rm -f $_TOP/$1.tmp
|
||||
else
|
||||
echo >&2 "$1 changed"
|
||||
mv -f $_TOP/$1.tmp $_TOP/$1
|
||||
fi
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.6 2012/12/02 12:48:32 apb Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.PATH.sh: ${.CURDIR}/../../usr.bin/genassym
|
||||
|
||||
.-include "${TOOLDIR}/share/compat/defs.mk"
|
||||
|
||||
TIMESTAMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
|
||||
|
||||
CLEANFILES+= genassym
|
||||
|
||||
.include <bsd.hostprog.mk>
|
||||
|
||||
install: ${TIMESTAMP}
|
||||
${TIMESTAMP}: genassym
|
||||
${HOST_INSTALL_FILE} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
genassym: genassym.sh
|
||||
${TOOL_SED} -e "s,/bin/sh,${HOST_BSHELL},g" \
|
||||
-e "s,{AWK:=.*},{AWK:="${TOOL_AWK:Q}"}," \
|
||||
< ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
realall: genassym
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.4 2002/12/08 20:20:00 thorpej Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}gencat
|
||||
HOST_SRCDIR= usr.bin/gencat
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.4 2014/08/18 06:58:51 christos Exp $
|
||||
#
|
||||
|
||||
GNUHOSTDIST= ${.CURDIR}/../../external/gpl2/gmake/dist
|
||||
|
||||
CONFIGURE_ENV+= CC=${HOST_CC:Q} \
|
||||
CFLAGS=${HOST_CFLAGS:Q} \
|
||||
CPPFLAGS=${HOST_CPPFLAGS:Q} \
|
||||
CXX=${HOST_CXX:Q}
|
||||
|
||||
CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX}g
|
||||
CONFIGURE_ARGS+=--disable-nls
|
||||
|
||||
MAKE_ARGS= MAKEINFO=${TOOL_MAKEINFO:Q}
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
.include "${.CURDIR}/../Makefile.gnuhost"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2012/04/12 01:05:31 mrg Exp $
|
||||
#
|
||||
|
||||
GNUHOSTDIST= ${.CURDIR}/../../external/lgpl3/gmp/dist
|
||||
|
||||
CONFIGURE_ARGS+=--disable-shared
|
||||
|
||||
.include "${.CURDIR}/../Makefile.gnuhost"
|
||||
|
||||
# Don't override CFLAGS and CXXFLAGS, it breaks ABI detection.
|
||||
# PATH needs special treating since "make" tries to expand $PATH
|
||||
# when variable is used.
|
||||
CONFIGURE_ENV:= ${CONFIGURE_ENV:NPATH=*:NCFLAGS=*:NCXXFLAGS=*} \
|
||||
PATH="${TOOLDIR:Q}/bin:$$$$PATH"
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} != "Minix"
|
||||
# Force avoiding possibly non-executable install-sh.
|
||||
CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
|
||||
.endif
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: headerlist,v 1.13 2014/09/19 17:30:13 matt Exp $
|
||||
#
|
||||
# do not edit; this file was automatically generated by:
|
||||
# NetBSD: mkheaderlist.sh,v 1.1 2007/08/07 12:38:23 yamt Exp
|
||||
|
||||
./arm/include/disklabel.h
|
||||
./arm/include/elf_machdep.h
|
||||
./evbarm/include/disklabel.h
|
||||
./evbarm/include/elf_machdep.h
|
||||
./i386/include/disklabel.h
|
||||
./i386/include/elf_machdep.h
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.12 2012/12/02 12:44:06 apb Exp $
|
||||
|
||||
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>
|
||||
|
||||
# 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 $@
|
||||
${CONFIGURE_ENV} \
|
||||
${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
|
||||
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:
|
||||
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
|
||||
2518
tools/host-mkdep/configure
vendored
2518
tools/host-mkdep/configure
vendored
File diff suppressed because it is too large
Load Diff
|
|
@ -1,18 +0,0 @@
|
|||
# $NetBSD: configure.ac,v 1.3 2003/07/26 20:24:00 salo Exp $
|
||||
#
|
||||
# Autoconf definition file for mkdep.
|
||||
#
|
||||
|
||||
AC_INIT([mkdep], [noversion], [tech-toolchain@NetBSD.org])
|
||||
|
||||
AC_PATH_PROG(BSHELL, sh, )
|
||||
if test x"$BSHELL" = x; then
|
||||
AC_MSG_ERROR([sh must be somewhere on \$PATH])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES(host-mkdep)
|
||||
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CPP
|
||||
|
||||
AC_OUTPUT
|
||||
|
|
@ -1,267 +0,0 @@
|
|||
#!@BSHELL@ -
|
||||
#
|
||||
# $NetBSD: host-mkdep.in,v 1.31 2015/05/12 00:04:34 christos Exp $
|
||||
#
|
||||
# Copyright (c) 1991, 1993
|
||||
# The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
|
||||
#
|
||||
# @(#)mkdep.old.compiler 8.1 (Berkeley) 6/6/93
|
||||
#
|
||||
|
||||
APPEND=false
|
||||
MERGE=false
|
||||
OPTIONAL=false
|
||||
AWK_OPTIONAL=
|
||||
QUIET=false
|
||||
CPPFLAGS=
|
||||
NEWEXT=.o
|
||||
PREFIX=
|
||||
OUTFILE=.depend
|
||||
SRCS=
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage: $0 [-adopq] [-s .suffixes] [-f .depend] -- [flags] file ..." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
set_objlist()
|
||||
{
|
||||
if [ -n "$NEWEXT" ]; then
|
||||
oifs="$IFS"
|
||||
IFS=" ,"
|
||||
set -- $NEWEXT
|
||||
IFS="$oifs"
|
||||
objlist=
|
||||
for suf in "$@"; do
|
||||
objlist="$objlist${objlist:+ }$PREFIX$file$suf"
|
||||
done
|
||||
else
|
||||
objlist="$PREFIX$file"
|
||||
fi
|
||||
}
|
||||
|
||||
# A getopt compatible command line parser in shell comands.
|
||||
# (don't trust the shell builtin getopts to be in a known state on error)
|
||||
while [ $# -gt 0 ]; do
|
||||
option="${1#-}"
|
||||
[ "$option" = "$1" -o -z "$option" ] && break
|
||||
while
|
||||
optarg="${option#?}"
|
||||
option="${option%$optarg}"
|
||||
|
||||
case "-$option" in
|
||||
-a) APPEND=true;;
|
||||
-d) MERGE=true;;
|
||||
-o) OPTIONAL=true; AWK_OPTIONAL='print ".OPTIONAL:" $0';;
|
||||
-p) NEWEXT=;;
|
||||
-q) QUIET=true;;
|
||||
-[iv]) ;;
|
||||
|
||||
-[fPs]) # Options with arguments
|
||||
[ -z "$optarg" ] && {
|
||||
[ $# = 1 ] && usage
|
||||
shift
|
||||
optarg="$1"
|
||||
}
|
||||
case "-$option" in
|
||||
-f) OUTFILE="$optarg";;
|
||||
-P) PREFIX="$optarg";;
|
||||
-s) NEWEXT="$optarg";;
|
||||
esac
|
||||
optarg=
|
||||
;;
|
||||
|
||||
--) [ -z "$optarg" ] && shift
|
||||
break 2
|
||||
;;
|
||||
|
||||
*) $MERGE && usage
|
||||
break 2;
|
||||
;;
|
||||
esac
|
||||
[ -n "$optarg" ]
|
||||
do
|
||||
option="$optarg"
|
||||
done
|
||||
shift
|
||||
done
|
||||
|
||||
[ $# = 0 ] && usage
|
||||
|
||||
if $MERGE; then
|
||||
SRCS="$*"
|
||||
else
|
||||
#
|
||||
# Process argument list.
|
||||
# This is tricky, because arguments may contain spaces and other
|
||||
# escapes characters. The argument list is used like a tail queue.
|
||||
# $cppargs has one x for each unprocessed argument, so when an
|
||||
# argument is processed, it is shifted and the corresponding number
|
||||
# of x's is removed. The advantage to counting is that suffix removal
|
||||
# works without fork.
|
||||
#
|
||||
cppargs=
|
||||
for arg; do
|
||||
cppargs="x$cppargs"
|
||||
done
|
||||
while [ -n "$cppargs" ]; do
|
||||
case "$1" in
|
||||
-L) # takes an arg, but ignored
|
||||
shift 2
|
||||
cppargs=${cppargs%xx}
|
||||
;;
|
||||
|
||||
-c|-[lLMOW]*) # takes no extra args
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
|
||||
-[IDU]*)
|
||||
set -- "$@" "$1"
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
|
||||
-[IDU]|-include|-isystem|-isysroot)
|
||||
set -- "$@" "$1" "$2"
|
||||
shift 2
|
||||
cppargs=${cppargs%xx}
|
||||
;;
|
||||
|
||||
-isystem-cxx|-cxx-isystem)
|
||||
set -- "$@" "-isystem" "$2"
|
||||
shift 2
|
||||
cppargs=${cppargs%xx}
|
||||
;;
|
||||
-std=*)
|
||||
set -- "$@" "$1"
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
|
||||
-no-cpp-precomp) # This is a Darwin-specific option.
|
||||
set -- "$@" "$1"
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
|
||||
-nostdinc*) # This is a gcc/g++ ism; ignore if not gcc/g++
|
||||
case "@CFLAGS@" in
|
||||
*-O2*) # Autoconf puts -O2 when gcc only
|
||||
set -- "$@" "$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
--sysroot*)
|
||||
shift
|
||||
;;
|
||||
-[iv])
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "$0: Unknown option: $1" 1>&2 # all other -options
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
SRCS="$SRCS $1" # source file
|
||||
shift
|
||||
cppargs=${cppargs%x}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
[ -z "$SRCS" ] && usage
|
||||
|
||||
TMP=/tmp/mkdep$$
|
||||
rm -f $TMP
|
||||
|
||||
trap 'rm -f $TMP; exit 1' 1 2 3 13 15
|
||||
|
||||
if $MERGE; then
|
||||
for f in $SRCS; do
|
||||
if [ ! -f "$f" ]; then
|
||||
if ! $QUIET; then echo "$0: Ignoring $f" >&2; fi
|
||||
continue
|
||||
fi
|
||||
while IFS=':'; read target dependents; do
|
||||
IFS=
|
||||
t1="${target#* }"
|
||||
file="${target%.o}"
|
||||
if [ "$t1" = "$target" -a "$file" != "$target" ]; then
|
||||
set_objlist $file
|
||||
target="$objlist"
|
||||
fi
|
||||
echo "$target:$dependents"
|
||||
if "$OPTIONAL"; then
|
||||
echo ".OPTIONAL:$dependents"
|
||||
fi
|
||||
done <$f
|
||||
done >$TMP
|
||||
else
|
||||
for f in $SRCS; do
|
||||
file=${f##*/}
|
||||
file=${file%.*}
|
||||
set_objlist $file
|
||||
|
||||
( (@CPP@ "$@" $f; echo $? >&3) | @AWK@ '
|
||||
/^#/ {
|
||||
# Be as tolerant as possible.
|
||||
sub(/^#(line)? [ 0-9]*\"?/, "")
|
||||
sub(/^#(pragma).*/, "")
|
||||
sub(/^<.*/, "")
|
||||
sub(/\".*$/, "")
|
||||
sub(/^\.\//, "")
|
||||
sub(/ [ 0-9]*$/, "")
|
||||
|
||||
if ($0 in seenfiles) next
|
||||
if ($0 ~ /y.tab.c/) next
|
||||
|
||||
seenfiles[$0] = 1
|
||||
print "'"$objlist"'" ": " $0
|
||||
'"$AWK_OPTIONAL"'
|
||||
}
|
||||
' >> $TMP) 3>&1 | (read a; exit $a)
|
||||
done
|
||||
fi
|
||||
|
||||
if $APPEND; then
|
||||
cat $TMP >> $OUTFILE
|
||||
else
|
||||
cat $TMP > $OUTFILE
|
||||
fi
|
||||
|
||||
rm -f $TMP
|
||||
exit 0
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.11 2011/03/06 18:15:30 bouyer Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}installboot
|
||||
HOST_SRCDIR= usr.sbin/installboot
|
||||
|
||||
HOST_CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../mips-elf2ecoff
|
||||
HOST_CPPFLAGS+= -I${TOOLDIR}/include/nbinclude
|
||||
|
||||
.include "${.CURDIR}/../Makefile.nbincludes"
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/01/14 16:17:29 apb Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}join
|
||||
HOST_SRCDIR= usr.bin/join
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.9 2009/10/30 00:30:20 christos Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}lex
|
||||
HOST_SRCDIR= external/bsd/flex/bin
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
HOST_LDFLAGS+= -static
|
||||
.endif
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
HOST_CPPFLAGS+= -DM4=\"${TOOL_M4}\"
|
||||
|
||||
.y.c .l.c .y.h:
|
||||
@true
|
||||
|
||||
scan.c:
|
||||
echo '#include <initscan.c>' >$@
|
||||
parse.c:
|
||||
echo '#include <initparse.c>' >$@
|
||||
parse.h:
|
||||
echo '#include <initparse.h>' >$@
|
||||
|
||||
scan.c: parse.h
|
||||
|
||||
CLEANFILES+=scan.c parse.c parse.h
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2011/10/11 13:54:01 joerg Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}clang-tblgen
|
||||
HOSTPROG_CXX= ${_TOOL_PREFIX}clang-tblgen
|
||||
HOST_SRCDIR= external/bsd/llvm/bin/clang-tblgen
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2011/03/18 23:32:04 joerg Exp $
|
||||
|
||||
HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-clang
|
||||
HOSTPROG_CXX= ${MACHINE_GNU_PLATFORM}-clang
|
||||
HOST_SRCDIR= external/bsd/llvm/bin/clang
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
||||
install.host: ${HOST_BINDIR}/${MACHINE_GNU_PLATFORM}-clang++
|
||||
install.host: ${HOST_BINDIR}/${MACHINE_GNU_PLATFORM}-clang-cpp
|
||||
|
||||
${HOST_BINDIR}/${MACHINE_GNU_PLATFORM}-clang++:
|
||||
${_MKTARGET_INSTALL}
|
||||
mkdir -p ${HOST_BINDIR}
|
||||
${HOST_INSTALL_SYMLINK} ${HOSTPROGNAME} ${.TARGET}
|
||||
|
||||
${HOST_BINDIR}/${MACHINE_GNU_PLATFORM}-clang-cpp:
|
||||
${_MKTARGET_INSTALL}
|
||||
mkdir -p ${HOST_BINDIR}
|
||||
${HOST_INSTALL_SYMLINK} ${HOSTPROGNAME} ${.TARGET}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2012/06/17 07:40:25 joerg Exp $
|
||||
|
||||
HOST_BUILD=
|
||||
|
||||
.include "${.PARSEDIR}/../llvm/Makefile.inc"
|
||||
|
||||
.include "${LLVM_TOPLEVEL}/Makefile.inc"
|
||||
.include "${LLVM_TOPLEVEL}/include/Makefile"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user