bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CHARSETALIASDIR in TESTS_ENVIRONMENT?


From: Bruno Haible
Subject: Re: CHARSETALIASDIR in TESTS_ENVIRONMENT?
Date: Wed, 26 Dec 2007 16:32:32 +0100
User-agent: KMail/1.5.4

Ben Pfaff wrote:
> The localcharset module has a dependency on "make install" that I
> didn't realize until recently: until "make install" is run,
> locale_charset cannot resolve character set aliases.  For PSPP at
> least, this makes "make check" before "make install" fail, unless
> CHARSETALIASDIR is explicitly set in the environment.

Yes. The same problem also hit the libiconv test suite.

> This makes me wonder whether localcharset should recommend that a
> TESTS_ENVIRONMENT something like this should be used:
>         TESTS_ENVIRONMENT = CHARSETALIASDIR='$(abs_top_builddir)/gl'
> This fixes the problem for PSPP.
>
> localcharset could go one step further by defining a substitution
> variable for use in TESTS_ENVIRONMENT, e.g. for use like this:
>         TEST_ENVIRONMENT = @LOCALCHARSET_TESTENV@
> This is analogous to @FLOOR_LIBM@ etc.

Good points, both of them. I'm applying it, like you say:

2007-12-25  Bruno Haible  <address@hidden>

        * modules/localcharset (Notice): New field.
        (configure.ac): Define LOCALCHARSET_TESTS_ENVIRONMENT.
        Suggested by Ben Pfaff <address@hidden>.

*** modules/localcharset.orig   2007-12-26 02:27:12.000000000 +0100
--- modules/localcharset        2007-12-26 02:24:47.000000000 +0100
***************
*** 1,6 ****
--- 1,12 ----
  Description:
  Return current locale's character encoding.
  
+ Notice:
+ If your package's tests make use of the locale_charset() function directly or
+ indirectly, you may need to define the CHARSETALIASDIR environment variable,
+ so that "make check" works before "make install". In Makefile.am syntax:
+ TESTS_ENVIRONMENT += @LOCALCHARSET_TESTS_ENVIRONMENT@
+ 
  Files:
  lib/localcharset.h
  lib/localcharset.c
***************
*** 16,21 ****
--- 22,29 ----
  
  configure.ac:
  gl_LOCALCHARSET
+ 
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
+ AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
  
  Makefile.am:
  lib_SOURCES += localcharset.h localcharset.c





reply via email to

[Prev in Thread] Current Thread [Next in Thread]