$OpenBSD: patch-Makefile,v 1.30 2011/01/19 11:25:16 sthen Exp $
--- Makefile.orig	Tue Sep 28 19:18:43 2010
+++ Makefile	Mon Oct 11 14:53:46 2010
@@ -122,7 +122,7 @@ ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
 OVERWRITE=y
 
 # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
 
 # Asterisk.conf is located in ASTETCDIR or by using the -C flag
 # when starting Asterisk
@@ -152,8 +152,10 @@ LINKER_SYMBOL_PREFIX=
 # The file /etc/asterisk.makeopts will also be included but can be overridden
 # by the file in your home directory.
 
+ifneq ($(OSARCH),OpenBSD)
 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
+endif
 
 MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
 OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
@@ -196,7 +198,9 @@ endif
 
 ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
   ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),)
+    ifneq ($(OSARCH),OpenBSD)
     _ASTCFLAGS+=-pipe
+    endif
   endif
 endif
 
@@ -222,7 +226,9 @@ endif
 
 ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
   ifneq ($(PROC),ultrasparc)
+    ifneq ($(OSARCH),OpenBSD)
     _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
+    endif
   endif
 endif
 
