$OpenBSD: patch-configure,v 1.6 2013/08/09 19:04:49 ajacoutot Exp $
--- configure.orig	Fri Feb 22 16:51:22 2008
+++ configure	Fri Aug  9 20:48:04 2013
@@ -6,7 +6,7 @@ my $prefix      = "/usr/local";
 my $package     = "eboard";
 my $version     = "1.1.1";
 my $cxx         = "g++";
-my @cxxflags    = ("-O6");
+my @cxxflags    = ();
 my @ldflags     = ("-lpthread");
 my @libs        = ();
 my $configh     = "config.h";
@@ -236,7 +236,7 @@ sub append_flags {
     my $x = shift @_;
     my @y;
 
-    @y = split(/:/, $x);
+    @y = split(/\s+/, $x);
     for (@y) {
 	push @cxxflags, "$_";
     }
@@ -264,7 +264,7 @@ sub macro_check {
     my $hdr = shift @_;
     my $mac = shift @_;
     my $chn = shift @_;
-    my $program = "#include <$hdr>\n#if !defined($mac)\n#error not there\n#endif\n";
+    my $program = "#include <sys/types.h>\n#include <$hdr>\n#if !defined($mac)\n#error not there\n#endif\n";
 
     print "checking for $mac in $hdr... ";
     if (!open(TESTCC,">test.cc")) {
@@ -342,6 +342,8 @@ sub header_check {
 	print "$y";
 	if ($bsdbug != 0) {
 	    $program = "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n#include <$z>\nint main() { return 0; }\n";
+	} elsif ($z == "sys/audioio.h") {
+	    $program = "#include <sys/types.h>\n#include <$z>\nint main() { return 0; }\n";
 	} else {
 	    $program = "#include <$z>\nint main() { return 0; }\n";
         }
@@ -512,6 +514,10 @@ if (!header_check("stdio.h","stdlib.h","string.h","uni
 #optional headers
 header_check("strings.h","sys/soundcard.h","sys/audioio.h","linux/joystick.h");
 
+if (header_check("sndio.h")) {
+    append_libs("sndio");
+}
+
 $t1=macro_check("netinet/in.h","IPPROTO_TCP","HAVE_IPPROTO_TCP_ON_IN_H");
 $t2=macro_check("netinet/in.h","TCP_NODELAY","HAVE_TCP_NODELAY_ON_IN_H");
 $t3=macro_check("netinet/in.h","SOL_TCP","HAVE_SOL_TCP_ON_IN_H");
@@ -536,7 +542,7 @@ if ($t2 != 0) {
 	print "netinet/tcp.h not required, SOL_TCP present.\n";
     }
 } else {
-    if ($t5 != 0 && ($t1!=0 || $t4!=0) && ($t3!=0 || $t6!=0) ) {
+    if ($t5 != 0 && ($t1!=0 || $t4!=0 || $t3!=0 || $t6!=0) ) {
 	cppdef("NEED_TCP_H");
 	cppdef("USE_SOCK_OPTS");
 	if ($t1!=0 || $t4!=0) {
