2003-10-27 03:12:41 +03:00
|
|
|
# $NetBSD: Makefile,v 1.28 2003/10/27 00:12:42 lukem Exp $
|
2001-12-12 00:17:56 +03:00
|
|
|
|
|
|
|
HOSTLIB= nbcompat
|
|
|
|
|
2003-06-03 07:16:48 +04:00
|
|
|
SRCS= atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \
|
2002-10-08 04:28:36 +04:00
|
|
|
getmode.c getopt_long.c gettemp.c issetugid.c \
|
|
|
|
lchflags.c lchmod.c lchown.c libyywrap.c \
|
2002-09-14 08:30:27 +04:00
|
|
|
md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c mkdtemp.c \
|
2003-03-14 06:38:42 +03:00
|
|
|
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
|
|
|
|
pw_scan.c rmd160.c rmd160hl.c setenv.c setgroupent.c \
|
|
|
|
setpassent.c setprogname.c sha1.c sha1hl.c snprintf.c \
|
|
|
|
strlcat.c strlcpy.c strmode.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 __fts13.c __glob13.c
|
2002-01-29 13:20:28 +03:00
|
|
|
|
2003-03-13 08:00:28 +03:00
|
|
|
BUILD_OSTYPE!= uname -s
|
|
|
|
|
|
|
|
# Disable use of pre-compiled headers on Darwin.
|
|
|
|
.if ${BUILD_OSTYPE} == "Darwin"
|
|
|
|
CPPFLAGS+= -no-cpp-precomp
|
|
|
|
.endif
|
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
|
|
|
|
# other file ops, on many systems, without changing function names.
|
|
|
|
|
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-29 03:16:11 +04:00
|
|
|
# -D_NETBSD_SOURCE is necessary for some of the NetBSD headers that we
|
|
|
|
# also use on the host system.
|
|
|
|
|
2003-10-27 03:12:41 +03:00
|
|
|
CPPFLAGS+= -I. -I./include -I${.CURDIR} -DHAVE_NBTOOL_CONFIG_H=1 \
|
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-29 03:16:11 +04:00
|
|
|
-D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE
|
2002-01-21 23:04:36 +03:00
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/../../lib/libc/gen \
|
2002-03-31 16:58:54 +04:00
|
|
|
${.CURDIR}/../../lib/libc/hash \
|
|
|
|
${.CURDIR}/../../lib/libc/md \
|
2002-09-14 08:30:27 +04:00
|
|
|
${.CURDIR}/../../lib/libc/stdio \
|
2002-01-29 13:20:28 +03:00
|
|
|
${.CURDIR}/../../lib/libc/stdlib \
|
2002-01-22 02:35:14 +03:00
|
|
|
${.CURDIR}/../../lib/libc/string \
|
2002-02-01 01:43:33 +03:00
|
|
|
${.CURDIR}/../../usr.bin/lex
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2002-01-29 13:20:28 +03:00
|
|
|
DPSRCS+= defs.mk
|
2003-08-01 21:03:41 +04:00
|
|
|
CLEANFILES+= defs.mk
|
|
|
|
CLEANFILES+= config.log config.status configure.lineno confdefs.h *.stamp
|
2002-01-21 23:04:36 +03:00
|
|
|
|
|
|
|
# Get components of Berkeley DB.
|
|
|
|
_CURDIR:= ${.CURDIR}
|
|
|
|
.CURDIR:= ${_CURDIR}/../../lib/libc
|
|
|
|
.include "${.CURDIR}/db/Makefile.inc"
|
|
|
|
.CURDIR:= ${_CURDIR}
|
|
|
|
|
|
|
|
SRCS:= ${SRCS:Nndbm.c}
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2003-10-27 03:12:41 +03:00
|
|
|
config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
|
2002-12-05 02:27:54 +03:00
|
|
|
rm -f ${.TARGET}
|
2002-01-21 23:04:36 +03:00
|
|
|
CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
|
2002-12-05 02:27:54 +03:00
|
|
|
|
|
|
|
defs.mk: config.cache
|
|
|
|
@touch ${.TARGET}
|
2001-12-12 00:17:56 +03:00
|
|
|
|
|
|
|
# Run by hand, then "configure" script committed:
|
|
|
|
regen:
|
|
|
|
cd ${.CURDIR} && ${TOOLDIR}/bin/nbautoconf
|
|
|
|
|
2002-04-19 01:15:08 +04:00
|
|
|
include/.stamp:
|
2002-02-27 01:29:38 +03:00
|
|
|
mkdir -p include/sys include/machine include/rpc
|
2002-12-05 02:27:54 +03:00
|
|
|
@touch ${.TARGET}
|
2002-01-29 13:20:28 +03:00
|
|
|
|
|
|
|
cleandir: compat.clean
|
|
|
|
compat.clean:
|
|
|
|
-rm -r -f include
|
2003-10-27 03:12:41 +03:00
|
|
|
-rm -f config.cache nbtool_config.h
|
2002-01-29 13:20:28 +03:00
|
|
|
|
|
|
|
HOST_CPPFLAGS:= ${CPPFLAGS}
|
|
|
|
CPPFLAGS:= # empty
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
.include <bsd.hostlib.mk>
|