ports/devel/libowfat/files/patch-GNUmakefile
David Thiel aa8bfe7147 Update to 0.31, fixing some security issues.
PR:		217063
Reported by:	Jan Bramkamp
MFH:		2017Q1
Security:	Integer overflow checking and string formatting error
2017-02-13 20:15:36 +00:00

69 lines
2 KiB
Text

--- GNUmakefile.orig 2016-10-01 16:07:35.000000000 -0700
+++ GNUmakefile 2017-02-13 11:05:04.236623000 -0800
@@ -4,10 +4,10 @@
# in /opt/diet, where they are in the default search path for my diet libc
# work but don't conflict with anything there. YMMV.
-prefix=/opt/diet
+prefix=STAGEDIR${PREFIX}
LIBDIR=${prefix}/lib
-INCLUDEDIR=${prefix}/include
-MAN3DIR=${prefix}/man/man3
+INCLUDEDIR=${prefix}/include/libowfat
+MAN3DIR=STAGEDIR${MANPREFIX}/man/man3
LIBS=byte.a fmt.a scan.a str.a uint.a open.a stralloc.a unix.a socket.a \
buffer.a mmap.a taia.a tai.a dns.a case.a mult.a array.a io.a \
@@ -15,26 +15,14 @@
all: ent $(LIBS) libowfat.a libsocket t
-CROSS=
-#CROSS=i686-mingw-
-CC=gcc
-CCC=$(CROSS)$(CC)
+CCC=${CC}
WERROR=
WARN=-W -Wall -Wextra $(WERROR)
-# Use the second version if you are building for a binary that is only
-# supposed to run on this machine. It tells gcc to use CPU instructions
-# that are specific to the CPU the code is compiled on.
-NATIVE=
-#NATIVE=-march=native -mtune=native
-
-OPT_REG=-O2
-OPT_PLUS=-O3 $(NATIVE)
-
DEFINE=-D_REENTRANT
-CFLAGS=-pipe $(WARN) $(DEFINE) $(OPT_REG)
-CFLAGS_OPT=-pipe $(WARN) $(DEFINE) $(OPT_PLUS)
+CFLAGS+=-pipe $(WARN) $(DEFINE)
+CFLAGS_OPT=$(CFLAGS)
#CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
@@ -205,16 +193,16 @@
compiletimeassert.h critbit.h
install-inc:
- install -d $(DESTDIR)$(INCLUDEDIR)
- install -m 644 $(INCLUDES) $(DESTDIR)$(INCLUDEDIR)
+ ${INSTALL} -d $(INCLUDEDIR)
+ ${BSD_INSTALL_DATA} -m 644 $(INCLUDES) $(INCLUDEDIR)
install-lib: libowfat.a
- install -d $(DESTDIR)$(LIBDIR)
- install -m 644 libowfat.a $(DESTDIR)$(LIBDIR)
+ ${INSTALL} -d $(LIBDIR)
+ ${BSD_INSTALL_DATA} -m 644 libowfat.a $(LIBDIR)
install-man:
- install -d $(DESTDIR)$(MAN3DIR)
- install -m 644 $(wildcard */*.3) $(DESTDIR)$(MAN3DIR)
+ ${INSTALL} -d $(MAN3DIR)
+ ${BSD_INSTALL_MAN} -m 644 $(wildcard */*.3) $(MAN3DIR)
install: install-inc install-man install-lib