]> git.draconx.ca Git - cdecl99.git/commitdiff
Fix build with NLS disabled.
authorNick Bowler <nbowler@draconx.ca>
Wed, 21 Sep 2011 23:11:39 +0000 (19:11 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 22 Sep 2011 01:08:57 +0000 (21:08 -0400)
When NLS is disabled, we should not install any .mo files but we still
need to distribute the .po files.  However, ALL_LINGUAS was not being
set in this case, so the POFILES was not set if NLS is disabled, causing
a distcheck failure.

Also fix a build error in this case due to a missing #include.

m4/linguas.m4
src/cdecl99.c

index 5577c8ac79af64acd3d438ef70bd5d4a5608ca33..2ae8a9db32ba529ed2938a4819c5a9f431a3828b 100644 (file)
@@ -16,8 +16,8 @@ AC_REQUIRE([AM_GNU_GETTEXT])
 POFILES=
 MOFILES=
 
-if test -f "$srcdir/$POSUB/LINGUAS"; then
-       ALL_LINGUAS=`sed 's/#.*$//' "$srcdir/$POSUB/LINGUAS"`
+if test -f "$srcdir/po/LINGUAS"; then
+       ALL_LINGUAS=`sed 's/#.*$//' "$srcdir/po/LINGUAS"`
 
        : ${LINGUAS=all}
        if test x"$LINGUAS" != x"all"; then
@@ -36,14 +36,16 @@ if test -f "$srcdir/$POSUB/LINGUAS"; then
        set x $ALL_LINGUAS; shift
        case ${#} in
        0) ;;
-       *) POFILES=`printf "$POSUB/%s.po\n" "${@}"` ;;
+       *) POFILES=`printf "po/%s.po\n" "${@}"` ;;
        esac
 
-       set x $LINGUAS; shift
-       case ${#} in
-       0) ;;
-       *) MOFILES=`printf "$POSUB/%s.mo\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])
index fcd7f50b1bf8821a624d5c3f28c8ff318b712205..04de1a6640e92225676f3e56872a63e26945a70d 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <errno.h>
+#include <locale.h>
 #include <getopt.h>
 #include <gettext.h>
 #include "readline.h"