Upgrading build system to new NetBSD revision
The tested targets are the followgin ones: * tools * distribution * sets * release The remaining NetBSD targets have not been disabled nor tested *at all*. Try them at your own risk, they may reboot the earth. For all compliant Makefiles, objects and generated files are put in MAKEOBJDIR, which means you can now keep objects between two branch switching. Same for DESTDIR, please refer to build.sh options. Regarding new or modifications of Makefiles a few things: * Read share/mk/bsd.README * If you add a subdirectory, add a Makefile in it, and have it called by the parent through the SUBDIR variable. * Do not add arbitrary inclusion which crosses to another branch of the hierarchy; If you can't do without it, put a comment on why. If possible, do not use inclusion at all. * Use as much as possible the infrastructure, it is here to make life easier, do not fight it. Sets and package are now used to track files. We have one set called "minix", composed of one package called "minix-sys"
This commit is contained in:
144
tools/Makefile
144
tools/Makefile
@@ -2,7 +2,58 @@
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
HAVE_GCC= 45
|
||||
.if defined(HAVE_GCC) || defined(HAVE_PCC)
|
||||
TOOLCHAIN_BITS= gmake .WAIT
|
||||
.endif
|
||||
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
.if defined(HAVE_GCC)
|
||||
.if ${HAVE_GCC} >= 45
|
||||
TOOLCHAIN_BITS+= gmp .WAIT
|
||||
TOOLCHAIN_BITS+= mpfr .WAIT
|
||||
TOOLCHAIN_BITS+= mpc .WAIT
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= binutils .WAIT
|
||||
.endif
|
||||
|
||||
.if defined(HAVE_GCC)
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= gcc
|
||||
. if ${MKCROSSGDB:Uno} != "no"
|
||||
TOOLCHAIN_BITS+= gdb
|
||||
. endif
|
||||
TOOLCHAIN_BITS+= .WAIT
|
||||
# XXX Eventually, we want to be able to build dbsym and mdsetimage
|
||||
# XXX if EXTERNAL_TOOLCHAIN is set.
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(HAVE_PCC)
|
||||
.if ${TOOLCHAIN_MISSING} == "no"
|
||||
TOOLCHAIN_BITS+= pcc
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.ifndef __MINIX
|
||||
TOOLCHAIN_BITS+= dbsym mdsetimage
|
||||
.endif
|
||||
|
||||
DTRACE_BITS=
|
||||
.if ${MKDTRACE} != "no"
|
||||
DTRACE_BITS+= .WAIT libelf
|
||||
DTRACE_BITS+= .WAIT libdwarf
|
||||
DTRACE_BITS+= .WAIT libctf
|
||||
DTRACE_BITS+= .WAIT ctfconvert ctfmerge
|
||||
.endif
|
||||
|
||||
LINT_BITS=
|
||||
.if ${MKLINT} != "no"
|
||||
LINT_BITS= lint lint2
|
||||
.endif
|
||||
|
||||
# Dependencies in SUBDIR below ordered to maximize parallel ability.
|
||||
SUBDIR= host-mkdep .WAIT compat .WAIT \
|
||||
@@ -16,10 +67,97 @@ SUBDIR= host-mkdep .WAIT compat .WAIT \
|
||||
.WAIT tic \
|
||||
.WAIT lex \
|
||||
.WAIT pax \
|
||||
.WAIT gmake .WAIT gmp .WAIT mpfr .WAIT mpc .WAIT binutils .WAIT gcc \
|
||||
cat file pwd_mkdb stat zic \
|
||||
.WAIT ${TOOLCHAIN_BITS} \
|
||||
cat cksum \
|
||||
file \
|
||||
.WAIT \
|
||||
pwd_mkdb stat zic
|
||||
|
||||
.if ${MKLLVM} != "no"
|
||||
# .WAIT between llvm-tblgen and llvm-clang-tblgen ensures install
|
||||
# rules works correctly
|
||||
SUBDIR+= \
|
||||
llvm .WAIT \
|
||||
llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
|
||||
llvm-tblgen .WAIT llvm-clang-tblgen .WAIT \
|
||||
llvm-include .WAIT \
|
||||
llvm-lib .WAIT \
|
||||
llvm-clang
|
||||
.endif
|
||||
|
||||
.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
|
||||
. if ${MKGROFF} != "no"
|
||||
SUBDIR+= groff
|
||||
. endif
|
||||
SUBDIR+= mandoc
|
||||
.endif
|
||||
|
||||
.if ${MKMAINTAINERTOOLS:Uno} != "no"
|
||||
SUBDIR+= autoconf .WAIT gettext
|
||||
.endif
|
||||
|
||||
.if ${USE_PIGZGZIP} != "no"
|
||||
SUBDIR+= pigz
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "hp700"
|
||||
SUBDIR+= hp700-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 ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
|
||||
${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
|
||||
SUBDIR+= mkubootimage
|
||||
.endif
|
||||
|
||||
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" # {
|
||||
realall realdepend install: check_MKTOOLS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.gnuhost,v 1.37 2012/01/21 22:31:15 christos Exp $
|
||||
# $NetBSD: Makefile.gnuhost,v 1.39 2012/06/19 21:48:33 hans Exp $
|
||||
#
|
||||
# Rules used when building a GNU host package. Expects MODULE to be set.
|
||||
#
|
||||
@@ -34,14 +34,19 @@ FIND_ARGS+= \! \( -type d \( \
|
||||
-name 'nbsd.mt' -o \
|
||||
-name 'tests*' \
|
||||
\) -prune \)
|
||||
_GNU_GET_SCRIPTS:= \
|
||||
external/gpl3/gcc/fetch.sh \
|
||||
external/gpl3/binutils/fetch.sh \
|
||||
gnu/dist/fetch.sh \
|
||||
external/lgpl2/mpc/fetch.sh \
|
||||
external/lgpl3/gmp/fetch.sh \
|
||||
external/lgpl3/mpfr/fetch.sh
|
||||
|
||||
|
||||
_GNU_GET_SRC!= ${HOST_SH} ${.CURDIR}/../../external/gpl3/gcc/fetch.sh && \
|
||||
${HOST_SH} ${.CURDIR}/../../external/gpl3/binutils/fetch.sh && \
|
||||
${HOST_SH} ${.CURDIR}/../../gnu/dist/fetch.sh && \
|
||||
${HOST_SH} ${.CURDIR}/../../external/lgpl2/mpc/fetch.sh && \
|
||||
${HOST_SH} ${.CURDIR}/../../external/lgpl3/gmp/fetch.sh && \
|
||||
${HOST_SH} ${.CURDIR}/../../external/lgpl3/mpfr/fetch.sh
|
||||
_gnu_get_src: ${_GNU_GET_SCRIPTS}
|
||||
.for name in ${_GNU_GET_SCRIPTS}
|
||||
${name}:
|
||||
${HOST_SH} ${.CURDIR}/../../${name}
|
||||
.endfor
|
||||
|
||||
# Do this "find" only if actually building something.
|
||||
.if (${USETOOLS} == "yes") && empty(.MAKEFLAGS:M-V*) && \
|
||||
@@ -105,17 +110,17 @@ MAKE_ARGS+= BISON=true DESTDIR= INSTALL=${HOST_INSTALL_FILE:Q}
|
||||
ALL_TARGET?= all
|
||||
INSTALL_TARGET?=install
|
||||
|
||||
BUILD_PLATFORM!= uname -srm | tr ' ' '-'
|
||||
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 -print0 | xargs -0 rm -f)
|
||||
@(cd build && find . -name config.cache | xargs rm -f)
|
||||
configure_cleanup=configure_cleanup
|
||||
.endif
|
||||
|
||||
.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup}
|
||||
.configure_done: _gnu_get_src .WAIT ${_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} > $@
|
||||
|
||||
@@ -11,6 +11,10 @@ COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
|
||||
.-include "${COMPATOBJ}/defs.mk"
|
||||
.endif
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
LDADD+= -lcompat_minix
|
||||
.endif
|
||||
|
||||
# Resolve pathnames in variables.
|
||||
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
|
||||
.for var in ${_RESOLVE_VARS}
|
||||
|
||||
53
tools/Makefile.nbincludes
Normal file
53
tools/Makefile.nbincludes
Normal file
@@ -0,0 +1,53 @@
|
||||
# $NetBSD: Makefile.nbincludes,v 1.3 2012/08/05 06:20:14 christos 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
|
||||
|
||||
_ARCH_INCS+= ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
|
||||
|
||||
_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
|
||||
.if !defined(__MINIX)
|
||||
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
|
||||
.endif
|
||||
cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
|
||||
${HOST_INSTALL_SYMLINK} ${MACHINE} machine
|
||||
@@ -11,10 +11,12 @@ BRANDING?= \
|
||||
--with-bugurl="http://www.NetBSD.org/support/send-pr.html" \
|
||||
--with-lib-path="=/usr/lib" --with-sysroot
|
||||
|
||||
# LSC FIXME: We are now using the triple i386-elf-minix instead of
|
||||
# elf32-i386-minix which is the correct one for us...
|
||||
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
|
||||
--target=${MACHINE_ARCH}-elf-minix \
|
||||
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
||||
--disable-werror \
|
||||
--target=i386-elf-minix \
|
||||
${BRANDING}
|
||||
|
||||
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
|
||||
HOSTLIB= nbcompat
|
||||
|
||||
.ifndef __MINIX
|
||||
SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.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 rmd160.c rmd160hl.c \
|
||||
setenv.c setgroupent.c \
|
||||
setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
|
||||
sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \
|
||||
strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \
|
||||
strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \
|
||||
vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c
|
||||
.else
|
||||
SRCS= atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \
|
||||
fpurge.c getline.c getmode.c getopt_long.c gettemp.c \
|
||||
heapsort.c \
|
||||
@@ -17,6 +35,7 @@ SRCS= atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \
|
||||
strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \
|
||||
strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \
|
||||
vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c
|
||||
.endif
|
||||
|
||||
BUILD_OSTYPE!= uname -s
|
||||
|
||||
@@ -31,7 +50,8 @@ CPPFLAGS+= -no-cpp-precomp
|
||||
CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
|
||||
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
|
||||
|
||||
.PATH: ${.CURDIR}/../../lib/libc/gen \
|
||||
.PATH: ${.CURDIR}/../../lib/libc/cdb \
|
||||
${.CURDIR}/../../lib/libc/gen \
|
||||
${.CURDIR}/../../lib/libc/hash \
|
||||
${.CURDIR}/../../lib/libc/hash/md2 \
|
||||
${.CURDIR}/../../lib/libc/hash/md5 \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: compat_defs.h,v 1.83 2012/01/21 20:05:27 tsutsui Exp $ */
|
||||
/* $NetBSD: compat_defs.h,v 1.86 2012/06/04 10:18:01 joerg Exp $ */
|
||||
|
||||
#ifndef __NETBSD_COMPAT_DEFS_H__
|
||||
#define __NETBSD_COMPAT_DEFS_H__
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/* So _NETBSD_SOURCE doesn't end up defined. Define enough to pull in standard
|
||||
defs. Other platforms may need similiar defines. */
|
||||
#ifdef __NetBSD__
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
#define _ISOC99_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
@@ -72,6 +72,11 @@
|
||||
#endif
|
||||
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
|
||||
|
||||
#undef __predict_false
|
||||
#define __predict_false(x) (x)
|
||||
#undef __predict_true
|
||||
#define __predict_true(x) (x)
|
||||
|
||||
/* We don't include <pwd.h> here, so that "compat_pwd.h" works. */
|
||||
struct passwd;
|
||||
|
||||
@@ -214,7 +219,7 @@ char *dirname(char *);
|
||||
#else
|
||||
/*XXX: Very hacky but no other way to bring this into scope w/o defining
|
||||
_NETBSD_SOURCE which we're avoiding. */
|
||||
#ifdef __NetBSD__
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
struct _dirdesc {
|
||||
int dd_fd; /* file descriptor associated with directory */
|
||||
long dd_loc; /* offset in current buffer */
|
||||
@@ -255,7 +260,7 @@ int easprintf(char **, const char *, ...);
|
||||
int evasprintf(char **, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if !HAVE_FGETLN || defined(__NetBSD__)
|
||||
#if !HAVE_FGETLN || defined(__NetBSD__) || defined(__minix)
|
||||
char *fgetln(FILE *, size_t *);
|
||||
#endif
|
||||
|
||||
@@ -267,7 +272,7 @@ char *fgetln(FILE *, size_t *);
|
||||
int flock(int, int);
|
||||
#endif
|
||||
|
||||
#if !HAVE_FPARSELN || BROKEN_FPARSELN || defined(__NetBSD__)
|
||||
#if !HAVE_FPARSELN || BROKEN_FPARSELN || defined(__NetBSD__) || defined(__minix)
|
||||
# define FPARSELN_UNESCESC 0x01
|
||||
# define FPARSELN_UNESCCONT 0x02
|
||||
# define FPARSELN_UNESCCOMM 0x04
|
||||
@@ -424,7 +429,7 @@ int setgroupent(int);
|
||||
int setpassent(int);
|
||||
#endif
|
||||
|
||||
#if !HAVE_SETPROGNAME || defined(__NetBSD__)
|
||||
#if !HAVE_SETPROGNAME || defined(__NetBSD__) || defined(__minix)
|
||||
const char *getprogname(void);
|
||||
void setprogname(const char *);
|
||||
#endif
|
||||
@@ -449,7 +454,7 @@ void strmode(mode_t, char *);
|
||||
char *strndup(const char *, size_t);
|
||||
#endif
|
||||
|
||||
#if !HAVE_STRSEP || defined(__NetBSD__)
|
||||
#if !HAVE_STRSEP || defined(__NetBSD__) || defined(__minix)
|
||||
char *strsep(char **, const char *);
|
||||
#endif
|
||||
|
||||
@@ -1108,7 +1113,7 @@ __GEN_ENDIAN_DEC(64, le)
|
||||
#endif
|
||||
|
||||
/* Protected by _NETBSD_SOURCE otherwise. */
|
||||
#if HAVE_STRUCT_STAT_ST_FLAGS && defined(__NetBSD__)
|
||||
#if HAVE_STRUCT_STAT_ST_FLAGS && (defined(__NetBSD__) || defined(__minix))
|
||||
#define UF_SETTABLE 0x0000ffff
|
||||
#define UF_NODUMP 0x00000001
|
||||
#define UF_IMMUTABLE 0x00000002
|
||||
@@ -1188,9 +1193,9 @@ __GEN_ENDIAN_DEC(64, le)
|
||||
#endif
|
||||
|
||||
/* Has quad_t but these prototypes don't get pulled into scope. w/o we lose */
|
||||
#ifdef __NetBSD__
|
||||
quad_t strtoq __P((const char *, char **, int));
|
||||
u_quad_t strtouq __P((const char *, char **, int));
|
||||
#if defined(__NetBSD__) || defined(__minix)
|
||||
quad_t strtoq(const char *, char **, int);
|
||||
u_quad_t strtouq(const char *, char **, int);
|
||||
#endif
|
||||
|
||||
#endif /* !__NETBSD_COMPAT_DEFS_H__ */
|
||||
|
||||
6
tools/compat/configure
vendored
6
tools/compat/configure
vendored
@@ -1864,12 +1864,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
echo "$as_me:1867: checking for NetBSD" >&5
|
||||
echo $ECHO_N "checking for NetBSD... $ECHO_C" >&6
|
||||
echo "$as_me:1867: checking for MINIX3" >&5
|
||||
echo $ECHO_N "checking for MINIX3... $ECHO_C" >&6
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
#line 1870 "configure"
|
||||
#include "confdefs.h"
|
||||
#ifdef __NetBSD__
|
||||
#ifdef __minix
|
||||
yes
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,5 +15,7 @@ CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX} --disable-shared \
|
||||
|
||||
.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
|
||||
|
||||
@@ -4,14 +4,17 @@
|
||||
|
||||
HAVE_GCC= 45 # On Minix
|
||||
|
||||
.ifdef __MINIX
|
||||
GCC_LANGUAGES=c
|
||||
.else
|
||||
GCC_LANGUAGES=c c++ objc
|
||||
.endif
|
||||
MODULE= gcc4
|
||||
|
||||
MKNATIVE_CONFIG_TARGET_LIBS= \
|
||||
configure-target-libiberty \
|
||||
configure-target-libstdc++-v3 \
|
||||
configure-target-libobjc \
|
||||
configure-target-libgcc
|
||||
configure-target-libobjc
|
||||
|
||||
.if ${HAVE_GCC} == 45
|
||||
MKNATIVE_TARGET= gcc45
|
||||
@@ -36,19 +39,20 @@ MULTILIB_ARGS= --disable-multilib
|
||||
SOFTFLOAT_ARGS= -with-float=soft
|
||||
.endif
|
||||
|
||||
# LSC FIXME We are not using the correct target ATM, so overrides for now...
|
||||
COMMON_CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} \
|
||||
--target=${MACHINE_ARCH}-elf-minix \
|
||||
--disable-libssp \
|
||||
--enable-long-long \
|
||||
--enable-threads \
|
||||
--with-bugurl=http://www.NetBSD.org/Misc/send-pr.html \
|
||||
--with-pkgversion="NetBSD nb2 20111202" \
|
||||
--with-system-zlib \
|
||||
${VAX_CONFIGURE_ARGS} \
|
||||
--enable-__cxa_atexit \
|
||||
--target=${MACHINE_ARCH}-elf-minix \
|
||||
--disable-threads \
|
||||
--disable-visibility \
|
||||
--enable-__cxa_atexit \
|
||||
--disable-libunwind
|
||||
|
||||
--disable-libunwind \
|
||||
--enable-__cxa_atexit
|
||||
.if defined(GCC_CONFIG_ARCH.${MACHINE_ARCH})
|
||||
COMMON_CONFIGURE_ARGS+= --with-arch=${GCC_CONFIG_ARCH.${MACHINE_ARCH}}
|
||||
.endif
|
||||
@@ -68,11 +72,15 @@ CONFIGURE_ARGS+= \
|
||||
${MULTILIB_ARGS} \
|
||||
${SOFTFLOAT_ARGS} \
|
||||
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
||||
--enable-languages=c
|
||||
--enable-languages="${GCC_LANGUAGES}"
|
||||
|
||||
GCC_CPPFLAGS= -DNETBSD_TOOLS -DTARGET_SYSTEM_ROOT=0 \
|
||||
-DTARGET_SYSTEM_ROOT_RELOCATABLE
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
GCC_CPPFLAGS+= -D_NETBSD_SOURCE -D_POSIX_SOURCE -D_COMPAT_MINIX
|
||||
.endif
|
||||
|
||||
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
|
||||
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
|
||||
EXTRA_PARTS= CPPFLAGS=${GCC_CPPFLAGS:Q} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $NetBSD: mknative-gcc,v 1.66 2012/01/10 12:27:54 skrll Exp $
|
||||
# $NetBSD: mknative-gcc,v 1.67 2012/08/11 16:05:01 skrll Exp $
|
||||
#
|
||||
# Shell script for generating all the constants needed for a native
|
||||
# platform build of src/gnu/dist/gcc.
|
||||
@@ -33,7 +33,7 @@ get_crtstuff () {
|
||||
mkdir -p $_OUTDIR/lib/$_subdir/arch
|
||||
|
||||
getvars gcc/Makefile \
|
||||
INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS \
|
||||
INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
|
||||
tm_defines xm_file xm_defines \
|
||||
| sed "s,-I$_DESTDIR/usr/include,,g" \
|
||||
| write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
GNUHOSTDIST= ${.CURDIR}/../../gnu/dist/gmake
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
HOST_CPPFLAGS+=-D_NETBSD_SOURCE -D_POSIX_SOURCE -D_COMPAT_MINIX
|
||||
.endif
|
||||
|
||||
CONFIGURE_ENV+= CC=${HOST_CC:Q} \
|
||||
CFLAGS=${HOST_CFLAGS:Q} \
|
||||
CPPFLAGS=${HOST_CPPFLAGS:Q} \
|
||||
|
||||
@@ -13,5 +13,7 @@ CONFIGURE_ARGS+=--disable-shared
|
||||
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
|
||||
|
||||
136
tools/headerlist
Normal file
136
tools/headerlist
Normal file
@@ -0,0 +1,136 @@
|
||||
# $NetBSD: headerlist,v 1.6 2011/01/26 01:18:55 pooka Exp $
|
||||
#
|
||||
# do not edit; this file was automatically generated by:
|
||||
# NetBSD: mkheaderlist.sh,v 1.1 2007/08/07 12:38:23 yamt Exp
|
||||
|
||||
./acorn26/include/disklabel.h
|
||||
./acorn26/include/elf_machdep.h
|
||||
./acorn32/include/disklabel.h
|
||||
./acorn32/include/elf_machdep.h
|
||||
./algor/include/disklabel.h
|
||||
./algor/include/elf_machdep.h
|
||||
./alpha/include/disklabel.h
|
||||
./alpha/include/elf_machdep.h
|
||||
./amd64/include/disklabel.h
|
||||
./amd64/include/elf_machdep.h
|
||||
./amiga/include/disklabel.h
|
||||
./amiga/include/elf_machdep.h
|
||||
./amigappc/include/disklabel.h
|
||||
./amigappc/include/elf_machdep.h
|
||||
./arc/include/disklabel.h
|
||||
./arc/include/elf_machdep.h
|
||||
./arm/include/disklabel.h
|
||||
./arm/include/elf_machdep.h
|
||||
./atari/include/disklabel.h
|
||||
./atari/include/elf_machdep.h
|
||||
./mips/include/elf_machdep.h
|
||||
./bebox/include/disklabel.h
|
||||
./bebox/include/elf_machdep.h
|
||||
./cats/include/disklabel.h
|
||||
./cats/include/elf_machdep.h
|
||||
./cesfic/include/disklabel.h
|
||||
./cesfic/include/elf_machdep.h
|
||||
./cobalt/include/disklabel.h
|
||||
./cobalt/include/elf_machdep.h
|
||||
./emips/include/disklabel.h
|
||||
./emips/include/elf_machdep.h
|
||||
./dreamcast/include/disklabel.h
|
||||
./dreamcast/include/elf_machdep.h
|
||||
./evbarm/include/disklabel.h
|
||||
./evbarm/include/elf_machdep.h
|
||||
./evbmips/include/disklabel.h
|
||||
./evbmips/include/elf_machdep.h
|
||||
./evbppc/include/disklabel.h
|
||||
./evbppc/include/elf_machdep.h
|
||||
./evbsh3/include/disklabel.h
|
||||
./evbsh3/include/elf_machdep.h
|
||||
./ews4800mips/include/disklabel.h
|
||||
./ews4800mips/include/elf_machdep.h
|
||||
./hp300/include/disklabel.h
|
||||
./hp300/include/elf_machdep.h
|
||||
./hp700/include/disklabel.h
|
||||
./hp700/include/elf_machdep.h
|
||||
./hpc/stand/hpcboot/arm/elf_machdep.h
|
||||
./hpc/stand/hpcboot/sh3/elf_machdep.h
|
||||
./hpc/stand/hpcboot/mips/elf_machdep.h
|
||||
./hpc/stand/include/machine/disklabel.h
|
||||
./hpc/stand/include/machine/elf_machdep.h
|
||||
./hpcarm/include/disklabel.h
|
||||
./hpcarm/include/elf_machdep.h
|
||||
./hpcmips/include/disklabel.h
|
||||
./hpcmips/include/elf_machdep.h
|
||||
./hpcmips/stand/include/machine/disklabel.h
|
||||
./hpcmips/stand/include/machine/elf_machdep.h
|
||||
./hpcmips/stand/include/mips/elf_machdep.h
|
||||
./hpcsh/include/disklabel.h
|
||||
./hpcsh/include/elf_machdep.h
|
||||
./hppa/include/elf_machdep.h
|
||||
./i386/include/disklabel.h
|
||||
./i386/include/elf_machdep.h
|
||||
./ia64/include/disklabel.h
|
||||
./ia64/include/elf_machdep.h
|
||||
./ibmnws/include/disklabel.h
|
||||
./ibmnws/include/elf_machdep.h
|
||||
./iyonix/include/disklabel.h
|
||||
./iyonix/include/elf_machdep.h
|
||||
./landisk/include/disklabel.h
|
||||
./landisk/include/elf_machdep.h
|
||||
./luna68k/include/disklabel.h
|
||||
./luna68k/include/elf_machdep.h
|
||||
./m68k/include/elf_machdep.h
|
||||
./mac68k/include/disklabel.h
|
||||
./mac68k/include/elf_machdep.h
|
||||
./macppc/include/disklabel.h
|
||||
./macppc/include/elf_machdep.h
|
||||
./mipsco/include/disklabel.h
|
||||
./mipsco/include/elf_machdep.h
|
||||
./mmeye/include/disklabel.h
|
||||
./mmeye/include/elf_machdep.h
|
||||
./mvme68k/include/disklabel.h
|
||||
./mvme68k/include/elf_machdep.h
|
||||
./mvmeppc/include/disklabel.h
|
||||
./mvmeppc/include/elf_machdep.h
|
||||
./netwinder/include/disklabel.h
|
||||
./netwinder/include/elf_machdep.h
|
||||
./news68k/include/disklabel.h
|
||||
./news68k/include/elf_machdep.h
|
||||
./newsmips/include/disklabel.h
|
||||
./newsmips/include/elf_machdep.h
|
||||
./next68k/include/disklabel.h
|
||||
./next68k/include/elf_machdep.h
|
||||
./ofppc/include/disklabel.h
|
||||
./ofppc/include/elf_machdep.h
|
||||
./pmax/include/disklabel.h
|
||||
./pmax/include/elf_machdep.h
|
||||
./powerpc/include/elf_machdep.h
|
||||
./prep/include/disklabel.h
|
||||
./prep/include/elf_machdep.h
|
||||
./rs6000/include/disklabel.h
|
||||
./rs6000/include/elf_machdep.h
|
||||
./sandpoint/include/disklabel.h
|
||||
./sandpoint/include/elf_machdep.h
|
||||
./sbmips/include/disklabel.h
|
||||
./sbmips/include/elf_machdep.h
|
||||
./sgimips/include/disklabel.h
|
||||
./sgimips/include/elf_machdep.h
|
||||
./sh3/include/disklabel.h
|
||||
./sh3/include/elf_machdep.h
|
||||
./shark/include/disklabel.h
|
||||
./shark/include/elf_machdep.h
|
||||
./sparc/include/disklabel.h
|
||||
./sparc/include/elf_machdep.h
|
||||
./sparc64/include/disklabel.h
|
||||
./sparc64/include/elf_machdep.h
|
||||
./sun2/include/disklabel.h
|
||||
./sun2/include/elf_machdep.h
|
||||
./sun3/include/disklabel.h
|
||||
./sun3/include/elf_machdep.h
|
||||
./sun68k/include/disklabel.h
|
||||
./usermode/include/disklabel.h
|
||||
./usermode/include/elf_machdep.h
|
||||
./vax/include/disklabel.h
|
||||
./vax/include/elf_machdep.h
|
||||
./x68k/include/disklabel.h
|
||||
./x68k/include/elf_machdep.h
|
||||
./zaurus/include/disklabel.h
|
||||
./zaurus/include/elf_machdep.h
|
||||
@@ -3,6 +3,11 @@
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}lex
|
||||
HOST_SRCDIR= external/bsd/flex/bin
|
||||
|
||||
.if ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||
HOST_CPPFLAGS+=-D_NETBSD_SOURCE -D_POSIX_SOURCE -D_COMPAT_MINIX
|
||||
HOST_LDFLAGS+= -static
|
||||
.endif
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
HOST_CPPFLAGS+= -DM4=\"${TOOL_M4}\"
|
||||
|
||||
|
||||
36
tools/mandoc/Makefile
Normal file
36
tools/mandoc/Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
# $NetBSD: Makefile,v 1.5 2010/02/20 13:43:31 joerg Exp $
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}mandoc
|
||||
HOST_SRCDIR= external/bsd/mdocml/bin/mandoc
|
||||
|
||||
NOMAN= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
NETBSD_MINOR!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh -n
|
||||
NETBSD_OSNAME= "NetBSD ${NETBSD_MINOR}"
|
||||
|
||||
HOST_CPPFLAGS+= -DOSNAME=${NETBSD_OSNAME:Q} -DHAVE_CONFIG_H -I.
|
||||
|
||||
DPSRCS+= config.h
|
||||
|
||||
CLEANFILES+= config.log config.h
|
||||
|
||||
config.h: config.h.pre config.h.post
|
||||
rm -f config.log
|
||||
( cat ${DISTDIR}/config.h.pre; \
|
||||
echo; \
|
||||
if $(CC) $(CFLAGS) -Werror -c ${DISTDIR}/test-strlcat.c >> config.log 2>&1; then \
|
||||
echo '#define HAVE_STRLCAT'; \
|
||||
rm test-strlcat.o; \
|
||||
fi; \
|
||||
if $(CC) $(CFLAGS) -Werror -c ${DISTDIR}/test-strlcpy.c >> config.log 2>&1; then \
|
||||
echo '#define HAVE_STRLCPY'; \
|
||||
rm test-strlcpy.o; \
|
||||
fi; \
|
||||
echo; \
|
||||
cat ${DISTDIR}/config.h.post \
|
||||
) > $@
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
@@ -1,5 +1,4 @@
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}mkfs.mfs
|
||||
HOST_SRCDIR= usr.sbin/mkfs.mfs
|
||||
|
||||
LDADD= #defined
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
||||
21
tools/mkheaderlist.sh
Normal file
21
tools/mkheaderlist.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# $NetBSD: mkheaderlist.sh,v 1.2 2011/02/05 13:30:26 yamt Exp $
|
||||
|
||||
# scan the source tree and create the headerlist file which is used by
|
||||
# Makefile.nbincludes.
|
||||
|
||||
set -e
|
||||
|
||||
mklist()
|
||||
{
|
||||
echo "# \$NetBSD\$"
|
||||
echo "#"
|
||||
echo '# do not edit; this file was automatically generated by:'
|
||||
echo '# $NetBSD: mkheaderlist.sh,v 1.2 2011/02/05 13:30:26 yamt Exp $' | sed -e 's/\$//g'
|
||||
echo
|
||||
cd ../sys/arch && find . -name disklabel.h -o -name elf_machdep.h
|
||||
}
|
||||
|
||||
LIST=headerlist
|
||||
rm -f ${LIST}
|
||||
mklist > ${LIST}
|
||||
@@ -10,5 +10,7 @@ CONFIGURE_ARGS+=--disable-shared
|
||||
|
||||
.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
|
||||
|
||||
@@ -9,5 +9,7 @@ CONFIGURE_ARGS+=--disable-shared
|
||||
|
||||
.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
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
HOSTPROGNAME= ${_TOOL_PREFIX}sed
|
||||
HOST_SRCDIR= usr.bin/sed
|
||||
|
||||
.ifdef __MINIX
|
||||
SYMLINKS= # defined so usr.bin/sed/Makefile does not set it
|
||||
.endif
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
|
||||
@@ -7,5 +7,8 @@ HOST_SRCS= compile.c hash.c
|
||||
TERMINFODIR= ${NETBSDSRCDIR}/lib/libterminfo
|
||||
|
||||
.include "${.CURDIR}/../Makefile.host"
|
||||
.ifndef __MINIX
|
||||
.include "${TERMINFODIR}/Makefile.hash"
|
||||
.endif
|
||||
|
||||
.PATH: ${TERMINFODIR}
|
||||
|
||||
Reference in New Issue
Block a user