Don't use a patch w/in /usr/src. Programmatically change files when needed.

This commit is contained in:
David E. O'Brien 2005-05-17 17:46:29 +00:00
parent 0164489c96
commit 311d73f68e
3 changed files with 15 additions and 26 deletions

View File

@ -135,24 +135,23 @@ SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c
# decompression functionality from libz
.PATH: ${.CURDIR}/../libz
CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
SRCS+= adler32.c crc32.c _infback.c _inffast.c _inflate.c \
_inftrees.c _zutil.c _zutil.h
# aargh
.for file in zutil.h
CLEANFILES+= _${file} _${file}.orig
_${file}: ${file} ${file}.diff
patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
.endfor
SRCS+= adler32.c crc32.c libstand_zutil.h
.for file in infback.c inffast.c inflate.c inftrees.c zutil.c
SRCS+= _${file}
CLEANFILES+= _${file}
_${file}: ${file}
sed "s|zutil\.h|_zutil.h|" ${.ALLSRC} > ${.TARGET}
sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
.endfor
# depend on stand.h being able to be included multiple times
libstand_zutil.h: ${.CURDIR}/../libz/zutil.h
sed -e 's|<stddef.h>|"stand.h"|' \
-e 's|<string.h>|"stand.h"|' \
-e 's|<stdlib.h>|"stand.h"|' \
${.ALLSRC} > ${.TARGET}
# 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

View File

@ -62,6 +62,9 @@
* @(#)stand.h 8.1 (Berkeley) 6/11/93
*/
#ifndef STAND_H
#define STAND_H
#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/stat.h>
@ -408,3 +411,5 @@ void Free(void *, const char *, int);
#define free(x) Free(x, NULL, 0)
#define realloc(x, y) Realloc(x, y, NULL, 0)
#endif
#endif /* STAND_H */

View File

@ -1,15 +0,0 @@
$FreeBSD$
--- zutil.h Fri Jun 28 23:58:21 2002
+++ zutil.h Fri Jun 28 23:56:24 2002
@@ -15,11 +15,7 @@
#include "zlib.h"
-#ifdef STDC
-# include <stddef.h>
-# include <string.h>
-# include <stdlib.h>
-#endif
+#include "stand.h"
#ifdef NO_ERRNO_H
extern int errno;