summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2005-05-17 17:46:29 +0000
committerobrien <obrien@FreeBSD.org>2005-05-17 17:46:29 +0000
commitc856e4db22f5d9eccd0c696168d49ea7de6d6141 (patch)
treea3dc8c72e4de1473a7135b3e3dadb3583b6ca8b8 /lib/libstand
parent86733f6df73da158f8f50db48bcf9ae360a8215c (diff)
downloadFreeBSD-src-c856e4db22f5d9eccd0c696168d49ea7de6d6141.zip
FreeBSD-src-c856e4db22f5d9eccd0c696168d49ea7de6d6141.tar.gz
Don't use a patch w/in /usr/src. Programmatically change files when needed.
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/Makefile21
-rw-r--r--lib/libstand/stand.h5
-rw-r--r--lib/libstand/zutil.h.diff15
3 files changed, 15 insertions, 26 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 594a948..d18c5a8 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -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
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index eba6a0c..2279bc7 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -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 */
diff --git a/lib/libstand/zutil.h.diff b/lib/libstand/zutil.h.diff
deleted file mode 100644
index 0d8193f..0000000
--- a/lib/libstand/zutil.h.diff
+++ /dev/null
@@ -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;
OpenPOWER on IntegriCloud