From 2e3c8ec5a10507101733c6795d3bad10007270a0 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 11 Dec 2014 09:18:13 -0600 Subject: [PATCH] wmclock: Choose language with ./configure. This is a feature that was present in the pre-autotools configure script. Note a syntax change: ./configure --lang foo is now ./configure --with-lang=foo Also remove the .xpm files in the root directory, as they are created during configuration. --- wmclock/Makefile.am | 2 +- wmclock/configure.ac | 20 ++++++++++++++++++++ wmclock/month.xpm | 1 - wmclock/weekday.xpm | 1 - 4 files changed, 21 insertions(+), 3 deletions(-) delete mode 120000 wmclock/month.xpm delete mode 120000 wmclock/weekday.xpm diff --git a/wmclock/Makefile.am b/wmclock/Makefile.am index f3a9e55..52b18db 100644 --- a/wmclock/Makefile.am +++ b/wmclock/Makefile.am @@ -1,5 +1,5 @@ bin_PROGRAMS = wmclock -wmclock_SOURCES = dynlist.c dynlist.h wmclock.c month.xpm weekday.xpm \ +wmclock_SOURCES = dynlist.c dynlist.h wmclock.c \ xpm/date.xpm xpm/led.xpm xpm/mask.xbm xpm/mask.xbm AM_CFLAGS = $(x11_CFLAGS) $(xpm_CFLAGS) $(xext_CFLAGS) LIBS += $(x11_LIBS) $(xpm_LIBS) $(xext_LIBS) diff --git a/wmclock/configure.ac b/wmclock/configure.ac index 9e3a682..b24bc23 100644 --- a/wmclock/configure.ac +++ b/wmclock/configure.ac @@ -2,6 +2,26 @@ AC_INIT([wmclock], [1.0.14]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_SRCDIR([configure.ac]) AC_PROG_CC + +define([langlist], esyscmd([ls -d lang.* | sed 's/lang.//'])) +AC_ARG_WITH([lang], + AS_HELP_STRING([--with-lang], + [Configure wmclock to use day and month names for the specified + language. Defaults to 'english'. Choices are: ] + langlist), + [], + [with_lang=english]) + +LangDir="lang.${with_lang}" +if test ! -d "${LangDir}"; then + AC_MSG_ERROR([Cannot find language directory '${LangDir}'.]) +fi + +echo "configuring for ${with_lang} day-of-week and month names..." +rm -f month.xpm weekday.xpm +ln -s "./${LangDir}/month.xpm" . +ln -s "./${LangDir}/weekday.xpm" . + PKG_CHECK_MODULES([x11], [x11]) PKG_CHECK_MODULES([xpm], [xpm]) PKG_CHECK_MODULES([xext], [xext]) diff --git a/wmclock/month.xpm b/wmclock/month.xpm deleted file mode 120000 index 9d65086..0000000 --- a/wmclock/month.xpm +++ /dev/null @@ -1 +0,0 @@ -./lang.english/month.xpm \ No newline at end of file diff --git a/wmclock/weekday.xpm b/wmclock/weekday.xpm deleted file mode 120000 index f7e9add..0000000 --- a/wmclock/weekday.xpm +++ /dev/null @@ -1 +0,0 @@ -./lang.english/weekday.xpm \ No newline at end of file