termux-packages/packages/electric-fence/Makefile.patch

66 lines
1.9 KiB
Diff
Raw Normal View History

2022-03-11 13:01:24 +01:00
--- ./Makefile.orig 2021-11-12 18:58:14.000000000 +0000
+++ ./Makefile 2022-03-11 12:00:02.007006320 +0000
@@ -1,19 +1,15 @@
2020-07-24 15:07:13 +02:00
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS=-O0 -fno-builtin-malloc -g -Wall -DUSE_SEMAPHORE -fPIC
-else
- CFLAGS=-O2 -fno-builtin-malloc -g -Wall -DUSE_SEMAPHORE -fPIC
-endif
+CFLAGS+= -fno-builtin-malloc -g -Wall -D_GNU_SOURCE -DUSE_SEMAPHORE -fPIC
2020-07-21 05:33:53 +02:00
LIBS= -lpthread
2022-03-11 13:01:24 +01:00
-prefix=$(DESTDIR)/usr
+prefix?=$(DESTDIR)/usr
2020-07-21 05:33:53 +02:00
BIN_INSTALL_DIR= $(prefix)/bin
LIB_INSTALL_DIR= $(prefix)/lib
2022-03-11 13:01:24 +01:00
MAN_INSTALL_DIR= $(prefix)/share/man/man3
2020-07-21 05:33:53 +02:00
2020-07-24 15:07:13 +02:00
-CC= cc
-AR= ar
2022-03-11 13:01:24 +01:00
+CC?= cc
+AR?= ar
2020-07-24 15:07:13 +02:00
INSTALL= install
PACKAGE_SOURCE= README efence.3 Makefile efence.h \
2022-03-11 13:01:24 +01:00
@@ -21,18 +17,10 @@
2020-07-24 15:07:13 +02:00
OBJECTS= efence.o page.o print.o
-all: libefence.a libefence.so.0.0 tstheap eftest
- @ echo
- @ echo "Testing Electric Fence."
- @ echo "After the last test, it should print that the test has PASSED."
- ./eftest
- ./tstheap 3072
- @ echo
- @ echo "Electric Fence confidence test PASSED."
- @ echo
+all: libefence.a libefence.so.0.0
2020-07-21 05:33:53 +02:00
install: libefence.a libefence.3 libefence.so.0.0
2022-03-11 13:01:24 +01:00
-# $(INSTALL) -m 755 ef.sh $(BIN_INSTALL_DIR)/ef
2020-07-21 05:33:53 +02:00
+ $(INSTALL) -m 755 $(TERMUX_PKG_BUILDER_DIR)/ef.sh $(BIN_INSTALL_DIR)/ef
2022-03-11 13:01:24 +01:00
mkdir -p $(LIB_INSTALL_DIR)
$(INSTALL) -m 644 libefence.a $(LIB_INSTALL_DIR)/
$(INSTALL) -m 755 libefence.so.0.0 $(LIB_INSTALL_DIR)/
@@ -41,7 +29,7 @@
2020-07-21 05:33:53 +02:00
- rm -f $(LIB_INSTALL_DIR)/libefence.so
2022-03-11 13:01:24 +01:00
ln -s libefence.so.0 $(LIB_INSTALL_DIR)/libefence.so
mkdir -p $(MAN_INSTALL_DIR)
- $(INSTALL) -m 644 libefence.3 $(MAN_INSTALL_DIR)/libefence.3
2020-07-21 05:33:53 +02:00
+ $(INSTALL) -Dm 644 libefence.3 $(MAN_INSTALL_DIR)/libefence.3
clean:
- rm -f $(OBJECTS) tstheap.o eftest.o tstheap eftest \
2022-03-11 13:01:24 +01:00
@@ -63,7 +51,7 @@
2020-07-24 15:07:13 +02:00
libefence.so.0.0: $(OBJECTS)
$(CC) -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
- $(CFLAGS) $(OBJECTS) -lpthread -lc
+ $(CFLAGS) $(OBJECTS) $(LDFLAGS) -lc
tstheap: libefence.a tstheap.o
- rm -f tstheap