[gtetrinet] Bring autotools support to modern standards.



commit 0a5634ad9c0dd2384c3d30bbefc0c1187925d936
Author: Jordi Mallach <jordi sindominio net>
Date:   Mon May 2 11:37:42 2011 +0200

    Bring autotools support to modern standards.
    
    Rename configure.in to configure.ac and do several cleanups and improvements.
    Update references of CVS to Git.
    Rename src/config.h to src/gtet_config.h, to allow for sane including of the generated $(top_srcdir)/config.h. Update all users.
    Add Behdad's git.mk to generate gitignore.
    Remove generated files: ABOUT-NLS, INSTALL, config.rpath.
    Update COPYING with newest revision of GPL-2.

 ABOUT-NLS                       |  435 ---------------------------------
 COPYING                         |   41 ++--
 INSTALL                         |  229 -----------------
 Makefile.am                     |   25 ++-
 autogen.sh                      |   10 +-
 config.rpath                    |  513 ---------------------------------------
 configure.ac                    |  133 ++++++++++
 configure.in                    |   99 --------
 src/Makefile.am                 |   41 +++-
 src/config.c                    |    2 +-
 src/dialogs.c                   |    2 +-
 src/fields.c                    |    2 +-
 src/{config.h => gtet_config.h} |    0
 src/gtetrinet.c                 |    2 +-
 src/images/Makefile.am          |   11 +-
 src/tetrinet.c                  |    2 +-
 16 files changed, 228 insertions(+), 1319 deletions(-)
---
diff --git a/COPYING b/COPYING
index d60c31a..d159169 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,12 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-			    NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
 If the program is interactive, make it output a short notice like this
 when it starts in an interactive mode:
 
