shithub: choc

Download patch

ref: 85a709203c997834db1cbd8b4d6a979197306111
parent: d3d5b27ce6830ee2c41256bef2c9b7fc041cfa04
author: Simon Howard <fraggle@gmail.com>
date: Tue May 1 22:03:44 EDT 2007

Check in autoconf if python is installed; if not, don't run python
scripts.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 873

--- a/Makefile.am
+++ b/Makefile.am
@@ -46,6 +46,10 @@
 docdir=$(prefix)/share/doc/@PACKAGE@
 SUBDIRS=textscreen pcsound src man setup
 
+if HAVE_PYTHON
+
 CMDLINE : src/
 	./man/docgen -p src/ > $@
+
+endif
 
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,5 @@
 AC_INIT(Chocolate Doom, 0.2.0, fraggle@gmail.com, chocolate-doom)
+
 AC_CONFIG_AUX_DIR(autotools)
 
 orig_CFLAGS="$CFLAGS"
@@ -5,6 +6,7 @@
 
 AC_PROG_CC
 AC_PROG_RANLIB
+AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
 
 OPT_LEVEL=2
 
@@ -44,6 +46,7 @@
 AC_CHECK_TOOL(WINDRES, windres, )
 
 AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
+AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
 
 AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME,AC_PACKAGE_VERSION)
 
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -5,6 +5,11 @@
 
 EXTRA_DIST = $(man_MANS) $(MANPAGE_GEN_FILES) 
 
+
+if HAVE_PYTHON
+
 chocolate-doom.6: ../src $(MANPAGE_GEN_FILES)
 	./docgen -m ../src > $@
+
+endif
 
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -34,6 +34,10 @@
 %.o : %.rc
 	$(WINDRES) $^ -o $@
 
+if HAVE_PYTHON
+
 chocolate_setup_icon.c : ../data/chocolate-setup.png
 	../data/convert-icon $^ $@
+
+endif
 
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -150,6 +150,10 @@
 %.o : %.rc
 	$(WINDRES) $^ -o $@
 
+if HAVE_PYTHON
+
 chocolate_doom_icon.c : ../data/chocolate-doom.png
 	../data/convert-icon $^ $@
+
+endif