-# Copyright © 2011 Nick Bowler
+# Copyright © 2011-2012 Nick Bowler
#
# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
# This is free software: you are free to do what the fuck you want to.
# There is NO WARRANTY, to the extent permitted by law.
AUTOMAKE_OPTIONS = parallel-tests color-tests
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 -I common/m4
# For Gnulib
MOSTLYCLEANFILES =
$(AM_V_at)mv -f $@.tmp $@
# Supporting rules for gettext.
-ALL_MOFILES = $(POFILES:.po=.mo)
-EXTRA_DIST += po/$(PACKAGE).pot po/LINGUAS $(POFILES) $(ALL_MOFILES)
-MAINTAINERCLEANFILES += po/$(PACKAGE).pot $(ALL_MOFILES)
+include $(top_srcdir)/common/snippet/gettext.mk
+
+EXTRA_DIST += po/$(PACKAGE).pot
+MAINTAINERCLEANFILES += po/$(PACKAGE).pot
+
XGETTEXT_OPTS = -D $(builddir) -D $(srcdir) --from-code=utf-8 \
--add-comments=TRANSLATORS: --foreign-user \
--package-name=$(PACKAGE) --package-version=$(PACKAGE_VERSION) \
-ajo $@.tmp src/errors.lst
$(AM_V_at) mv -f $@.tmp $@
-.po.mo:
- $(AM_V_at)$(MKDIR_P) $(@D)
- $(AM_V_GEN)$(MSGFMT) -c -o $@ $<
-
-install-data-local: install-mo
-install-mo: $(MOFILES)
- for mo in $?; do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; $(MKDIR_P) "$$inst") \
- || exit $$?; \
- (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") \
- || exit $$?; \
- done
-
-installdirs-local: installdirs-mo
-installdirs-mo:
- for mo in $(MOFILES); do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; $(MKDIR_P) "$$inst") || exit $$?; \
- done
-
-uninstall-local: uninstall-mo
-uninstall-mo:
- for mo in $(ALL_MOFILES); do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
- done
-
-.PHONY: install-mo installdirs-mo uninstall-mo
-
# These are required to prevent the builtin lex/yacc rules from
# superseding ours...
src/scan.c src/scan.h: src/scan.stamp
-dnl Copyright © 2011 Nick Bowler
+dnl Copyright © 2011-2012 Nick Bowler
dnl
dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
dnl This is free software: you are free to do what the fuck you want to.
AC_PREREQ([2.68])
AC_INIT([cdecl99], [0.1], [nbowler@draconx.ca])
AC_CONFIG_HEADER([config.h])
-AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
+++ /dev/null
-dnl Copyright © 2011 Nick Bowler
-dnl
-dnl Computes the set of .po and .mo files based on the LINGUAS environment
-dnl variable. The variable POFILES is set to the complete list of .po files,
-dnl according to the LINGUAS file in the po directory. The variable MOFILES
-dnl is set to the list of .mo files that the user has requested be installed.
-dnl Both POFILES and MOFILES are AC_SUBSTed.
-dnl
-dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
-dnl This is free software: you are free to do what the fuck you want to.
-dnl There is NO WARRANTY, to the extent permitted by law.
-
-AC_DEFUN([DX_LINGUAS], [dnl
-AC_REQUIRE([AM_GNU_GETTEXT])
-
-POFILES=
-MOFILES=
-
-if test -f "$srcdir/po/LINGUAS"; then
- ALL_LINGUAS=`sed 's/#.*$//' "$srcdir/po/LINGUAS"`
-
- : ${LINGUAS=all}
- if test x"$LINGUAS" != x"all"; then
- # Replicate la_CC-style codes as la.
- LINGUAS=`printf '%s\n' "$LINGUAS" \
- | [sed 's/\([^_[:space:]]*\)_[^[:space:]]*/& \1/g']`
-
- printf '%s\n' $ALL_LINGUAS | sort > conftest.LINGUAS
- LINGUAS=`printf '%s\n' $LINGUAS | sort \
- | join - conftest.LINGUAS`
- else
- LINGUAS=$ALL_LINGUAS
- fi
-
- # Note: $srcdir is not used here because these variables are for make.
- set x $ALL_LINGUAS; shift
- case ${#} in
- 0) ;;
- *) POFILES=`printf "po/%s.po\n" "${@}"` ;;
- esac
-
- if test x"$USE_NLS" = x"yes"; then
- set x $LINGUAS; shift
- case ${#} in
- 0) ;;
- *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;
- esac
- fi
-fi
-
-AC_SUBST([POFILES])
-AC_SUBST([MOFILES])
-])