Commit Graph

461 Commits

Author SHA1 Message Date
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
cl 98f3b47a3f add gdb53 as a host tool for use as a crossgdb
replaces gdb50 from toolchain on archs which use gcc3
2003-10-26 01:06:27 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
wiz 6f18690e01 Strip man.local and mdoc.local before installation; fixes problem with undefined variables
found by lukem.
2003-10-20 08:25:36 +00:00
lukem ddff99b7f4 rework to use the newer _MKMSGCREATE (et al) macros 2003-10-19 04:45:01 +00:00
matt 10c0014b94 Add host tool version of ncdcs 2003-10-19 03:35:30 +00:00
lukem 2c30246862 MAKEVERBOSE support 2003-10-18 16:33:58 +00:00
dbj 3c72899f34 add -O2 to HOST_CFLAGS on Darwin since adding "-no-cpp-precomp" there blows
it away otherwise
2003-10-10 21:49:59 +00:00
thorpej 9a2255650e Set EXTRA_PARTS to a null value, like we do with LIBGCC. This prevents
the tool build from attempting to build the GCC crtstuff before the
target include files are installed.  PR toolchain/23112.

(Note: You would not see the bad behavior described in the PR unless
your .mk files were hacked to configure the toolchain target as
*-*-netbsd*2.0.)
2003-10-10 01:18:54 +00:00
lukem 1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
dbj 2fe0adbe32 set HOST_CFLAGS+= -no-cpp-precomp when configuring gnu software on Darwin 2003-10-07 14:12:36 +00:00
seb e969ce2f8d Adjust pathnames to {md{4,5},sha1}.h after their removal from
src/include.

Approved by mrg@
2003-10-01 11:59:06 +00:00
uwe 3f02ec91cd If SIZE_MAX is not defined, but SIZE_T_MAX is defined (e.g. FreeBSD),
define SIZE_MAX as SIZE_T_MAX.
2003-08-27 18:33:26 +00:00
mrg e649b75296 for mknative, make sure we look in the target's /lib directly as the
symlinks in the /usr/lib directory point (absolutely) to "/lib/libfoo.so",
which ends up being quite invalid when target!=host...
2003-08-23 10:07:25 +00:00
mrg 631719db70 don't want auto-build.h anymore 2003-08-22 00:24:46 +00:00
lukem 14ba3a8126 Add INSTALL_INFO=${TOOL_INSTALL_INFO:Q} to MAKE_ARGS.
Noted by Alan Barrett on current-users@.
2003-08-22 00:12:18 +00:00
mrg 91b707be74 force long long support. use -isystem* for CCADDFLAGS 2003-08-21 23:53:12 +00:00
jmc d9556f9ecc Fix 2 remaining places items are depending on execute permissions coming out
from a cvs checkout on scripts.
2003-08-11 19:26:04 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
mrg e222fd4230 we need config.h an another version of gthr-default.h 2003-08-01 02:44:55 +00:00
mrg be15669373 fix a typo in previous 2003-07-30 05:10:06 +00:00
mrg ad744ff2f6 libiberty/config.h needs to become per-arch. 2003-07-30 05:06:28 +00:00
fredb b92132145c Must add "configure.lineno" to CLEANFILES after updating to autoconf 2.57. 2003-07-29 19:25:02 +00:00
mrg 78ef677a68 pass --enable-threads to ./configure 2003-07-29 06:48:14 +00:00
mrg 1372911937 fix a bug in previous - two $'s are bad 2003-07-28 02:35:43 +00:00
mrg 4ae0f1a6cb add another transform for libobjc3 2003-07-28 01:29:01 +00:00
mrg 6c4963a6f9 document how to generate GCC3.3 bootstrap info with mknative 2003-07-27 15:00:52 +00:00
mrg efee205c6f don't configure with multilibs when doing mknative 2003-07-27 14:44:00 +00:00
lukem deeae012af If HAVE_SYS_ENDIAN_H, pull in <sys/endian.h>. Fixes build.sh on FreeBSD 5.1.
Fix from Grant Beattie <grant@>
2003-07-27 07:56:37 +00:00
salo 22a0ae4298 netbsd.org->NetBSD.org 2003-07-26 20:17:31 +00:00
mrg 6c17918185 - build "binutils" and "gcc" separately if USE_TOOLS_TOOLCHAIN is not set
to "yes".
- adjust dbsym/mdsetimage to look in the correct place for libbfd.
- new mknative-gcc based in toolchain/mknative
2003-07-25 16:26:51 +00:00