1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
--- Makefile.orig 1999-04-13 17:22:49 UTC
+++ Makefile
@@ -1,8 +1,14 @@
PIC= -fPIC
-CFLAGS= -g -DUSE_SEMAPHORE $(PIC)
-LIBS= -lpthread
+#CFLAGS= -g -DUSE_SEMAPHORE $(PIC)
+CFLAGS+= -g $(PIC)
+.if ${MACHINE_ARCH} == "sparc64"
+CFLAGS+= -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
+.endif
+#CFLAGS+= -pthread
+# for FreeBSD comment out the below as this is not how we do pthreads.
+#LIB_PTHREADS= -lpthread -lc
-prefix=/usr
+prefix=$(PREFIX)
BIN_INSTALL_DIR= $(prefix)/bin
LIB_INSTALL_DIR= $(prefix)/lib
MAN_INSTALL_DIR= $(prefix)/man/man3
@@ -17,14 +23,18 @@ PACKAGE_SOURCE= README efence.3 Makefile efence.h \
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
+# This test is not run. Breaks on pointyhat because the host
+# delivers a different "page-protection-violated" signal to what
+# is expected by the port running inside a lower-version jail.
+# (ie. in 6.x jail it expects SIGBUS, 7.x host delivers SIGSEGV).
+# @ echo
+# @ echo "Testing Electric Fence."
+# @ echo "After the last test, it should print that the test has PASSED."
+# EF_PROTECT_BELOW= && EF_PROTECT_FREE= && EF_ALIGNMENT= && ./eftest
+# ./tstheap 3072
+# @ echo
+# @ echo "Electric Fence confidence test PASSED."
+# @ echo
install: libefence.a efence.3 libefence.so.0.0
$(INSTALL) -m 755 ef.sh $(BIN_INSTALL_DIR)/ef
@@ -54,16 +64,16 @@ libefence.a: $(OBJECTS)
$(AR) crv libefence.a $(OBJECTS)
libefence.so.0.0: $(OBJECTS)
- gcc -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
- $(OBJECTS) -lpthread -lc
+ $(CC) $(CFLAGS) -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
+ $(OBJECTS) $(LIB_PTHREADS)
tstheap: libefence.a tstheap.o
- rm -f tstheap
- $(CC) $(CFLAGS) tstheap.o libefence.a -o tstheap $(LIBS)
+ $(CC) $(CFLAGS) tstheap.o libefence.a -o tstheap $(LIB_PTHREADS)
eftest: libefence.a eftest.o
- rm -f eftest
- $(CC) $(CFLAGS) eftest.o libefence.a -o eftest $(LIBS)
+ $(CC) $(CFLAGS) eftest.o libefence.a -o eftest $(LIB_PTHREADS)
$(OBJECTS) tstheap.o eftest.o: efence.h
|