Package: wesnoth
Version: 0.7
Author: Guillem Jover <guillem@hadrons.org>
Status: applied
Description:
 Fix autotools.

diff -Naur wesnoth-0.7/configure.ac wesnoth-0.7-patched/configure.ac
--- wesnoth-0.7/configure.ac	2004-03-19 21:16:06.000000000 +0100
+++ wesnoth-0.7-patched/configure.ac	2004-03-20 06:29:38.000000000 +0100
@@ -4,25 +4,15 @@
 # Initial configuration                                               #
 #######################################################################
 
-AC_PREREQ(2.57)
-AC_INIT(wesnoth, 0.13, davidnwhite@optusnet.com.au, Battle for Wesnoth)
-
-AC_REVISION($Version: 0.13$)
-PACKAGE=wesnoth
-MAJOR_VERSION="0"
-MINOR_VERSION="7"
-MICRO_VERSION=""
-
-if test "x$MICRO_VERSION" = "x"; then
-        VERSION=$MAJOR_VERSION.$MINOR_VERSION
-else
-        VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
-fi
-
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_PREREQ([2.57])
+AC_INIT([Battle for Wesnoth], [0.7], [davidnwhite@optusnet.com.au], [wesnoth])
+AC_REVISION([$Revision: 0.13 $])
+AC_CONFIG_AUX_DIR([config])
 AC_CONFIG_SRCDIR([src/actions.cpp])
 AC_CONFIG_HEADER([config.h])
 
+AM_INIT_AUTOMAKE([foreign 1.5])
+AM_MAINTAINER_MODE
 
 #######################################################################
 # Checks for programs.                                                #
@@ -34,7 +24,7 @@
 
 # SDL_CONFIG
 
-AC_PATH_PROGS(SDL_CONFIG, [sdl-config sdl11-config], none)
+AC_PATH_PROGS([SDL_CONFIG], [sdl-config sdl11-config], [none])
 
 if test "x$SDL_CONFIG" = "xnone"; then
 	
@@ -62,7 +52,7 @@
 
 # KDE_CONFIG
 
-AC_PATH_PROGS(KDE_CONFIG, kde-config, none)
+AC_PATH_PROGS([KDE_CONFIG], [kde-config], [none])
 
 if test "x$KDE_CONFIG" = "xnone"; then
 	kdefound=no
@@ -200,7 +190,7 @@
 CXXFLAGS="$CFLAGS $SDL_CFLAGS"
 LIBS="$LIBS $SDL_LIBS $SDL_IMAGE_LIBS"
 
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([
 #include <SDL_image.h>
 #include <stdlib.h>
 
@@ -213,11 +203,11 @@
 		exit(0);
 	exit(!IMG_isPNG(src));
 }
-	],
-	[AC_MSG_RESULT(yes)],
-	[AC_MSG_RESULT(no)] 
-	[AC_MSG_ERROR([*** SDL_image has no PNG support! You need SDL_image with PNG support])],
-	[AC_MSG_RESULT[not tested in cross-compiling]])
+	])],
+	[AC_MSG_RESULT([yes])],
+	[AC_MSG_RESULT([no])
+	 AC_MSG_ERROR([*** SDL_image has no PNG support! You need SDL_image with PNG support])],
+	[AC_MSG_RESULT([not tested in cross-compiling])])
 
 CPPFLAGS=$OLD_CPPFLAGS
 CXXFLAGS=$OLD_CXXFLAGS
@@ -243,12 +233,12 @@
 # Configuration options                                               #
 #######################################################################
 
-AC_ARG_ENABLE(debug,
+AC_ARG_ENABLE([debug],
 	      [  --enable-debug        Enable debug in wesnoth],
-	      CXXFLAGS="$CXXFLAGS -DDEBUG -ggdb3")
+	      [CXXFLAGS="$CXXFLAGS -DDEBUG -ggdb3"])
 
 DATADIR=$PACKAGE
-AC_ARG_ENABLE(datadir-name,
+AC_ARG_ENABLE([datadir-name],
 	      [  --datadir-name[[=dir]] Change name of data directory. Default with this option: wesnoth-data], 
 	      [case "${enableval}" in
 	       yes)
@@ -261,44 +251,44 @@
 			;;
 		esac])
 
-AC_SUBST(DATADIR)
+AC_SUBST([DATADIR])
 		
 # Default behaviour
 server=no 
 editor=no
 tools=no
 
-AC_ARG_ENABLE(server,
+AC_ARG_ENABLE([server],
 	      [  --enable-server       Enable compilation of server],
-	      server=$enableval,
-	      server=no)
+	      [server=$enableval],
+	      [server=no])
 
-AC_ARG_ENABLE(editor,
+AC_ARG_ENABLE([editor],
 	      [  --enable-editor       Enable compilation editor],
-	      editor=$enableval,
-	      editor=no)
+	      [editor=$enableval],
+	      [editor=no])
 
-AC_ARG_ENABLE(tools,
+AC_ARG_ENABLE([tools],
 	      [  --enable-tools        Enable compilation of translation tools],
-	      tools=$enableval,
-	      tools=no)
+	      [tools=$enableval],
+	      [tools=no])
 
