File zdbsp-automake.diff of Package zdbsp
From: Jan Engelhardt <jeneglh@inai.de>
Date: about spring 2010
Throw out the ugly Makefile and replace by something more maintainable.
---
Makefile.am | 32 ++++++++++++++++++++++++++++++++
configure.ac | 22 ++++++++++++++++++++++
2 files changed, 54 insertions(+)
Index: zdbsp-1.18.1/Makefile.am
===================================================================
--- /dev/null
+++ zdbsp-1.18.1/Makefile.am
@@ -0,0 +1,32 @@
+# -*- Makefile -*-
+
+AM_CFLAGS = -Wall -Izlib -pipe -ffast-math
+AM_CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1
+if !ENABLE_SSE
+AM_CFLAGS += -DDISABLE_SSE
+endif
+AM_CXXFLAGS = ${AM_CFLAGS}
+
+CFLAGS = -O3 -fomit-frame-pointer -DNDEBUG
+CXXFLAGS = ${CFLAGS}
+
+bin_PROGRAMS = zdbsp
+zdbsp_SOURCES = main.cpp \
+ blockmapbuilder.cpp \
+ getopt.c \
+ getopt1.c \
+ nodebuild.cpp \
+ nodebuild_classify_nosse2.cpp \
+ nodebuild_events.cpp \
+ nodebuild_extract.cpp \
+ nodebuild_gl.cpp \
+ nodebuild_utility.cpp \
+ processor.cpp \
+ processor_udmf.cpp \
+ sc_man.cpp \
+ view.cpp \
+ wad.cpp
+if ENABLE_SSE
+zdbsp_SOURCES += nodebuild_classify_sse1.cpp nodebuild_classify_sse2.cpp
+endif
+zdbsp_LDADD = -lz
Index: zdbsp-1.18.1/configure.ac
===================================================================
--- /dev/null
+++ zdbsp-1.18.1/configure.ac
@@ -0,0 +1,22 @@
+AC_INIT([zdbsp], [1.10])
+AC_PREREQ([2.63])
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([-Wall 1.9 foreign subdir-objects])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_CANONICAL_HOST
+
+case "$host_cpu" in
+ i?86|x86_64) sse_auto="yes";;
+ *) sse_auto="no";;
+esac
+AC_ARG_ENABLE([sse], AS_HELP_STRING([--disable-sse], [Do not use SSE]),
+ [sse="$withval"], [sse="$sse_auto"])
+AS_IF([test "$sse" != yes], [sse="no"])
+AM_CONDITIONAL([ENABLE_SSE], [test "$sse" = yes])
+AC_MSG_CHECKING([SSE])
+AC_MSG_RESULT([$sse])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT