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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
$NetBSD: patch-aa,v 1.6 2005/09/18 13:51:09 taca Exp $
--- Makefile.orig 2005-09-06 14:59:53.000000000 +0900
+++ Makefile
@@ -21,6 +21,7 @@ CC_linux = gcc -pthread
CC_linux64 = $(CC_linux) -m64
CC_solaris = gcc
CC_freebsd = gcc -pthread
+CC_netbsd = cc
CC_tru64 = cc
CC_irix = cc -n32 -woff 1110
CC_hpux = cc -Ae +DAportable
@@ -31,7 +32,7 @@ CC = $(CC_$(OS))
# Optimise/debug compilation
#OPTIM = -Wall -g
-OPTIM = -Wall -O3
+OPTIM = -Wall
# Location of gmp include and library
#
@@ -46,19 +47,19 @@ OPTIM = -Wall -O3
# BFINC = /usr/include/openssl
# BFLIB = -lcrypto
-BFINC = -I../blowfish-0.9.5a
-BFLIB = ../blowfish-0.9.5a/libblowfish.a
+BFINC =
+BFLIB =
# Location of zlib include and library
-ZINC = -I../zlib-1.2.3
-ZLIB = ../zlib-1.2.3/libz.a
+ZINC =
+ZLIB =
# Location of bzlib include and library
# Set these empty if you don't want bzib2 support
-BZINC = -I../bzip2-1.0.3
-BZLIB = ../bzip2-1.0.3/libbz2.a
+BZINC =
+BZLIB =
#
# Tools needed for Perl "POD"-format documentation conversion.
@@ -74,9 +75,9 @@ POD2MAN = $(PERL) -S pod2man$(BAT_$(OS))
# Installation directories for the Linux/Solaris/*NIX World
-ROOTDIR = /usr
+ROOTDIR =$(LOCALBASE)
BINDIR = $(ROOTDIR)/bin
-ZBDDIR = $(ROOTDIR)/lib/zebedee
+ZBDDIR = $(ROOTDIR)/share/doc/zebedee
MANDIR = $(ROOTDIR)/man/man1
# This is a BSD-style install
@@ -87,6 +88,7 @@ INSTALL_linux = install -c
INSTALL_linux64 = $(INSTALL_linux)
INSTALL_solaris = /usr/ucb/install -c
INSTALL_freebsd = install -c
+INSTALL_netbsd = install -c
INSTALL_tru64 = installbsd -c
INSTALL_irix = install -c
INSTALL_hpux = install -c
@@ -148,12 +150,13 @@ DEFINES_linux = -DHAVE_PTHREADS
DEFINES_linux64 = $(DEFINES_linux)
DEFINES_solaris = -D_REENTRANT -DHAVE_PTHREADS
DEFINES_freebsd = -DHAVE_PTHREADS -DBUGGY_FORK_WITH_THREADS
+DEFINES_netbsd =
DEFINES_tru64 = -D_REENTRANT -DHAVE_PTHREADS
DEFINES_irix = -D_REENTRANT -DHAVE_PTHREADS -Dinline=
DEFINES_hpux = -D_REENTRANT -DHAVE_PTHREADS -DDONT_HAVE_SELECT_H -Dinline=
DEFINES_macosx = -D_REENTRANT -DHAVE_PTHREADS -DTHREAD_STACK_SIZE=49152
DEFINES_bsdi =
-DEFINES = $(DEFINES_$(OS))
+DEFINES = $(DEFINES_$(OS)) $(PTHREAD_CFLAGS)
# Suffix for executables
@@ -167,6 +170,7 @@ OSLIBS_linux = -lpthread
OSLIBS_linux64 = $(OSLIBS_linux)
OSLIBS_solaris = -lsocket -lnsl -lthread
OSLIBS_freebsd =
+OSLIBS_netbsd = -lcrypto -lbz2 -lz
OSLIBS_tru64 = -lpthread
OSLIBS_irix = -lpthread
OSLIBS_hpux = -lpthread -lnsl
@@ -186,9 +190,10 @@ SERVICEOBJ = $(SERVICEOBJ_$(OS))
#### You REALLY shouldn't have to modify anything beyond here ...
####
-CFLAGS = $(OPTIM) $(DEFINES) -I. $(GMPINC) $(BFINC) $(ZINC) $(BZINC)
+CFLAGS += $(OPTIM) $(DEFINES) -I. $(GMPINC) $(BFINC) $(ZINC) $(BZINC)
-LIBS = $(GMPLIB) $(BFLIB) $(ZLIB) $(BZLIB) $(OSLIBS)
+LDFLAGS= $(PTHREAD_LDFLAGS)
+LIBS = $(GMPLIB) $(BFLIB) $(ZLIB) $(BZLIB) $(OSLIBS) $(PTHREAD_LIBS)
OBJS = zebedee.o sha_func.o huge.o $(GETOPTOBJ) $(SERVICEOBJ)
@@ -196,17 +201,17 @@ ZBDFILES = server.zbd vncviewer.zbd vncs
client1.key client2.key clients.id
TXTFILES = README.txt LICENCE.txt GPL2.txt CHANGES.txt NOTICE.txt \
- zebedee.html ftpgw.tcl.html zebedee.ja_JP.html zebedee.iss
+ zebedee.html ftpgw.tcl.html zebedee.ja_JP.html
EXTRAFILES = $(ZBDFILES) $(TXTFILES)
all : precheck zebedee$(EXE) zebedee.1 zebedee.html ftpgw.tcl.1 ftpgw.tcl.html zebedee.ja_JP.html
precheck :
- @ if test -z "$(OS)"; then echo "Use '$(MAKE) OS=xxx' where xxx is win32, linux, linux64, solaris, freebsd, tru64, irix, hpux, macosx or bsdi"; exit 1; fi
+ @ if test -z "$(OS)"; then echo "Use '$(MAKE) OS=xxx' where xxx is win32, linux, linux64, solaris, freebsd, netbsd, openbsd, tru64, irix, hpux, macosx or bsdi"; exit 1; fi
zebedee$(EXE) : $(OBJS)
- $(CC) $(CFLAGS) -o zebedee$(EXE) $(OBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o zebedee$(EXE) $(OBJS) $(LIBS)
huge.o : huge.h
@@ -236,12 +241,12 @@ ftpgw.tcl.html : ftpgw.tcl.pod
install : precheck zebedee$(EXE) zebedee.1 ftpgw.tcl.1 $(ZBDFILES) $(TXTFILES)
-mkdir -p $(BINDIR) $(MANDIR) $(ZBDDIR)
- $(INSTALL) zebedee$(EXE) $(BINDIR)
+ $(INSTALL) -s -m 755 zebedee$(EXE) $(BINDIR)
$(INSTALL) -m 0755 ftpgw.tcl $(BINDIR)
- $(INSTALL) zebedee.1 $(MANDIR)
- $(INSTALL) ftpgw.tcl.1 $(MANDIR)
- $(INSTALL) $(ZBDFILES) $(ZBDDIR)
- $(INSTALL) $(TXTFILES) $(ZBDDIR)
+ $(INSTALL) -m 0444 zebedee.1 $(MANDIR)
+ $(INSTALL) -m 0444 ftpgw.tcl.1 $(MANDIR)
+ $(INSTALL) -m 0444 $(ZBDFILES) $(ZBDDIR)
+ $(INSTALL) -m 0444 $(TXTFILES) $(ZBDDIR)
clean :
rm -f zebedee zebedee.exe *.o core *.1 *.html *.tmp *.bak
|