-AC_ARG_ENABLE(kde,
+AC_ARG_ENABLE([kde],
 	      [  --enable-kde          Enable installation of icon and KDE menu entry],
-	      kde=$enableval,
-	      kde=no)
+	      [kde=$enableval],
+	      [kde=no])
 
-AC_ARG_ENABLE(gnome,
+AC_ARG_ENABLE([gnome],
 	      [  --enable-gnome        Enable installation of icon and GNOME menu entry],
-	      gnome=$enableval,
-	      gnome=no)
+	      [gnome=$enableval],
+	      [gnome=no])
 
-AM_CONDITIONAL(SERVER, test x$server = xyes)
-AM_CONDITIONAL(EDITOR, test x$editor = xyes)
-AM_CONDITIONAL(TOOLS, test x$tools = xyes)
-AM_CONDITIONAL(KDE, test x$kde = xyes && test x$kdefound = xyes)
-AM_CONDITIONAL(GNOME1, test x$gnome = xyes && test x$gnome1found = xyes)
-AM_CONDITIONAL(GNOME2, test x$gnome = xyes && test x$gnome1found = xno)
+AM_CONDITIONAL([SERVER], [test x$server = xyes])
+AM_CONDITIONAL([EDITOR], [test x$editor = xyes])
+AM_CONDITIONAL([TOOLS], [test x$tools = xyes])
+AM_CONDITIONAL([KDE], [test x$kde = xyes && test x$kdefound = xyes])
+AM_CONDITIONAL([GNOME1], [test x$gnome = xyes && test x$gnome1found = xyes])
+AM_CONDITIONAL([GNOME2], [test x$gnome = xyes && test x$gnome1found = xno])
 
 #######################################################################
 # Data file substitution.                                             #
diff -Naur wesnoth-0.7/Makefile.am wesnoth-0.7-patched/Makefile.am
--- wesnoth-0.7/Makefile.am	2004-03-19 21:16:05.000000000 +0100
+++ wesnoth-0.7-patched/Makefile.am	2004-03-20 05:54:36.000000000 +0100
@@ -1,10 +1,11 @@
-AUTOMAKE_OPTIONS = foreign
 ISUBDIRS = icons
 SUBDIRS = src $(ISUBDIRS)
 pkgdatadir=$(datadir)/@DATADIR@
 
-dist_noinst_DATA = @MANUAL_FILES@ copyright changelog wesnoth.dsp wesnoth.dsw @UTIL_FILES@
-nobase_dist_pkgdata_DATA = @DATA_FILES@ @FONT_FILES@ @IMAGE_FILES@ @MUSIC_FILES@ @SOUND_FILES@
+dist_noinst_DATA = @MANUAL_FILES@ copyright changelog wesnoth.dsp wesnoth.dsw \
+	@UTIL_FILES@
+nobase_dist_pkgdata_DATA = @DATA_FILES@ @FONT_FILES@ @IMAGE_FILES@ \
+	@MUSIC_FILES@ @SOUND_FILES@
 dist_man6_MANS = doc/man/wesnoth.6 doc/man/wesnothd.6 doc/man/wesnoth_editor.6
 
 uninstall-hook:
@@ -14,3 +15,4 @@
 	if test -d $(bindir) ; then echo `rmdir $(bindir)` ; fi
 	if test -d $(datadir) ; then echo `rmdir $(datadir)` ; fi
 	if test -d $(prefix) ; then echo `rmdir $(prefix)` ; fi
+
diff -Naur wesnoth-0.7/src/Makefile.am wesnoth-0.7-patched/src/Makefile.am
--- wesnoth-0.7/src/Makefile.am	2004-03-19 21:16:14.000000000 +0100
+++ wesnoth-0.7-patched/src/Makefile.am	2004-03-20 06:10:00.000000000 +0100
@@ -1,18 +1,20 @@
+
+SUBDIRS = .
+
 if SERVER
-SSUBDIRS = server
+SUBDIRS += server
 endif
 
 if TOOLS
-TSUBDIRS = tools
+SUBDIRS += tools
 endif
 
+bin_PROGRAMS = wesnoth
+
 if EDITOR
-EPROGRAMS = wesnoth_editor
+bin_PROGRAMS += wesnoth_editor
 endif
 
-SUBDIRS = . $(SSUBDIRS) $(TSUBDIRS)
-bin_PROGRAMS = wesnoth $(EPROGRAMS)
-
 pkgdatadir=$(datadir)/@DATADIR@
 
 #############################################################################
@@ -231,4 +233,6 @@
 			 widgets/widget.hpp
 
 AM_CXXFLAGS = @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\"
-AM_LDFLAGS = @SDL_LIBS@ @SDL_IMAGE_LIBS@ @SDL_MIXER_LIBS@ @SDL_NET_LIBS@ @SDL_TTF_LIBS@ 
+AM_LDFLAGS = @SDL_LIBS@ @SDL_IMAGE_LIBS@ @SDL_MIXER_LIBS@ @SDL_NET_LIBS@ \
+	@SDL_TTF_LIBS@
+
