From: Philip Chimento Date: Thu, 5 Mar 2009 23:14:46 +0000 (+0000) Subject: Rewrote configure.ac according to my new l33t knowledge of autotools, and X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=59ec228b7cbadb992b27c435c8b2b4fdc4252556;p=rodin%2Fchimara.git Rewrote configure.ac according to my new l33t knowledge of autotools, and removed obsolete macros. Now, after checking out a new revision, use the command: autoreconf --install --force instead of autogen.sh to rebuild all the platform-specific files. git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@30 ddfedd41-794f-dd11-ae45-00112f111e67 --- diff --git a/configure.ac b/configure.ac index fbeacd2..ea5ccb5 100755 --- a/configure.ac +++ b/configure.ac @@ -1,38 +1,53 @@ -dnl Process this file with autoconf to produce a configure script. -dnl Created by Anjuta application wizard. +# configure.ac with sensible comments -AC_INIT(chimara, 0.1) +### INITIALIZATION ############################################################ -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -AM_CONFIG_HEADER(config.h) -AM_MAINTAINER_MODE +# Initialize Autoconf +# Args: (human-readable package name, package version, bug report address, +# tarballname) +AC_INIT([chimara], [0.1]) +# Sanity check to make sure we are running Autoconf from the right directory +AC_CONFIG_SRCDIR(src/chimara-glk.c) +# Initialize Automake +AM_INIT_AUTOMAKE([-Wall]) -AC_ISC_POSIX -AC_PROG_CC -AM_PROG_CC_STDC -AC_HEADER_STDC -AM_PROG_LIBTOOL -AC_PROG_LIBTOOL +### DECLARE PROGRAMS ########################################################## + +AC_PROG_CC # C compiler +AC_PROG_INSTALL # Install +AC_PROG_LIBTOOL # Libtool +IT_PROG_INTLTOOL([0.35.0]) # Intltool +PKG_PROG_PKG_CONFIG # pkg_config + +### INTERNATIONALIZATION ###################################################### -dnl *************************************************************************** -dnl Internatinalization -dnl *************************************************************************** GETTEXT_PACKAGE=chimara AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) AM_GLIB_GNU_GETTEXT -IT_PROG_INTLTOOL([0.35.0]) -PKG_CHECK_MODULES([CHIMARA], [gtk+-2.0 >= 2.8 gthread-2.0 gmodule-2.0]) +### CHECK FOR LIBRARIES ####################################################### + +# Libraries needed to build Chimara library +PKG_CHECK_MODULES([CHIMARA], [ + glib-2.0 >= 2.6 + gtk+-2.0 >= 2.8 + gthread-2.0 + gmodule-2.0 +]) AC_SUBST(CHIMARA_CFLAGS) AC_SUBST(CHIMARA_LIBS) -PKG_CHECK_MODULES([TEST], [gtk+-2.0 >= 2.8 gmodule-2.0]) +# Libraries needed to build test programs +PKG_CHECK_MODULES([TEST], [ + gtk+-2.0 >= 2.8 + gmodule-2.0 +]) AC_SUBST(TEST_CFLAGS) AC_SUBST(TEST_LIBS) -################################################## -# Check for gtk-doc. -################################################## +### GTK-DOC ################################################################### +# Don't know what this does yet, it was autogenerated by Anjuta. + AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) if test "x$with_html_dir" = "x" ; then HTML_DIR='${datadir}/gtk-doc/html' @@ -50,7 +65,7 @@ else AC_MSG_RESULT(no) GTKDOC=false fi -dnl Let people disable the gtk-doc stuff. +# Let people disable the gtk-doc stuff. AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) @@ -63,8 +78,14 @@ if test x$enable_gtk_doc = xauto ; then fi AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) -AC_OUTPUT([ +# Output platform-specific definitions to config.h +AC_CONFIG_HEADERS([config.h]) +# List of other files for Autoconf to output +AC_CONFIG_FILES([ Makefile src/Makefile po/Makefile.in ]) +# Do it +AC_OUTPUT + diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 0000000..57ef267 --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,217 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# Copyright (C) 2004-2008 Rodney Dawes +# +# This file may be copied and used freely without restrictions. It may +# be used in projects which are not available under a GNU Public License, +# but which still want to provide support for the GNU gettext functionality. +# +# - Modified by Owen Taylor to use GETTEXT_PACKAGE +# instead of PACKAGE and to look for po2tbl in ./ not in intl/ +# +# - Modified by jacob berkman to install +# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize +# +# - Modified by Rodney Dawes for use with intltool +# +# We have the following line for use by intltoolize: +# INTLTOOL_MAKEFILE + +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +datarootdir = @datarootdir@ +libdir = @libdir@ +DATADIRNAME = @DATADIRNAME@ +itlocaledir = $(prefix)/$(DATADIRNAME)/locale +subdir = po +install_sh = @install_sh@ +# Automake >= 1.8 provides @mkdir_p@. +# Until it can be supposed, use the safe fallback: +mkdir_p = $(install_sh) -d + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot + +ALL_LINGUAS = @ALL_LINGUAS@ + +PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) + +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi) + +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) + +POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) + +DISTFILES = Makefile.in.in POTFILES.in $(POFILES) +EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS + +POTFILES = \ +# This comment gets stripped out + +CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) + +.SUFFIXES: +.SUFFIXES: .po .pox .gmo .mo .msg .cat + +.po.pox: + $(MAKE) $(GETTEXT_PACKAGE).pot + $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && gencat $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) +all-no: + +$(GETTEXT_PACKAGE).pot: $(POTFILES) + $(GENPOT) + +install: install-data +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $$dir; \ + if test -r $$lang.gmo; then \ + $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $(srcdir)/$$lang.gmo as" \ + "$$dir/$(GETTEXT_PACKAGE).mo"; \ + fi; \ + if test -r $$lang.gmo.m; then \ + $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + if test -r $(srcdir)/$$lang.gmo.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ + $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $(srcdir)/$$lang.gmo.m as" \ + "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + true; \ + fi; \ + fi; \ + done + +# Empty stubs to satisfy archaic automake needs +dvi info tags TAGS ID: + +# Define this as empty until I found a useful application. +install-exec installcheck: + +uninstall: + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ + done + +check: all $(GETTEXT_PACKAGE).pot + rm -f missing notexist + srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m + if [ -r missing -o -r notexist ]; then \ + exit 1; \ + fi + +mostlyclean: + rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp + rm -f .intltool-merge-cache + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES stamp-it + rm -f *.mo *.msg *.cat *.cat.m *.gmo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f Makefile.in.in + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: $(DISTFILES) + dists="$(DISTFILES)"; \ + extra_dists="$(EXTRA_DISTFILES)"; \ + for file in $$extra_dists; do \ + test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ + done; \ + for file in $$dists; do \ + test -f $$file || file="$(srcdir)/$$file"; \ + ln $$file $(distdir) 2> /dev/null \ + || cp -p $$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(GETTEXT_PACKAGE).pot + tmpdir=`pwd`; \ + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + echo "$$lang:"; \ + result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ + if $$result; then \ + if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.gmo failed!"; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi; \ + done + +Makefile POTFILES: stamp-it + @if test ! -f $@; then \ + rm -f stamp-it; \ + $(MAKE) stamp-it; \ + fi + +stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/Makefile.am b/src/Makefile.am index 4a3192b..92612dd 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ - $(CHIMARA_CFLAGS) + @CHIMARA_CFLAGS@ AM_CFLAGS =\ -Wall\ @@ -17,7 +17,7 @@ AM_CFLAGS =\ noinst_PROGRAMS = test-chimara test_chimara_SOURCES = main.c callbacks.c callbacks.h error.c error.h -test_chimara_LDADD = $(TEST_LIBS) -lchimara +test_chimara_LDADD = @TEST_LIBS@ -lchimara lib_LTLIBRARIES = libchimara.la @@ -36,20 +36,21 @@ libchimara_la_SOURCES = \ style.c \ window.c window.h -libchimara_la_LIBADD = $(CHIMARA_LIBS) +libchimara_la_LIBADD = @CHIMARA_LIBS@ libchimara_la_LDFLAGS = -no-undefined -export-symbols-regex "^chimara_glk_.*|^glk_.*" libchimara_includedir = $(includedir)/chimara/chimara libchimara_include_HEADERS = chimara-glk.h +PLUGIN_LDFLAGS = -no-undefined -module -avoid-version pkglib_LTLIBRARIES = first.la model.la gridtest.la splittest.la first_la_SOURCES = first.c -first_la_LDFLAGS = -module -avoid-version +first_la_LDFLAGS = $(PLUGIN_LDFLAGS) model_la_SOURCES = model.c -model_la_LDFLAGS = -module -avoid-version +model_la_LDFLAGS = $(PLUGIN_LDFLAGS) gridtest_la_SOURCES = gridtest.c -gridtest_la_LDFLAGS = -module -avoid-version +gridtest_la_LDFLAGS = $(PLUGIN_LDFLAGS) splittest_la_SOURCES = splittest.c -splittest_la_LDFLAGS = -module -avoid-version +splittest_la_LDFLAGS = $(PLUGIN_LDFLAGS) CLEANFILES = chimara.ui