-    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision version 69, Copyright (C) year name of author
     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@ necessary.  Here is a sample; alter the names:
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
diff --git a/Makefile.am b/Makefile.am
index ab90367..dfe038c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,10 +13,27 @@ Applications_in_files = gtetrinet.desktop.in
 Applications_DATA = $(Applications_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-EXTRA_DIST = ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README	\
-	     TODO config.guess config.sub config.rpath install-sh	\
-	     intltool-extract.in intltool-merge.in intltool-update.in \
-	     missing mkinstalldirs $(icon_DATA) $(schema_DATA) $(Applications_DATA)
+EXTRA_DIST = \
+	ABOUT-NLS \
+	AUTHORS \
+	COPYING \
+	ChangeLog \
+	INSTALL \
+	NEWS \
+	README \
+	TODO \
+	config.guess \
+	config.sub \
+	config.rpath \
+	install-sh \
+	intltool-extract.in \
+	intltool-merge.in \
+	intltool-update.in \
+	missing \
+	mkinstalldirs \
+	$(icon_DATA) \
+	$(schema_DATA) \
+	$(Applications_DATA)
 
 install-data-local:
 	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
diff --git a/autogen.sh b/autogen.sh
index b4195f1..de00c2b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,20 +1,22 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
 
-srcdir=`dirname $0`
+srcdir=$(dirname $0)
 test -z "$srcdir" && srcdir=.
 
 PKG_NAME="gtetrinet"
-REQUIRED_AUTOMAKE_VERSION="1.7"
+REQUIRED_AUTOMAKE_VERSION="1.10"
 
-(test -f $srcdir/configure.in) || {
+(test -f $srcdir/configure.ac \
+  && test -d $srcdir/src) || {
     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
     echo " top-level $PKG_NAME directory"
     exit 1
 }
 
 which gnome-autogen.sh || {
-	echo "You need to install gnome-common from the GNOME CVS"
+	echo "You need to install gnome-common from GNOME Git (or from"
+        echo "your OS vendor's package manager)."
 	exit 1
 }
 
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..baa9d6b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,133 @@
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.63)
+AC_INIT([gtetrinet],[0.7.11],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtetrinet],[gtetrinet],[http://gtetrinet.sourceforge.net/])
+
+AC_CONFIG_SRCDIR([src/gtetrinet.c])
+AM_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([config])
+
+AC_SUBST([PACKAGE_NAME], ["$PACKAGE_NAME"])
+AC_SUBST([PACKAGE_VERSION], ["$PACKAGE_VERSION"])
+
+AM_INIT_AUTOMAKE([1.10 dist-bzip2 no-dist-gzip foreign silent-rules])
+AM_MAINTAINER_MODE
+
+# Enable silent rules by default
+AM_SILENT_RULES([yes])
+
+# Check for programs
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Check for header files
+AC_CHECK_HEADERS([ctype.h dirent.h errno.h locale.h signal.h \
+                  stdarg.h stdio.h stdlib.h string.h unistd.h \
+                  netdb.h netinet/in.h \
+                  sys/poll.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
+
+# Check for library functions
+AC_CHECK_FUNCS([memset setlocale])
+
+# Initialise i18n
+GETTEXT_PACKAGE=gtetrinet
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the gettext domain name.])
+IT_PROG_INTLTOOL([0.40.0])
+AM_GLIB_GNU_GETTEXT
+
+# Check for GConf
+AC_PATH_PROG(GCONFTOOL, gconftool-2)
+AM_GCONF_SOURCE_2
+
+# Check for pkg-config
+PKG_PROG_PKG_CONFIG([0.22])
+
+dnl Add debug flags if building from git.
+if test -d $srcdir/.git; then
+	CFLAGS="-Wall -W -g3 -ggdb -O0"
+	AC_SUBST(CFLAGS)
+fi
+
+# Check for required packages
+LIBGTK_REQUIRED=2.6.0
+LIBGNOME_REQUIRED=2.0.0
+LIBGNOMEUI_REQUIRED=2.0.0
+LIBESD_OPTIONAL=0.2.36
+
+PKG_CHECK_MODULES(GTETRINET,[
+                  gtk+-2.0 >= $LIBGTK_REQUIRED
+                  libgnome-2.0 >= $LIBGNOME_REQUIRED
+                  libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
+])
+AC_SUBST(GTETRINET_CFLAGS)
+AC_SUBST(GTETRINET_LIBS)
+
+dnl Check for libesd
+if pkg-config --exists esound ; then
+	have_esound=yes
+else 
+	have_esound=no
+fi
+
+if test "x$have_esound" = "xyes"; then
+AC_DEFINE(HAVE_ESD, 1, [Define this to enable EsounD support.])
+PKG_CHECK_MODULES(ESOUND, esound >= $LIBESD_OPTIONAL)
+AC_SUBST(ESOUND_CFLAGS)
+AC_SUBST(ESOUND_LIBS)
+fi
+
+AM_CONDITIONAL(HAVE_ESOUND, test "x$have_esound" = "xyes")
+
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+
+AC_CHECK_FUNC(putenv)
+AC_CHECK_FUNC(setenv)
+if test $ac_cv_func_setenv = no; then
+  if test $ac_cv_func_putenv = no; then
+    echo "Error: Couldn't find either putenv() or setenv()"
+    exit;
+  else
+    AC_DEFINE(HAVE_PUTENV, 1, [Define this if putenv() is available.])
+  fi
+ else
+  AC_DEFINE(HAVE_SETENV, 1, [Define this if setenv() is available.])
+ fi
+
+dnl configure options
+AC_ARG_ENABLE(detach,
+[  --enable-detach         Enable page detaching (default=no)],
+  [if test "x$enable_detach" = "xyes"; then
+    AC_DEFINE(ENABLE_DETACH, 1, [Define this to enable page detaching.])
+  fi])
+
+AC_ARG_ENABLE(ipv6,
+[  --enable-ipv6           Enable IPv6 support (default=no)],
+  [if test "x$enable_ipv6" = "xyes"; then
+   AC_DEFINE(USE_IPV6, 1, [Define this to enable IPv6 support.])
+  fi])
+
+# Generate files
+AC_CONFIG_FILES([
+Makefile
+doc/Makefile
+po/Makefile.in
+src/Makefile
+src/images/Makefile
+themes/Makefile
+themes/default/Makefile
+themes/small/Makefile
+icons/Makefile
+])
+AC_OUTPUT
+
+# Print configuration information
+echo "   Configuration result"
+echo "   ------------- ------"
+echo
+echo "   GTranslator version: ${PACKAGE_VERSION}"
+echo "   Compilation flags:   ${CFLAGS}"
+echo "   IPv6 support:        $enable_ipv6"
+echo "   EsounD support:      $have_esound"
+echo "   Page detaching:      $enable_detach"
diff --git a/src/Makefile.am b/src/Makefile.am
index af66789..e750b18 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,22 +2,47 @@ SUBDIRS = images
 
 localedir = $(datadir)/locale
 
-INCLUDES = -DLOCALEDIR=\"$(localedir)\" \
-	   -DPIXMAPSDIR=\""$(datadir)/pixmaps"\" \
-	   -DGTETPIXMAPSDIR=\""$(datadir)/pixmaps/gtetrinet"\" \
-	   $(GTET_CFLAGS)
+AM_CFLAGS = $(GTETRINET_CFLAGS)
 
 if HAVE_ESOUND
-LDADD = $(GTET_LIBS) $(ESOUND_LIBS)
+gtetrinet_LDADD = $(GTETRINET_LIBS) $(ESOUND_LIBS)
 else
-LDADD = $(GTET_LIBS)
+gtetrinet_LDADD = $(GTETRINET_LIBS)
 endif
 
-AM_CPPFLAGS = -DGTETRINET_DATA=\"$(pkgdatadir)\"
+AM_CPPFLAGS = \
+	-DGTETRINET_DATA=\"$(pkgdatadir)\"                      \
+	-DGTETPIXMAPSDIR=\""$(datadir)/pixmaps/gtetrinet"\"     \
+	-DLOCALEDIR=\"$(localedir)\"                            \
+	-DPIXMAPSDIR=\""$(datadir)/pixmaps"\"
 
 gamesdir = $(prefix)/games
 games_PROGRAMS = gtetrinet
 
-gtetrinet_SOURCES = client.c client.h commands.c commands.h config.c config.h dialogs.c dialogs.h fields.c fields.h gtetrinet.c gtetrinet.h misc.c misc.h partyline.c partyline.h sound.c sound.h tetrinet.c tetrinet.h tetris.c tetris.h winlist.c winlist.h
+gtetrinet_SOURCES = \
+	client.c \
+	client.h \
+	commands.c \
+	commands.h \
+	config.c \
+	config.h \
+	dialogs.c \
+	dialogs.h \
+	fields.c \
+	fields.h \
+	gtetrinet.c \
+	gtetrinet.h \
+	misc.c \
+	misc.h \
+	partyline.c \
+	partyline.h \
+	sound.c \
+	sound.h \
+	tetrinet.c \
+	tetrinet.h \
+	tetris.c \
+	tetris.h \
+	winlist.c \
+	winlist.h
 
 -include $(top_srcdir)/git.mk
diff --git a/src/config.c b/src/config.c
index 58abd28..fe9a6b3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#include "config.h"
+#include "gtet_config.h"
 #include "gtetrinet.h"
 #include "client.h"
 #include "tetrinet.h"
diff --git a/src/dialogs.c b/src/dialogs.c
index f42b0ff..b7dfa35 100644
--- a/src/dialogs.c
+++ b/src/dialogs.c
@@ -27,7 +27,7 @@
 #include <dirent.h>
 
 #include "gtetrinet.h"
-#include "config.h"
+#include "gtet_config.h"
 #include "client.h"
 #include "tetrinet.h"
 #include "tetris.h"
diff --git a/src/fields.c b/src/fields.c
index 615a6e9..5a30fc8 100644
--- a/src/fields.c
+++ b/src/fields.c
@@ -25,7 +25,7 @@
 #include <gnome.h>
 #include <stdio.h>
 
-#include "config.h"
+#include "gtet_config.h"
 #include "client.h"
 #include "tetrinet.h"
 #include "tetris.h"
diff --git a/src/config.h b/src/gtet_config.h
similarity index 100%
rename from src/config.h
rename to src/gtet_config.h
diff --git a/src/gtetrinet.c b/src/gtetrinet.c
index e113fba..de40233 100644
--- a/src/gtetrinet.c
+++ b/src/gtetrinet.c
@@ -32,7 +32,7 @@
 #include <gconf/gconf-client.h>
 
 #include "gtetrinet.h"
-#include "config.h"
+#include "gtet_config.h"
 #include "client.h"
 #include "tetrinet.h"
 #include "tetris.h"
diff --git a/src/images/Makefile.am b/src/images/Makefile.am
index 7cb6c0d..558f14a 100644
--- a/src/images/Makefile.am
+++ b/src/images/Makefile.am
@@ -1,3 +1,12 @@
-EXTRA_DIST = fields.xpm partyline.xpm winlist.xpm connect.xpm disconnect.xpm pause.xpm play.xpm stop.xpm team24.xpm
+EXTRA_DIST = \
+	connect.xpm \
+	disconnect.xpm \
+	fields.xpm \
+	partyline.xpm \
+	pause.xpm \
+	play.xpm \
+	stop.xpm \
+	team24.xpm \
+	winlist.xpm
 
 -include $(top_srcdir)/git.mk
diff --git a/src/tetrinet.c b/src/tetrinet.c
index 297b34f..a437d83 100644
--- a/src/tetrinet.c
+++ b/src/tetrinet.c
@@ -32,7 +32,7 @@
 #include <ctype.h>
 
 #include "gtetrinet.h"
-#include "config.h"
+#include "gtet_config.h"
 #include "client.h"
 #include "tetrinet.h"
 #include "tetris.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]