diff --git a/Makefile.am b/Makefile.am index 6cb884a..e3c4c7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = m4 po doc src gtkballs-data +SUBDIRS = po doc src gtkballs-data EXTRA_DIST = README.russian \ TODO \ @@ -8,9 +8,8 @@ EXTRA_DIST = README.russian \ gtkballs.lsm \ gtkballs.spec -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(datadir)/gtkballs - $(INSTALL_DATA) COPYING $(DESTDIR)$(datadir)/gtkballs +appddir = $(datadir)/gtkballs +appd_DATA = COPYING install-data-hook: if [ ! -f $(DESTDIR)$(localstatedir)/gtkballs-scores ]; then touch $(DESTDIR)$(localstatedir)/gtkballs-scores; fi diff --git a/README.md b/README.md index b7408fc..5a9a83b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This is the README for gtkballs. ## Compiling ``` +$ ./autogen.sh $ ./configure $ make ``` diff --git a/README.russian b/README.russian index 66a7e5e..a844aec 100644 --- a/README.russian +++ b/README.russian @@ -5,6 +5,7 @@ 2. Компиляция +$ ./autogen.sh $ ./configure $ make diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..dd1407f --- /dev/null +++ b/autogen.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +cd $srcdir + +test -z "$AUTOMAKE" && AUTOMAKE=automake +test -z "$ACLOCAL" && ACLOCAL=aclocal +test -z "$AUTOCONF" && AUTOCONF=autoconf +test -z "$AUTOHEADER" && AUTOHEADER=autoheader +test -z "$LIBTOOLIZE" && LIBTOOLIZE=$(which libtoolize glibtoolize 2>/dev/null | head -1) +test -z "$LIBTOOLIZE" && LIBTOOLIZE=libtoolize #paranoid precaution + +if test "$1" == "verbose" || test "$1" == "--verbose" ; then + set -x + verbose='--verbose' + verbose2='--debug' +fi + +# Get all required m4 macros required for configure +$LIBTOOLIZE ${verbose} --copy --force || exit 1 +$ACLOCAL ${verbose} -I m4 || exit 1 + +# Generate config.h.in +$AUTOHEADER ${verbose} --force || exit 1 + +# Generate Makefile.in's +touch config.rpath +$AUTOMAKE ${verbose} --add-missing --copy --force || exit 1 + +if grep "IT_PROG_INTLTOOL" configure.ac >/dev/null ; then + intltoolize ${verbose2} -c --automake --force || exit 1 + # po/Makefile.in.in has these lines: + # mostlyclean: + # rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp + # prevent $(GETTEXT_PACKAGE).pot from being deleted by `make clean` + sed 's/pox \$(GETTEXT_PACKAGE).pot/pox/' po/Makefile.in.in > po/Makefile.in.inx + mv -f po/Makefile.in.inx po/Makefile.in.in +fi + +# generate configure +$AUTOCONF ${verbose} --force || exit 1 + +rm -rf autom4te.cache diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5deeba7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,45 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_INIT([gtkballs],[3.1.5],[]) +AM_INIT_AUTOMAKE([-Wall foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) +AM_GNU_GETTEXT([external]) +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +m4_ifdef([AM_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +LT_INIT + +# Init intltool +IT_PROG_INTLTOOL + +# Checks for programs. +AC_PROG_CC +AC_HEADER_STDC +AC_CHECK_HEADERS([sys/param.h signal.h]) + +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0) +AC_SUBST(GTK_CFLAGS) +AC_SUBST(GTK_LIBS) + +GETTEXT_PACKAGE=gtkballs +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) + +AM_GLIB_GNU_GETTEXT + + +AC_CONFIG_FILES([ + gtkballs.lsm + Makefile + src/Makefile + doc/Makefile + doc/gtkballs.6x + po/Makefile.in + gtkballs.spec + gtkballs-data/Makefile +]) +AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 990fcfa..2fd0aa3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,8 @@ bin_PROGRAMS = gtkballs LIBS = @GTK_LIBS@ @LIBS@ -AM_CFLAGS = @CFLAGS@ @GTK_CFLAGS@ -DDATADIR=\"$(datadir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DLOCALEDIR=\"$(nlsdir)\" -INCLUDES = -I../intl +AM_CFLAGS = @CFLAGS@ @GTK_CFLAGS@ -DDATADIR=\"$(datadir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DLOCALEDIR=\"$(datadir)/locale\" +AM_CPPFLAGS = -I../intl gtkballs_SOURCES = gtkballs.c gtkballs.h gfx.c gfx.h \ license.c license.h \ @@ -14,9 +14,3 @@ gtkballs_SOURCES = gtkballs.c gtkballs.h gfx.c gfx.h \ savedialog.c savedialog.h halloffame.c halloffame.h \ inputname.c inputname.h rulesdialog.c rulesdialog.h \ game.c game.h mainwin.c mainwin.h prefs.c prefs.h - -install-exec-hook: - if [ "${UID}" = 0 ]; then \ - chgrp games $(DESTDIR)$(bindir)/gtkballs; \ - chmod g+s $(DESTDIR)$(bindir)/gtkballs; \ - fi