diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-06-19 16:30:56 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-06-19 16:30:56 +0200 |
commit | 10c29ebde574b5bc45df70f313835b0c2e1f3a35 (patch) | |
tree | 3e7c8b6e3c330d533a42c2712eaf636b08dd1514 /acinclude.m4 | |
parent | c245d16a5b18afdb68356f8343e6af7b3c32935b (diff) | |
download | guile-10c29ebde574b5bc45df70f313835b0c2e1f3a35.tar.gz |
configure: Factorize code checking for `iconveh_' constants; use the cache.
* configure.ac: Remove code that determines the values of the `iconveh_'
constants. Use `GUILE_UNISTRING_ICONVEH_VALUES'. instead.
* acinclude.m4 (GUILE_UNISTRING_CONSTANT,
GUILE_UNISTRING_ICONVEH_VALUES): New macros.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 5bd1cedab..4f9c0a161 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -499,6 +499,36 @@ AC_DEFUN([GUILE_LIBUNISTRING_WITH_ICONV_SUPPORT], [ ]) ]) +dnl GUILE_UNISTRING_CONSTANT NAME +dnl +dnl Determine the compile-time value of NAME and define/substitute +dnl `SCM_I_GSC_NAME'. +AC_DEFUN([GUILE_UNISTRING_CONSTANT], [ + m4_pushdef([UPPER_CASE_NAME], + [m4_translit([$1],[abcdefghijklmnopqrstuvwxyz], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ])]) + + AC_CACHE_CHECK([the value of `$1'], [ac_cv_]$1, [ + AC_COMPUTE_INT([ac_cv_]$1, [$1], + [AC_INCLUDES_DEFAULT +#include <uniconv.h> +], + [AC_MSG_ERROR([failed to determine the value of `$1'])]) + ]) + + [SCM_I_GSC_]UPPER_CASE_NAME="$ac_cv_[]$1" + AC_SUBST([SCM_I_GSC_]UPPER_CASE_NAME) + m4_popdef([UPPER_CASE_NAME])]) + +dnl GUILE_UNISTRING_ICONVEH_VALUES +dnl +dnl Determine the values of the `iconveh_' libunistring constants. +AC_DEFUN([GUILE_UNISTRING_ICONVEH_VALUES], [ + GUILE_UNISTRING_CONSTANT([iconveh_error]) + GUILE_UNISTRING_CONSTANT([iconveh_question_mark]) + GUILE_UNISTRING_CONSTANT([iconveh_escape_sequence]) +]) + dnl Declare file $1 to be a script that needs configuring, dnl and arrange to make it executable in the process. AC_DEFUN([GUILE_CONFIG_SCRIPT],[AC_CONFIG_FILES([$1],[chmod +x $1])]) |