Commit Graph

108 Commits

Author SHA1 Message Date
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
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
dbj 8547b2b628 note successful build on Mac OS 10.3 with xcode 1.0 developer tools 2003-11-17 05:42:58 +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
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 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
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
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
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
fredb b92132145c Must add "configure.lineno" to CLEANFILES after updating to autoconf 2.57. 2003-07-29 19:25:02 +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
atatat cdea39b56a Regen for host-tool-ified stat 2003-07-25 03:22:39 +00:00
atatat d5fb781871 More properly host-tool-ify stat 2003-07-25 03:21:15 +00:00
fredb 93dcb2eb39 Regenerate with autoconf 2.57. 2003-07-18 13:51:44 +00:00
fredb c0326dd8e8 As discussed briefly on tech-toolchain, AIX doesn't have "u_long",
so add a check for that. Partial fix for PR toolchain/22177.
2003-07-18 13:45:15 +00:00
uwe 0bbb587407 Add atoll(3) to libnbcompat. We need it when building target's gcc
for a 64-bit target on a 32-bit host.

NB: There seems to be a bug in either gcc itself or the way we import
it, b/c the incorrect #define HAVE_ATOLL is picked from (e.g. for
sparc64) gnu/usr.bin/gcc/arch/sparc64/auto-host.h - so when gen*
auxilary (host) programs are built in gnu/usr.bin/gcc/backend, they
incorrectly pick-up target's HAVE_ATOLL.

For now providing atoll(3) in libnbcompat is a simple and sufficient
workaround.
2003-06-03 03:16:48 +00:00
dbj 41b9cfff20 use reachover relative paths in compat include files instead of
symlinking ufs include files into installboot and makefs tool objdirs
reviewed by lukem and thorpej on tech-toolchain
2003-05-14 00:30:26 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
pooka cfb2c17888 FreeBSD #defines putc_unlocked in stdio.h, so guard against that also 2003-03-21 14:40:26 +00:00
grant fc135e74ba if target is not a symlink, silently succeed rather than failing with
EINVAL.

on systems which don't have lch{flags,own,mod}, flags, ownership and
modes of symlinks is meaningless, anyway.

ok'd by christos.
2003-03-19 09:26:38 +00:00
thorpej 241ed6a4c1 Add a putc_unlocked(). 2003-03-14 03:38:42 +00:00
thorpej 1d994487b3 Fix the socklen_t test; we need to explcitly list the headers we want
included for that test.
2003-03-13 16:27:03 +00:00
thorpej 3550b00b45 Move -no-cpp-precomp logic to defs.mk. 2003-03-13 05:15:49 +00:00
thorpej 8b1707fd43 Disable pre-compiled headers on Darwin. 2003-03-13 05:00:28 +00:00
thorpej 72ec5d6a9c Check for sys/socket.h and socklen_t. 2003-03-13 04:30:39 +00:00
uwe 4eb408dcd9 Avoid cgetcap &co prototypes conflicting with those provided by the host.
With this change we can cross-compile on FreeBSD 4.x.
2003-01-31 20:50:29 +00:00
uwe af823cea6c Provide __SCCSID() needed by pwd_mkdb. 2003-01-27 01:17:47 +00:00
thorpej 7059a54da4 Include <sys/types.h> before <grp.h>; Mac OS 10.2.2 needs this. 2002-12-16 00:35:00 +00:00
thorpej bd339b41ac Include <sys/types.h> before including <dirent.h>; Mac OS 10.2.2
needs this.
2002-12-16 00:31:59 +00:00
lukem 90af8ac79d Tweak dependencies so that defs.mk depends upon config.cache, and
config.cache depends upon 'include/.stamp configure config.h.in defs.mk.in'
and runs configure.  Forcebly remove config.cache before running configure.

This change means that config.cache is (still) retained between "make clean"
(but not "make cleandir") runs, but is flushed if configure or config.h.in
is changed, as the cache may contain incorrect information in that case.
2002-12-04 23:27:54 +00:00
lukem c6f399207c add check back for util.h; needed on some foreign systems 2002-11-30 21:43:27 +00:00
lukem b1e79510cf - Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).
2002-11-30 03:04:44 +00:00
lukem 336730e201 replace missing strsuftoll(3) 2002-11-29 13:00:22 +00:00
christos 1391513680 PR/18733: Jed Davis: define _PATH_DEFTAPE; pax needs it. 2002-10-20 00:42:20 +00:00
lukem dba0caccee Implement replacements for lchflags(), lchmod(), and lchown(),
which first lstat(2) the target and return EINVAL if it's a symlink,
and then call ch{flags,mod,own} as appropriate.
Removes the need for hokey code inside the tools themselves...
2002-10-08 00:28:36 +00:00
briggs 4fb03019c2 Just check for poll.h, don't fail if it's not present. 2002-10-07 18:12:36 +00:00
lukem 8b42f7b9d9 Provide strtoll() in libnbcompat.
Should fix relevant build issue on HP-UX and MacOS X hosts.
2002-10-06 12:09:34 +00:00
lukem c61581112f complete check for lchflags 2002-10-06 01:25:58 +00:00
lukem cb48eb573f check for lchflags 2002-10-05 04:13:30 +00:00
thorpej bcb4b867fe Check for <poll.h> and poll(2). 2002-10-04 22:10:10 +00:00
lukem b9472f8280 Fix from Giles Lean:
HP-UX has MAP_ANONYMOUS but not MAP_ANON
2002-09-30 00:39:21 +00:00
lukem 6a507832d7 It's "HP-UX" not "HP/UX". (Thanks Giles). 2002-09-29 07:05:28 +00:00
lukem ab956106b3 preliminary HP/UX notes from Giles; it needs zlib.
(as Solaris, Linux and HP/UX all mention they need zlib and it should
be part of libnbcompat, maybe this is a hint for us to get a move on
and do that :)
2002-09-22 01:26:39 +00:00
briggs 482480a39e Note that RedHat 7.3 hosts successfully as of today with the caveat that
LANG=C must be in the environment.
2002-09-16 18:13:04 +00:00