--- Makefile.orig	2005-09-06 05:59:53 UTC
+++ Makefile
@@ -5,7 +5,7 @@
 
 ZBD_VERSION = 2.5.3
 
-OS = 
+OS = freebsd
 
 ###
 ### Locations of tools, libraries and installation directories.
@@ -14,13 +14,11 @@ OS = 
 
 # Choose your C compiler
 
-CC_$(OS) = gcc
-
 CC_win32 = gcc -mno-cygwin
 CC_linux = gcc -pthread
 CC_linux64 = $(CC_linux) -m64
 CC_solaris = gcc
-CC_freebsd = gcc -pthread
+CC_freebsd ?= gcc
 CC_tru64 = cc
 CC_irix = cc -n32 -woff 1110
 CC_hpux = cc -Ae +DAportable
@@ -31,7 +29,7 @@ CC = $(CC_$(OS))
 # Optimise/debug compilation
 
 #OPTIM = -Wall -g
-OPTIM = -Wall -O3
+OPTIM = -Wall
 
 # Location of gmp include and library
 #
@@ -46,25 +44,26 @@ OPTIM = -Wall -O3
 # BFINC = /usr/include/openssl
 # BFLIB = -lcrypto
 
-BFINC = -I../blowfish-0.9.5a
-BFLIB = ../blowfish-0.9.5a/libblowfish.a
+BFINC = -I$(OPENSSLINC) -I$(OPENSSLINC)/openssl
+BFLIB = $(OPENSSLLIB)/libcrypto.a
 
 # Location of zlib include and library
 
-ZINC = -I../zlib-1.2.3
-ZLIB = ../zlib-1.2.3/libz.a
+ZINC = 
+ZLIB = -lz
 
 # 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 = -I$(LOCALBASE)/include
+BZLIB = -L$(LOCALBASE)/lib -lbz2
 
 #
 # Tools needed for Perl "POD"-format documentation conversion.
 #
 PERL_$(OS) = perl
 PERL_win32 = c:/perl/bin/perl	# Avoid Cygwin port
+PERL_freebsd = perl
 PERL = $(PERL_$(OS))
 
 BAT_win32 = .bat
@@ -186,7 +185,8 @@ SERVICEOBJ = $(SERVICEOBJ_$(OS))
 #### You REALLY shouldn't have to modify anything beyond here ...
 ####
 
-CFLAGS = $(OPTIM) $(DEFINES) -I. $(GMPINC) $(BFINC) $(ZINC) $(BZINC)
+CFLAGS ?= -03
+CFLAGS += $(OPTIM) $(DEFINES) -I. $(GMPINC) $(BFINC) $(ZINC) $(BZINC)
 
 LIBS = $(GMPLIB) $(BFLIB) $(ZLIB) $(BZLIB) $(OSLIBS)
 
@@ -196,17 +196,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.iss
 
 EXTRAFILES = $(ZBDFILES) $(TXTFILES)
 
-all : precheck zebedee$(EXE) zebedee.1 zebedee.html ftpgw.tcl.1 ftpgw.tcl.html zebedee.ja_JP.html
+all : precheck zebedee$(EXE) zebedee.1 zebedee.html ftpgw.tcl.1 ftpgw.tcl.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
 
 zebedee$(EXE) : $(OBJS)
-	$(CC) $(CFLAGS) -o zebedee$(EXE) $(OBJS) $(LIBS)
+	$(CC) $(CFLAGS) -o zebedee$(EXE) $(OBJS) $(LIBS) -lpthread
 
 huge.o : huge.h
 
