head	1.5;
access;
symbols
	RELENG_9_1_0_RELEASE:1.1.2.2.2.2
	RELENG_9_1:1.1.2.2.0.2
	RELENG_9_1_BP:1.1.2.2
	RELENG_9_0_0_RELEASE:1.1.2.1.2.1
	RELENG_9_0:1.1.2.1.0.2
	RELENG_9_0_BP:1.1.2.1
	RELENG_9:1.1.0.2
	RELENG_9_BP:1.1;
locks; strict;
comment	@# @;


1.5
date	2012.12.21.15.18.57;	author svnexp;	state Exp;
branches;
next	1.4;

1.4
date	2012.11.17.01.51.20;	author svnexp;	state Exp;
branches;
next	1.3;

1.3
date	2012.06.21.21.47.08;	author delphij;	state Exp;
branches;
next	1.2;

1.2
date	2012.01.03.07.14.01;	author ed;	state Exp;
branches;
next	1.1;

1.1
date	2011.06.30.16.08.56;	author dfr;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.1.2.1.2.1;
next	1.1.2.2;

1.1.2.2
date	2012.06.28.07.08.48;	author delphij;	state Exp;
branches
	1.1.2.2.2.1;
next	1.1.2.3;

1.1.2.3
date	2012.11.17.11.36.48;	author svnexp;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2013.10.10.13.01.43;	author svnexp;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2013.12.30.21.01.46;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.1.2.1.2.2;

1.1.2.1.2.2
date	2012.11.17.08.36.47;	author svnexp;	state Exp;
branches;
next	;

1.1.2.2.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.1.2.2.2.2;

1.1.2.2.2.2
date	2012.11.17.08.47.37;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.5
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244537
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@# $FreeBSD: head/sys/boot/userboot/libstand/Makefile 244537 2012-12-21 15:15:35Z rpaulo $
# Originally from	$NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
#
# Notes:
# - We don't use the libc strerror/sys_errlist because the string table is
#   quite large.
#

WITHOUT_SSP=
NO_MAN=

.include <bsd.own.mk>

S=		${.CURDIR}/../../../../lib/libstand

.PATH:		${S}
LIB=		stand
INTERNALLIB=
NO_PROFILE=
NO_PIC=

WARNS?=		0

CFLAGS+= -ffreestanding -Wformat -fPIC
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand

.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
.if ${MACHINE_CPUARCH} == "i386"
CFLAGS+=	-mpreferred-stack-boundary=2
CFLAGS+=	-mno-sse3
.endif
.if ${MACHINE} == "pc98"
CFLAGS+=	-Os
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+=	-msoft-float -D_STANDALONE -DNETIF_DEBUG
.endif
.if ${MACHINE_CPUARCH} == "arm"
CFLAGS+=	-msoft-float -D_STANDALONE
.endif

# standalone components and stuff we have modified locally
SRCS+=	gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
	globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
	sbrk.c twiddle.c zalloc.c zalloc_malloc.c

# private (pruned) versions of libc string functions
SRCS+=	strcasecmp.c

LIBC=	${.CURDIR}/../../../../lib/libc

.PATH: ${LIBC}/net

SRCS+= ntoh.c

