update build system

edit autotools files
new configure.ac
new autogen.sh
This commit is contained in:
wdlkmpx 2021-01-08 11:38:03 +08:00
parent 3c35e6a365
commit 5abe4eaf38
6 changed files with 97 additions and 12 deletions

@ -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

@ -9,6 +9,7 @@ This is the README for gtkballs.
## Compiling
```
$ ./autogen.sh
$ ./configure
$ make
```

@ -5,6 +5,7 @@
2. ëĎÍĐÉĚŃĂÉŃ
$ ./autogen.sh
$ ./configure
$ make

45
autogen.sh Executable file

@ -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

45
configure.ac vendored Normal file

@ -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

@ -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