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.
This commit is contained in:
Doug Torrance 2014-12-11 09:18:13 -06:00 committed by Carlos R. Mafra
parent 85720f0d1a
commit 2e3c8ec5a1
4 changed files with 21 additions and 3 deletions

View file

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

View file

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

View file

@ -1 +0,0 @@
./lang.english/month.xpm

View file

@ -1 +0,0 @@
./lang.english/weekday.xpm