@@ -984,6 +984,47 @@ AC_CHECK_LIB([$with_math], [__gmp_get_memory_functions],
984984LIBS="$curr_libs"
985985CPPFLAGS="$curr_cppflags"
986986
987+
988+ # Checks for internationalization stuff
989+
990+ dnl check for iconv is also done for gettext and
991+ dnl the AC_REQUIRE used in the macro below lead to the check
992+ dnl be done outside of the "with_iconv" test, so we only can
993+ dnl revert its effects after the check if disabled.
994+
995+ dnl Note that the AC_REQUIREd macros also output messages for
996+ dnl "how to run the C preprocessor" and "for egrep -e"
997+
998+ AC_ARG_WITH ( [ iconv] ,
999+ [ AS_HELP_STRING ( [ --with-iconv] ,
1000+ [ (GnuCOBOL) Use iconv for character set conversion (default: check)] ) ] ,
1001+ [ ] ,
1002+ [ with_iconv=check] )
1003+
1004+ if test "$with_iconv" = no; then
1005+ am_cv_func_iconv_summary=disabled
1006+ am_cv_func_iconv=no
1007+ fi
1008+
1009+ AS_IF ( [ test "$with_iconv" = yes -o "$with_iconv" = check] , [
1010+ AM_ICONV
1011+ if test "$with_iconv" = yes && test "$am_cv_func_iconv" != yes; then
1012+ AC_MSG_ERROR ( [ iconv library requested but not found] )
1013+ fi
1014+ if test "$am_cv_func_iconv" = yes -a "x$LIBICONV" != x; then
1015+ PROGRAMS_LIBS="$PROGRAMS_LIBS $LTLIBICONV"
1016+ LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBICONV"
1017+ COBC_CPPFLAGS="$COBC_CPPFLAGS $INCICONV"
1018+ LIBCOB_CPPFLAGS="$LIBCOB_CPPFLAGS $INCICONV"
1019+ fi
1020+ ] )
1021+
1022+ if test "$with_iconv" = no; then
1023+ am_cv_func_iconv_summary=disabled
1024+ fi
1025+
1026+ AM_LANGINFO_CODESET
1027+
9871028# Checks for gettext.
9881029
9891030case $host_os in
@@ -1017,27 +1058,6 @@ if test "x$LTLIBINTL" != x; then
10171058 LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL"
10181059fi
10191060
1020- # Checks for internationalization stuff
1021- AM_LANGINFO_CODESET
1022-
1023- AC_ARG_WITH ( [ iconv] ,
1024- [ AS_HELP_STRING ( [ --with-iconv] ,
1025- [ (GnuCOBOL) Use iconv for character set conversion (default: check)] ) ] ,
1026- [ ] ,
1027- [ with_iconv=check] )
1028-
1029- if test "$with_iconv" = yes -o "$with_iconv" = check; then
1030- AM_ICONV
1031- if test "$with_iconv" = yes && test "$am_cv_func_iconv" != yes; then
1032- AC_MSG_ERROR ( [ iconv library requested but not found] )
1033- fi
1034- if test "$am_cv_func_iconv" = yes -a "x$LIBICONV" != x; then
1035- PROGRAMS_LIBS="$PROGRAMS_LIBS $LIBICONV"
1036- LIBCOB_LIBS="$LIBCOB_LIBS $LIBICONV"
1037- fi
1038- fi
1039-
1040-
10411061dnl
10421062dnl Configure options part II (needing compilation)
10431063dnl
0 commit comments