# string functions from libc
.PATH: ${LIBC}/string
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \
	${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \
	${MACHINE_CPUARCH} == "arm"
SRCS+=	bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
	memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
	strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
	strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.endif
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${LIBC}/arm/gen
SRCS+= divsi3.S
.endif
.if ${MACHINE_CPUARCH} == "ia64"
.PATH: ${LIBC}/ia64/string
SRCS+=	bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
	memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
	strcmp.c strcpy.c strcspn.c strlen.c \
	strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
	strspn.c strstr.c strtok.c swab.c

.PATH: ${LIBC}/ia64/gen
SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
.PATH: ${LIBC}/libc/quad
SRCS+=	ashldi3.c ashrdi3.c
.PATH: ${LIBC}/powerpc/gen
SRCS+=	syncicache.c
.endif

# uuid functions from libc
.PATH: ${LIBC}/uuid
SRCS+= uuid_equal.c uuid_is_nil.c

# _setjmp/_longjmp
.if ${MACHINE_CPUARCH} == "amd64"
.PATH: ${S}/amd64
.elif ${MACHINE_ARCH} == "powerpc64"
.PATH: ${S}/powerpc
.else
.PATH: ${S}/${MACHINE_CPUARCH}
.endif
SRCS+=	_setjmp.S

# decompression functionality from libbz2
# NOTE: to actually test this functionality after libbz2 upgrade compile
# loader(8) with LOADER_BZIP2_SUPPORT defined
.PATH: ${.CURDIR}/../../../../contrib/bzip2
CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
SRCS+=	libstand_bzlib_private.h

.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
SRCS+=	_${file}
CLEANFILES+=	_${file}

_${file}: ${file}
	sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
.endfor

CLEANFILES+= libstand_bzlib_private.h
libstand_bzlib_private.h: bzlib_private.h
	sed -e 's|<stdlib.h>|"stand.h"|' \
		${.ALLSRC} > ${.TARGET}

# decompression functionality from libz
.PATH: ${.CURDIR}/../../../../lib/libz
CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../../../../lib/libz
SRCS+=	adler32.c crc32.c libstand_zutil.h libstand_gzguts.h

.for file in infback.c inffast.c inflate.c inftrees.c zutil.c
SRCS+=	_${file}
CLEANFILES+=	_${file}

_${file}: ${file}
	sed -e "s|zutil\.h|libstand_zutil.h|" \
	    -e "s|gzguts\.h|libstand_gzguts.h|" ${.ALLSRC} > ${.TARGET}
.endfor

# depend on stand.h being able to be included multiple times
.for file in zutil.h gzguts.h
CLEANFILES+= libstand_${file}
libstand_${file}: ${file}
	sed -e 's|<fcntl.h>|"stand.h"|' \
	    -e 's|<stddef.h>|"stand.h"|' \
	    -e 's|<string.h>|"stand.h"|' \
	    -e 's|<stdio.h>|"stand.h"|' \
	    -e 's|<stdlib.h>|"stand.h"|' \
	    ${.ALLSRC} > ${.TARGET}
.endfor

# io routines
SRCS+=	closeall.c dev.c ioctl.c nullfs.c stat.c \
	fstat.c close.c lseek.c open.c read.c write.c readdir.c

# network routines
SRCS+=	arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c

# network info services:
SRCS+=	bootp.c rarp.c bootparam.c

# boot filesystems
SRCS+=	ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
SRCS+=	dosfs.c ext2fs.c
SRCS+=	splitfs.c

.include <bsd.lib.mk>
@


1.4
log
@Switching exporter and resync
@
text
@d1 1
a1 1
# $FreeBSD: head/sys/boot/userboot/libstand/Makefile 237410 2012-06-21 21:47:08Z delphij $
d97 1
a97 1
.PATH: ${.CURDIR}/amd64
@


1.3
log
@SVN rev 237410 on 2012-06-21 21:47:08Z by delphij

MFV: Update zlib to 1.2.7.

(x86 assembler optimization disabled for now because it
requires the new .cfi_* directives that is not supported
by base system binutils).

MFC after:	1 week
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.2
log
@SVN rev 229368 on 2012-01-03 07:14:01Z by ed

Merge index() and strchr() together.

As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.

Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.

Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().

This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.
@
text
@d45 1
a45 1
SRCS+=	zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
d128 1
a128 1
SRCS+=	adler32.c crc32.c libstand_zutil.h
d135 2
a136 1
	sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
d140 5
a144 3
CLEANFILES+= libstand_zutil.h
libstand_zutil.h: zutil.h
	sed -e 's|<stddef.h>|"stand.h"|' \
d146 1
d149 1
@


1.1
log
@SVN rev 223695 on 2011-06-30 16:08:56Z by dfr

Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.
@
text
@d63 4
a66 4
SRCS+=	bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
        memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
        strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
	strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
@


1.1.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.1.2.2
log
@SVN rev 237691 on 2012-06-28 07:08:48Z by delphij

MFC r237410: zlib 1.2.7.
@
text
@d45 1
a45 1
SRCS+=	gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
d128 1
a128 1
SRCS+=	adler32.c crc32.c libstand_zutil.h libstand_gzguts.h
d135 1
a135 2
	sed -e "s|zutil\.h|libstand_zutil.h|" \
	    -e "s|gzguts\.h|libstand_gzguts.h|" ${.ALLSRC} > ${.TARGET}
d139 3
a141 5
.for file in zutil.h gzguts.h
CLEANFILES+= libstand_${file}
libstand_${file}: ${file}
	sed -e 's|<fcntl.h>|"stand.h"|' \
	    -e 's|<stddef.h>|"stand.h"|' \
a142 1
	    -e 's|<stdio.h>|"stand.h"|' \
a144 1
.endfor
@


1.1.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/libstand/Makefile 237691 2012-06-28 07:08:48Z delphij $
@


1.1.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/256266
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/libstand/Makefile 256266 2013-10-10 12:46:26Z bdrewery $
d9 1
a12 1
MK_SSP=		no
@


1.1.2.5
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/260096
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/userboot/libstand/Makefile 260096 2013-12-30 20:15:46Z dim $
d31 1
a31 1
CFLAGS.gcc+=	-mpreferred-stack-boundary=2
@


1.1.2.2.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.1.2.2.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/sys/boot/userboot/libstand/Makefile 237691 2012-06-28 07:08:48Z delphij $
@


1.1.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.1.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/sys/boot/userboot/libstand/Makefile 223695 2011-06-30 16:08:56Z dfr $
@


