Import NetBSD tools and build.sh

This commit finalizes support for cross compilation. The tools
directory are all links to the actual tools and are built on the
host system to build Minix. build.sh is the work horse that takes
care of all environment settings. It's slightly adjusted for Minix.
The /usr/src/Makefile has additional targets needed for cross
compilation.
This commit is contained in:
Thomas Veerman
2012-06-06 14:46:00 +00:00
parent 2ed11343a6
commit c8a0e2f4c6
140 changed files with 26869 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# $NetBSD: Makefile.regen,v 1.1 2007/10/14 20:25:35 apb Exp $
.include "bsd.own.mk"
# Run "${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen" by hand after
# editing configure.ac. See more detailed instructions in configure.ac.
regen:
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf

23
tools/make/buildmake.sh.in Executable file
View File

@@ -0,0 +1,23 @@
#! /bin/sh
# $NetBSD: buildmake.sh.in,v 1.8 2006/08/26 22:17:48 christos Exp $
#
# buildmake.sh.in - Autoconf-processed shell script for building make(1).
#
: ${HOST_CC="@CC@"}
: ${HOST_CFLAGS="@CPPFLAGS@ @CFLAGS@"}
: ${HOST_LDFLAGS="@LDFLAGS@ @LIBS@"}
: ${runcmd=""}
docmd () {
echo "$1"
$1 || exit 1
}
MKSRCDIR=@srcdir@/../../usr.bin/make
for f in $MKSRCDIR/*.c $MKSRCDIR/lst.lib/*.c; do
docmd "${HOST_CC} ${HOST_CFLAGS} @DEFS@ -c $f"
done
docmd "${HOST_CC} ${HOST_CFLAGS} -o ${_TOOL_PREFIX:-nb}make *.o ${HOST_LDFLAGS}"

2802
tools/make/configure vendored Executable file

File diff suppressed because it is too large Load Diff

50
tools/make/configure.ac Normal file
View File

@@ -0,0 +1,50 @@
# $NetBSD: configure.ac,v 1.9 2007/10/14 20:26:47 apb Exp $
#
# Autoconf definition file for make.
#
# When you edit configure.ac:
# 0. Create the tools version of autoconf:
# 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" from "configure.ac":
# cd ${SRCDIR}/tools/make && \
# ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen
# (Please don't use a non-tools version of autoconf).
# 3. Test that nbmake still builds
# mv ${TOOLDIR}/nbmake ${TOOLDIR}/bin/nbmake.bak
# cd ${SRCDIR} && build.sh makewrapper
# 4. cvs commit files that you edited.
# 5. Regen again, to pick up changed RCS IDs from the above commit:
# cd ${SRCDIR}/tools/make && \
# ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen
# 6. cvs commit files that were generated.
#
#
AC_INIT([make], [noversion], [bin-bug-people@NetBSD.org])
AC_CONFIG_FILES(buildmake.sh)
AC_PATH_PROG(BSHELL, sh)
if test x"$BSHELL" = x; then
AC_MSG_ERROR([sh must be somewhere on \$PATH, or BSHELL must be defined])
fi
AC_DEFINE_UNQUOTED(DEFSHELL_CUSTOM, "${BSHELL}")
# Make sure we have POSIX regex ability.
AC_CHECK_HEADER(regex.h,, AC_MSG_ERROR([POSIX regex.h is required]))
# If we don't have <poll.h>, we need to use select(2).
AC_CHECK_HEADER(poll.h,, AC_DEFINE(USE_SELECT))
# 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_FUNCS(setenv strdup strerror strftime vsnprintf)
AC_OUTPUT