$NetBSD: patch-aa,v 1.7.38.1 2010/01/21 11:59:30 tron Exp $

--- makefile.orig	2001-02-11 03:21:58.000000000 +0000
+++ makefile
@@ -8,11 +8,11 @@ VERSION  = 2.11
 #   besides /usr/bin. The $PREFIX (which defaults to nothing) can be
 #   overridden in the make command line, as in "PREFIX=/foo make install"
 #   (the directory is only used when installing).
-DESTDIR  = $(PREFIX)/usr/bin
+INSTALLDIR  = $(DESTDIR)$(PREFIX)/bin
 
 # Standard flags for all architectures
 CFLAGS	 = -Wall -fomit-frame-pointer -DVERSION=$(VERSION) -DNO_BYTESWAP_H
-LFLAGS	 = -lpthread
+LFLAGS	 = ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}
 
 # Add default flags for Pentium compilations
 ifndef HOST_ARCH
@@ -21,26 +21,28 @@ endif
 
 # Handle host architecture if specified
 ifeq ($(HOST_ARCH),i386)
-CFLAGS	 += -O3 -malign-double -DNO_ASM_BYTESWAP
-endif
+CFLAGS	 += -O3 -DNO_ASM_BYTESWAP
+else
 ifeq ($(HOST_ARCH),i586)
-CFLAGS	 += -O3 -malign-double -march=pentium
-endif
+CFLAGS	 += -O3
+else
 ifeq ($(HOST_ARCH),i686)
-CFLAGS	 += -O3 -malign-double -march=pentiumpro
-endif
+CFLAGS	 += -O3
+else
 ifeq ($(HOST_ARCH),alpha)
 CFLAGS	 += -O2 -DNO_ASM_BYTESWAP
-endif
-ifeq ($(HOST_ARCH),other)
+else
 CFLAGS	 += -O3 -DNO_ASM_BYTESWAP
-endif
+endif  # alpha
+endif  # i686
+endif  # i586
+endif  # i386
 
 # Uncomment these lines for NetBSD, with either the unproven-pthreads
 #   or pth packages
-#CFLAGS  += -I/usr/pkg/pthreads/include -I/usr/pkg/include
-#LFLAGS	 += -L/usr/pkg/pthreads/lib -R/usr/pkg/pthreads
-#LFLAGS	 += -L/usr/pkg/lib -R/usr/pkg/pthreads/lib
+CFLAGS  += -I${PREFIX}/include
+LFLAGS	 += -L${PREFIX}/lib -R${PREFIX}/lib
+LFLAGS	 += -L${PREFIX}/lib
 
 # Reverse the comments below to disable Compressed CKD Dasd support
 #CFLAGS  += -DNO_CCKD
@@ -224,9 +226,9 @@ tar:	clean
 	(cd ..; tar cvzf hercules-$(VERSION).tar.gz hercules-$(VERSION))
 
 install:  $(EXEFILES)
-	cp $(EXEFILES) $(DESTDIR)
-	cp dasdlist $(DESTDIR)
-	chown root $(DESTDIR)/hercifc
-	chmod 0751 $(DESTDIR)/hercifc
-	chmod +s $(DESTDIR)/hercifc
+	cp $(EXEFILES) $(INSTALLDIR)
+	cp dasdlist $(INSTALLDIR)
+	#chown root $(INSTALLDIR)/hercifc
+	#chmod 0751 $(INSTALLDIR)/hercifc
+	#chmod +s $(INSTALLDIR)/hercifc
 	rm hercifc
