Commit Graph

491 Commits

Author SHA1 Message Date
christos 4de0ea44a5 Replace the original fgetln with a simpler one that:
1. Works if the last line does not end up in \n
2. Does not scan the string multiple times.
3. Does not copy the string, but writes it directly in the buffer.
4. Handles out of memory conditions gracefully.
2005-05-15 21:31:26 +00:00
skrll 990898b846 Use the correct AS when creating the mknative environment.
Reviewed by mrg@

mknative re-runs will appear soon.
2005-05-14 08:00:58 +00:00
chs 6fafa8c2a3 don't build a shared lib for the host-tool, it doesn't work on hp700
and isn't needed anyway.
2005-05-08 01:47:33 +00:00
jmc 2b4f5f9782 Update notes for testing on linux, OS/X 2005-04-05 00:21:22 +00:00
wiz 1dc296553a Remove commas in AC_CHECK_FUNCS that shouldn't be there.
Closes PR 29577 by Valeriy E. Ushakov.
2005-03-02 18:08:43 +00:00
jmc 2fbd40c4e0 Put back @ on configure line. Was off for debugging and shouldn't have been
committed.
2005-02-11 15:11:08 +00:00
jmc e392f6d248 Pass CC,CXX and a few other vars along to configure so file can find the c++
preprocessor (which of course it doesn't even use...)
2005-02-11 15:01:57 +00:00
jmc 07aeec53c1 Make a BUILD_ENV that by defaults matches CONFIGURE_ENV and pass it along on
the build step. Catches things like binutils which do a bunch of configures
on the build step and lose possibly. Fixes issues from PR#29197 for lex
not being picked up here.
2005-02-11 15:01:03 +00:00
jmc 0a58d4b08d Define LOGIN_NAME_MAX explicitly here and override any system provided one
since the compat tools need to use the NetBSD limits, not the local system
ones (and some systems don't provide this yet anyways). Fixes PR#29170
2005-02-01 05:26:03 +00:00
is d781105e1d We don't need aout2bb any longer. 2005-01-27 12:54:05 +00:00
skrll c88f165c85 Revert previous.
We need to fix vax a different way as the move of -B${DESTDIR}/usr/lib/
to CFLAGS filters into the defs.mk files.
2005-01-14 07:46:56 +00:00
jmc f7b3f12b97 Turns out some platforms (freebsd5) expose st_birthtime but not
st_birthtimensec. Make sure and check for both so programs can deal w. it
2005-01-13 00:52:40 +00:00
mycroft 963654140b Add some quotes to prevent a syntax error. 2005-01-09 03:48:30 +00:00
mrg 8887f2b7c4 for mknative, move -B from CC to CFLAGS, fixes vax configs 2004-12-12 12:42:35 +00:00
jmc 427a8339c4 Provide a definition for __UNCONST since there's no guarentee our sys/cdefs.h
gets pulled in
2004-12-11 09:34:08 +00:00
jmc 4d724bafe7 Take output and look for things of the form ./XXX.o and turn them into XXX.o
so generated objects vs listed objects in make line up and dependcies happen
correctly. Found because libiberty (on this binutils import) was leaving
all objects as ./object.o and make wasn't picking up correct depends on
config.h as a result.
2004-12-11 07:40:50 +00:00
lukem 9741933ec5 minor (shell) KNF 2004-12-11 01:37:36 +00:00
mrg ab78454ed7 mirror a fix from mknative-binutils:
>fix the sed expression that pulls VPATH out of the makefile to work
>with any number of tabs or spaces after the equal sign.
2004-12-10 13:58:11 +00:00
mrg d99893c4fd fix the sed expression that pulls VPATH out of the makefile to work
with any number of tabs or spaces after the equal sign.
2004-12-10 13:57:08 +00:00
jmc 9bfe9b9970 Convert mkboot into a full cross tool. Last hurdle for hp300 to building on
non NetBSD/bsd hosts.
2004-11-28 11:14:41 +00:00
jmc c7464d49db Convert remaining host tools for amiga to correct cross tools. Now allows
complete amiga builds on non netbsd/bsd hosts
2004-11-28 07:00:52 +00:00
jmc 9da9dc64b7 Add heapsort to libnbcompat 2004-11-28 06:57:14 +00:00
jmc 9a999c376a Convert bebox's remaining host tools over to cross tools scheme. Builds to sets
w/o error now.
2004-11-25 08:09:14 +00:00
skrll c31da5e397 Pass AR and RANLIB also.
OK'ed by mrg.
2004-10-18 08:33:48 +00:00
jmc 7a47cf149b Check for fstatvfs and provide/use it only if the host system has it.
Fixes PR#27221
2004-10-12 03:28:30 +00:00
thorpej c1c65fe4a1 Add code to extract make vars for GCC crtstuff. 2004-08-24 20:24:43 +00:00
skrll bc26aea7ac Build hp700's mkboot as a host tool called nbhp700-mkboot. mkboot also
gets built and installed in a hp700 distribution.

TODO

- merge with hp300

- pick a preferred method for dealing with the elf headers.
  hp700-mkboot and prep-mkbootimage (bintuils) vs mips-elf2ecoff and
  tools/installboot
2004-07-28 09:17:31 +00:00
dbj 46ea8fc0f8 check for HAVE_STRUCT_STATVFS_F_IOSIZE
addresses PR toolchain/26415
2004-07-24 16:32:01 +00:00
dbj a7a2f3a478 remove HAVE_STRUCT_STATFS_F_IOSIZE
this is not currently being used and should be replaced with
HAVE_STRUCT_STATVFS_F_IOSIZE, but that will be done separately.
This commit should be able to be safely pulled up to
the netbsd-2-0 branch to address PR toolchain/26415
2004-07-24 12:24:59 +00:00
skrll caf6252920 Add some more variables used to build libgcc_s.
Part of the fix for PR 22452.
2004-07-01 13:22:25 +00:00
tron ecde30ce9a Define "_ISOC99_SOURCE" when building under NetBSD to get the prototypes
for strtoll() and strtoull(). This fixes PR toolchain/26021.
2004-06-23 11:08:01 +00:00
jmc 3cc9c970a3 Redo the last commit. _NETBSD_SOURCE should never be used/referenced anymore.
So, don't wrap definitions in it, and instead check for it and #error out
if it somehow leaks into scope.

Tested a complete build to sets on x86 from a clean source tree.
2004-06-22 04:36:23 +00:00
jmc fe74c8aaed Note on NetBSD that _NETBSD_SOURCE should never be defined and it's an error
if it is
2004-06-22 01:51:22 +00:00
christos e71f17c257 - Wrap around #if !_NETBSD_SOURCE the definitions of u_{long,int,short,char}
- Protect dirfd() macro so that we don't re-define it.

These changes make my build proceed further.

The problem is that automatically generated files, might include system
files before they include anything else (for example our yacc skeleton
includes <stdlib.h> before it does anything else). This foils the scheme
of defining _POSIX_SOURCE and friends so that _NETBSD_SOURCE does not
get defined; in fact, we include many files with _NETBSD_SOURCE defined,
enough to cause confusion in compat_defs.h which tries to re-define things.
2004-06-21 23:14:42 +00:00
jmc 0a6d68b570 On NetBSD boxes make sure and provide prototypes for strtouq since quad_t gets
exposed all the time, but routines which use it do not. Otherwise callers
of strtouq will lose.
XXX: Need to come back through here and clean up the configure tests better
for this
2004-06-21 22:13:32 +00:00
jmc 84fafa3db5 Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
2004-06-21 18:20:08 +00:00
jmc a3bd3ce336 Add $MAKE to env also. From PR#25952 2004-06-20 23:12:40 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
thorpej b45be21f86 Use ${_TOOL_PREFIX} as appropriate. 2004-06-18 20:26:51 +00:00
thorpej a72980c494 Oops, missed a spot where we need to handle group_from_gid() separately. 2004-06-18 20:24:03 +00:00
thorpej 08248e74c7 Regen. 2004-06-18 20:17:12 +00:00
thorpej 594733dd5a Handle group_from_gid() on its own. 2004-06-18 20:17:01 +00:00
thorpej e1df38d43a Check for group_from_gid(). 2004-06-18 20:07:31 +00:00
jmc 09709f97dd Before sucking in stdlib.h check if this is NetBSD. If so, explicitly make
sure to use _POSIX_C_SOURCE and undef _NETBSD_SOURCE so the myriad of NetBSD
extentions don't get pulled into scope (and likely conflict at some point
with branched code trying to build on -current due to drift). Fixes PR#25533

XXX: The entire process here is just wacky and the entire cross tools process
needed to be reviewed to build clean w. just _POSIX_C_SOURCE or the equiv
set on NetBSD hosts or this will lose again somewhere..
2004-06-14 06:13:15 +00:00
jmc c1f0789352 MKUPDATE cannot possibly do the right thing with GNU wrapped tools installs as
no dependencies are known in advance. So a simple 'build.sh -r -u' will
often lose and end up with a TOOLDIR without a toolchain, groff, etc. Fix
by forcing .install_done to always run.
2004-06-12 14:56:30 +00:00
abs ef4ecdda5b Add sparkcrc (used to generate checksums for acorn32 bootloader sparkive)
as a host tool.
2004-06-08 21:44:46 +00:00
sjg 5d1af908f6 Apply patch from OGAWA Takaya to fix FreeBSD hosted builds.
The trick is to force use of the NetBSD versions of user_from_{uid,gid}().

PR: 24843
2004-05-18 22:14:35 +00:00
ross 4ea0ff5fba Track make(1) build simplifications.
Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().

Also, get rid of a now-unneeded -I.
2004-05-07 00:04:37 +00:00
jmc 7a3a50551c Make this build on non-NetBSD again (specifically linux). Exclude __ndbm13.c
from the imported db sources as well
2004-05-03 03:20:20 +00:00
matt d4793b28a9 Add a compat definition of __packed. 2004-04-24 15:46:24 +00:00
christos dbe056a805 more constification suggested by kleink. 2004-04-23 14:46:31 +00:00
christos 5c424ffc08 adjust to constification of cget*() 2004-04-23 14:38:16 +00:00
dsl 8d259d44d9 Fix the processing of '-s .lo\ .ln' (etc).
This means that the tools now have correct dependencies (xxx.lo: ... instead
of xxx.o: ...) and in particular causes the pax to be built with consistent
headers.
There could also be other lossage on update builds of tools.
2004-03-27 18:36:23 +00:00
thorpej 281d6fd171 Don't use $MACHINE to name the program; just call it macppc-fixcoff. 2004-03-03 19:42:01 +00:00
skrll 0aae540257 Backout recent changes made to gnu/lib/libgcc3 for a forced MKPIC=no build.
Fix the behaviour of native and tools gcc when MKPIC=no is specified for
platforms that mknative has determined support shared libraries.

XXX distrib/sets/sets.subr doesn't support MKPIC=no
2004-02-27 14:52:01 +00:00
skrll b263dbdd73 Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

        - creates libgcc, libgcc_eh and libgcc_s

        - updates LIBGCC_SPEC to use them appropriately.

          There's a hack in here at the moment with respect to libgcc_so in that it
          is preferable to link against libgcc_so will only when -shared-libgcc is
          specified (the c++ frontend does this automatically.) Configurations where
          LINK_EH_SPEC is defined already do this. The gcc configuration for
          NetBSD/alpha and another NetBSD platform (I forget which) actually define
          LINK_EH_SPEC probably by accident rather than design.

        - updates share/mk to use the compiler's knowledge of what needs linking into
          libraries and executables. This removes an hppa hack.

        - updates the sets for the newly created libgcc* files.

	- support for linking against the _pg version of libgcc has been removed.
2004-02-15 19:52:27 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
simonb b761275305 Fix some paths. 2004-02-13 03:01:21 +00:00
skrll d5174d72e9 Copy over from ../toolchain/README.mknative and update for gcc-3.3.x. 2004-02-12 18:57:08 +00:00
skrll 95cfd78c59 Updates so that mknative gets the right things.
- Disable symbol versioning (for now)
	- Make sure that libiberty knows its being configured with a
	  cross compiler.
	- The CXX_* variables are no longer needed/used.
	- LIB2FUNCS_EXTRA gets pulled in via LIB2ADD
	- Get LIB1ASMFUNCS and LIB2ASMSRC
	- MAYBE_USE_COLLECT2 got renamed to USE_COLLECT2 (but might not
	  be used)
	- Get EXTRA_HEADERS so that we get generate the right paths for
	  CPPFLAGS
	- Get some variables related to shared libgcc
2004-02-10 09:37:58 +00:00
ross 8dbba41619 Get ${HOSTEXEEXT} right in the component installation loop.
There are three levels of compliance w.r.t. HOSTEXEEXT. (1) built and
installed both wrong, (2) both right, and (3) one right, one wrong.
Most tool builds do (1), i.e., wrong, but not seriously so. This makefile
actually built them the "right" way, leading to error (3), which was fatal.
2004-02-06 00:06:53 +00:00
simonb fa7a1046d3 White space nit. 2004-01-13 00:53:06 +00:00
simonb c7fb30805a Use the first argument of getmode() to modify the second arg, instead of
just replacing the second arg.  This lets the higher order file type bits
survive.  Fixes problems with the tools version of mknod(8).
2004-01-12 02:23:37 +00:00
simonb a5c6a6feac KNF. 2004-01-08 12:16:09 +00:00
lukem 986979b8c9 Consistently check ${TOOLCHAIN_MISSING} against "no". 2004-01-03 14:04:27 +00:00
skrll 2879279c43 Move libgcc3/*.mk to libgcc3/arch.
Update mknative-gcc.
2004-01-02 11:58:32 +00:00
jmc 6e1ad41386 Add ID line 2003-12-30 21:08:26 +00:00
jmc a2aecee228 List that all hosts require a posix sh and override with HOST_SH if needed.
Start a list of any other general tools assumed (gzip being the only one
right now).
Note that redhat8 works with no special settings.
2003-12-29 07:09:44 +00:00
matt d672abfa9e Fix typo. 2003-12-11 14:52:46 +00:00
matt ca1e0d5980 Add macppc-fixcoff tool. 2003-12-11 00:29:33 +00:00
lukem 219ba062f8 Use (cd ${.CURDIR} && ${MAKE} cleandir) instead of ${MAKE} cleandir
Suggested by Ross Harvey.
2003-12-10 05:19:41 +00:00
dsl 9a8804be3a Make command line parser getopt() compatible (allow host-mkdep -aq -s.o.lo ...)
Don't use shell builtin because we need to know the values of OPTIND (etc)
in what is usually an error path.
2003-12-07 20:19:15 +00:00
mrg 952c497306 move libaries back to gnu/lib 2003-12-04 14:38:00 +00:00
mrg 949cd54d3a always build tools/binutils now. 2003-12-04 10:08:58 +00:00
mrg d67b3528da look for libbfd etc in binutils always now. 2003-12-04 09:59:07 +00:00
mrg ce29aa2370 build lib{opcodes,bfd,iberty} back in gnu/lib instead of gnu/usr.bin/binutils
as they are needed earlier than when gnu/usr.bin/binutils is built when
"make -j" is used.
2003-12-04 09:29:31 +00:00
mrg b538519c6c fix a bug in previous:
don't pass -L${DESTDIR}/usr/lib twice, pass it once with -L${DESTDIR}/lib.
2003-12-01 09:37:09 +00:00
mrg ece8a60d7a move binutils lib{iberty,opcodes,bfd} to usr.bin/binutils. 2003-11-27 10:52:53 +00:00
mrg 113e3b6075 fix a comment; normalise. 2003-11-27 10:21:24 +00:00
mrg 0fcc88b5a2 all `tooldir/nbmake-$ARCH native-binutils' support, to regenerate binutils
configury files for the integrated toolchain.
2003-11-27 10:12:02 +00:00
mrg c460f3a0b0 use mknative.common 2003-11-27 01:05:45 +00:00
mrg 3807186825 trim FIND_ARGS. remove dead targets. 2003-11-27 01:05:32 +00:00
mrg 3afc93cfea common part of mknative 2003-11-27 00:58:26 +00:00
mrg 7289588744 be a little more verbose about what we're doing when running mknative.
also grab LIB2FUNCS_EXTRA for libgcc3 (old fix for m68000).
2003-11-27 00:56:20 +00:00
dbj 8547b2b628 note successful build on Mac OS 10.3 with xcode 1.0 developer tools 2003-11-17 05:42:58 +00:00
dsl 37b127cb76 Correct .PHONY rules that force tools to be installed to use
'.if ${MKUPDATE} == "no"' instead of '.if !defined(UPDATE)'.
2003-11-16 18:06:01 +00:00
lukem e606e2dcb2 Improve how various "simple" host tools are built and invoked. 2003-11-16 14:14:18 +00:00
dbj 5262dfd168 add --with-included-gettext to CONFIGURE_ARGS since it was
trying to use the native -lintl but not adding it to LIBS
2003-11-12 19:47:54 +00:00
dbj f26617b6f6 regen after HAVE_SYS_POLL_H change 2003-11-12 19:44:33 +00:00
dbj a473896520 use sys/poll.h and HAVE_SYS_POLL_H instead of just HAVE_POLL_H
HAVE_SYS_POLL_H is used by src/include/roken.h needed by the host tool asn1_compile
2003-11-12 19:43:58 +00:00
matt c6f617d7c1 Don't use TERMCAP if host tool. 2003-11-12 02:18:27 +00:00
dsl 7037826394 Let -- be used to separate mkdep options from cc options 2003-11-11 10:50:02 +00:00
dsl 198a6cd602 Make this support the same new options as recently added to the mkdep program. 2003-11-10 17:57:43 +00:00
sekiya 0ac350820d Build sgivol as a host tool when compiling for sgimips. 2003-11-08 05:02:33 +00:00
sekiya f7005aea9c Build sgivol as a host tool. 2003-11-08 05:01:36 +00:00
lukem 3c82ede8bd clean the "stripped" mdoc files 2003-10-28 07:46:16 +00:00
lukem 444edb22a9 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 01:42:50 +00:00
lukem af258d4e7c add mknod as a host tool 2003-10-27 00:35:37 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00