$OpenBSD: patch-system_mk,v 1.9 2012/07/10 15:22:45 jasper Exp $
--- system.mk.orig	Sun Mar 18 21:32:12 2007
+++ system.mk	Mon Jul  9 11:22:36 2012
@@ -7,7 +7,7 @@
 ## Installation paths
 ##
 
-PREFIX=/usr/local
+#PREFIX=/usr/local
 
 # Unless you are creating a package conforming to some OS's standards, you
 # probably do not want to modify the following directories:
@@ -15,15 +15,16 @@ PREFIX=/usr/local
 # Main binaries
 BINDIR=$(PREFIX)/bin
 # Configuration .lua files
-ETCDIR=$(PREFIX)/etc/ion3
+ETCDIR=$(PREFIX)/share/examples/ion3
 # Some .lua files and ion-* shell scripts
 SHAREDIR=$(PREFIX)/share/ion3
 # Manual pages
-MANDIR=$(PREFIX)/share/man
+MANDIR=$(PREFIX)/man
 # Some documents
 DOCDIR=$(PREFIX)/share/doc/ion3
+EXAMPLEDIR=$(PREFIX)/share/examples/ion3
 # Nothing at the moment
-INCDIR=$(PREFIX)/include/ion3
+INCDIR=$(PREFIX)/include
 # Nothing at the moment
 LIBDIR=$(PREFIX)/lib
 # Modules
@@ -47,7 +48,7 @@ LOCALEDIR=$(PREFIX)/share/locale
 #PRELOAD_MODULES=1
 
 # Flags to link with libdl.
-DL_LIBS=-ldl
+#DL_LIBS=-ldl
 
 
 ##
@@ -57,24 +58,24 @@ DL_LIBS=-ldl
 # If you have installed Lua 5.1 from the official tarball without changing
 # paths, this should do it.
 LUA_DIR=/usr/local
-LUA_LIBS = -L$(LUA_DIR)/lib -llua
-LUA_INCLUDES = -I$(LUA_DIR)/include
-LUA=$(LUA_DIR)/bin/lua
-LUAC=$(LUA_DIR)/bin/luac
+#LUA_LIBS = -L$(LUA_DIR)/lib -llua
+#LUA_INCLUDES = -I$(LUA_DIR)/include
+#LUA=$(LUA_DIR)/bin/lua
+#LUAC=$(LUA_DIR)/bin/luac
 
 # If you are using the Debian packages, the following settings should be
 # what you want.
-#LUA_LIBS=`pkg-config --libs lua5.1`
-#LUA_INCLUDES=`pkg-config --cflags lua5.1`
-#LUA=`which lua5.1`
-#LUAC=`which luac5.1`
+LUA_LIBS=`pkg-config --libs lua51`
+LUA_INCLUDES=`pkg-config --cflags lua51`
+LUA=`which lua51`
+LUAC=`which luac51`
 
 
 ##
 ## X libraries, includes and options
 ##
 
-X11_PREFIX=/usr/X11R6
+X11_PREFIX=$(X11BASE)
 # SunOS/Solaris
 #X11_PREFIX=/usr/openwin
 
@@ -104,7 +105,7 @@ DEFINES += -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND
 # asprintf and vasprintf in the c library. (gnu libc has.)
 # If HAS_SYSTEM_ASPRINTF is not defined, an implementation
 # in sprintf_2.2/ is used.
-#HAS_SYSTEM_ASPRINTF=1
+HAS_SYSTEM_ASPRINTF=1
 
 # If you're on an archaic system (such as relatively recent *BSD releases)
 # without even dummy multibyte/widechar and localisation support, you may 
@@ -112,24 +113,24 @@ DEFINES += -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND
 #DEFINES += -DCF_NO_LOCALE
 
 # On some other systems you may something like this:
-#EXTRA_LIBS += -lintl
-#EXTRA_INCLUDES +=
+EXTRA_LIBS += -L$(LOCALBASE)/lib -lintl -liconv
+EXTRA_INCLUDES += -I$(LOCALBASE)/include -I/usr/local/include/lua-5.1
 
 
 ##
 ## C compiler
 ##
 
-CC=gcc
+#CC=gcc
 
 # Same as '-Wall -pedantic' without '-Wunused' as callbacks often
 # have unused variables.
-WARN=	-W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
-	-Wtrigraphs -Wformat -Wchar-subscripts \
-	-Wparentheses -pedantic -Wuninitialized
+#WARN=	-W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
+#	-Wtrigraphs -Wformat -Wchar-subscripts \
+#	-Wparentheses -pedantic -Wuninitialized
 
-CFLAGS=-g -Os $(WARN) $(DEFINES) $(EXTRA_INCLUDES) $(INCLUDES)
-LDFLAGS=-g -Os $(EXTRA_LIBS) $(LIBS)
+CFLAGS+= $(WARN) $(DEFINES) $(EXTRA_INCLUDES) $(INCLUDES)
+LDFLAGS+= $(EXTRA_LIBS) $(LIBS)
 EXPORT_DYNAMIC=-Xlinker --export-dynamic
 
 # The following options are mainly for development use and can be used
