--disable-iconv configure option

This commit is contained in:
Evan Miller 2021-08-22 11:36:31 -04:00
parent 0346f00735
commit d1369407c5
3 changed files with 26 additions and 15 deletions

View File

@ -7,6 +7,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: [ clang, gcc, gcc-9, gcc-10 ] compiler: [ clang, gcc, gcc-9, gcc-10 ]
iconv: [ enable-iconv, disable-iconv]
glib: [ enable-glib, disable-glib ] glib: [ enable-glib, disable-glib ]
steps: steps:
- name: Install packages - name: Install packages
@ -17,7 +18,7 @@ jobs:
- name: Autoconf - name: Autoconf
run: autoreconf -i -f run: autoreconf -i -f
- name: Configure - name: Configure
run: ./configure --disable-silent-rules --${{ matrix.glib }} --with-unixodbc=/usr run: ./configure --disable-silent-rules --${{ matrix.glib }} --${{ matrix.iconv }} --with-unixodbc=/usr
env: env:
CC: ${{ matrix.compiler }} CC: ${{ matrix.compiler }}
- name: Make - name: Make
@ -44,6 +45,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: [ clang, gcc ] compiler: [ clang, gcc ]
iconv: [ enable-iconv, disable-iconv]
glib: [ enable-glib, disable-glib ] glib: [ enable-glib, disable-glib ]
steps: steps:
- name: Install packages - name: Install packages
@ -54,7 +56,7 @@ jobs:
- name: Autoconf - name: Autoconf
run: autoreconf -i -f run: autoreconf -i -f
- name: Configure - name: Configure
run: ./configure --disable-silent-rules --${{ matrix.glib }} --with-unixodbc=/usr/local/opt run: ./configure --disable-silent-rules --${{ matrix.glib }} --${{ matrix.iconv }} --with-unixodbc=/usr/local/opt
env: env:
CC: ${{ matrix.compiler }} CC: ${{ matrix.compiler }}
YACC: /usr/local/opt/bison/bin/bison YACC: /usr/local/opt/bison/bin/bison

View File

@ -40,7 +40,6 @@ dnl Checks for library functions.
VL_LIB_READLINE VL_LIB_READLINE
AC_CHECK_FUNCS(strptime fmemopen gmtime_r reallocf wcstombs_l vasprintf vasnprintf) AC_CHECK_FUNCS(strptime fmemopen gmtime_r reallocf wcstombs_l vasprintf vasnprintf)
AM_ICONV
AM_GCC_ATTRIBUTE_ALIAS AM_GCC_ATTRIBUTE_ALIAS
dnl Enable large files on 32-bit systems dnl Enable large files on 32-bit systems
@ -88,9 +87,25 @@ CFLAGS="$CFLAGS -Wall -Werror"
AS_CASE([$host], AS_CASE([$host],
[*mingw*|*cygwin*], [LDFLAGS="$LDFLAGS -no-undefined"], []) [*mingw*|*cygwin*], [LDFLAGS="$LDFLAGS -no-undefined"], [])
dnl Fuzz testing dnl See if iconv is present and wanted
AC_ARG_ENABLE(iconv,
AS_HELP_STRING([--disable-iconv], [do not use iconv for character conversions (use locale.h where possible)]),
[enable_iconv=$enableval], [enable_iconv=yes])
AC_ARG_ENABLE([fuzz-testing], AS_HELP_STRING([--enable-fuzz-testing], ["Enable fuzz testing (requires Clang 6 or later)"]), [ HAVE_ICONV_H=0
if test "$enable_iconv" = "yes"; then
AM_ICONV
if test "$am_cv_func_iconv" = "yes"; then
HAVE_ICONV_H=1
fi
fi
AC_SUBST(HAVE_ICONV_H)
dnl Wide-char ODBC driver still requires iconv
AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = "yes")
dnl Fuzz testing
AC_ARG_ENABLE([fuzz-testing], AS_HELP_STRING([--enable-fuzz-testing], [enable fuzz testing (requires Clang 6 or later)]), [
AC_MSG_CHECKING([whether $CC accepts -fsanitize=fuzzer]) AC_MSG_CHECKING([whether $CC accepts -fsanitize=fuzzer])
tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS -fsanitize=fuzzer" _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS -fsanitize=fuzzer"
@ -187,9 +202,6 @@ if test "x$HAVE_ODBC" = "xtrue"; then
OPTDIRS="$OPTDIRS odbc" OPTDIRS="$OPTDIRS odbc"
fi fi
dnl Conditionally build odbc wide version
AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = "yes")
dnl Testing presence of pkg-config dnl Testing presence of pkg-config
AC_MSG_CHECKING([pkg-config m4 macros]) AC_MSG_CHECKING([pkg-config m4 macros])
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) = yes; then if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) = yes; then
@ -220,13 +232,10 @@ fi
AM_CONDITIONAL(FAKE_GLIB, test "x$enable_glib" != "xyes") AM_CONDITIONAL(FAKE_GLIB, test "x$enable_glib" != "xyes")
dnl Set up substitution variables dnl Set up substitution variables
if test "$am_cv_func_iconv" = "yes"; then
HAVE_ICONV_H=1
fi
AC_SUBST(HAVE_ICONV_H)
if test "$ac_cv_header_xlocale_h" = "yes"; then if test "$ac_cv_header_xlocale_h" = "yes"; then
HAVE_XLOCALE_H=1 HAVE_XLOCALE_H=1
else
HAVE_XLOCALE_H=0
fi fi
AC_SUBST(HAVE_XLOCALE_H) AC_SUBST(HAVE_XLOCALE_H)
@ -309,7 +318,7 @@ if test x$HAVE_ODBC = xtrue; then summary=${bold_green}enabled; else summary=${b
AC_MSG_NOTICE([ ODBC : ${summary}${reset}]) AC_MSG_NOTICE([ ODBC : ${summary}${reset}])
if test x$enable_glib = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi if test x$enable_glib = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi
AC_MSG_NOTICE([ GLib : ${summary}${reset}]) AC_MSG_NOTICE([ GLib : ${summary}${reset}])
if test x$am_cv_func_iconv = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi if test x$enable_iconv = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi
AC_MSG_NOTICE([ iconv : ${summary}${reset}]) AC_MSG_NOTICE([ iconv : ${summary}${reset}])
if test x$enable_man = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi if test x$enable_man = xyes; then summary=${bold_green}enabled; else summary=${bold_red}disabled; fi
AC_MSG_NOTICE([ man pages : ${summary}${reset}]) AC_MSG_NOTICE([ man pages : ${summary}${reset}])