summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2020-11-15 22:51:38 +0100
committerOneric <oneric@oneric.stub>2021-02-15 20:24:11 +0100
commitce2e4f524b86ac942041babed340cc8d7acfd2f9 (patch)
treedb09846621667a89f4b0b8b087f622b73996a100
parent425e604d83818c4de565e8d47098687da06808cb (diff)
downloadlibass-ce2e4f524b86ac942041babed340cc8d7acfd2f9.tar.bz2
libass-ce2e4f524b86ac942041babed340cc8d7acfd2f9.tar.xz
configure: let USE_ICONV depend on a usable iconv.h
The result of the stdint.h check is neither used in the config script nor the code; remove the superfluous stdint-h check. As we do not use AC_CHECK_HEADERS (not-)found-callbacks or its additional includes, AC_CHECK_HEADERS_ONCE is sufficient and a tad faster; replace AC_CHECK_HEADERS with AC_CHECK_HEADERS_ONCE.
-rw-r--r--configure.ac22
1 files changed, 12 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 89f6e86..40c7eec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ AM_PROG_CC_C_O
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
-AC_CHECK_HEADERS([stdint.h iconv.h])
+AC_CHECK_HEADERS_ONCE([iconv.h])
# Checks for library functions.
AC_CHECK_FUNCS([strdup strndup])
@@ -43,15 +43,17 @@ AC_ARG_ENABLE([large-tiles], AS_HELP_STRING([--enable-large-tiles],
# and add packages to pkg-config for static linking
OLDLIBS="$LIBS"
LIBS=
-use_libiconv=false
-## Some iconv libraries like GNU's libiconv define iconv_open as a macro to
-## libiconv_open. As SEARCH_LIBS tests linking not compilation, check for
-## libiconv_open first. SEARCH_LIBS is smart enough to not add -liconv a second
-## time in case both versions are defined in the local libiconv.
-AC_SEARCH_LIBS([libiconv_open], [iconv], use_libiconv=true)
-AC_SEARCH_LIBS([iconv_open], [iconv], use_libiconv=true)
-AS_IF([test "x$use_libiconv" = xtrue], [
- AC_DEFINE(CONFIG_ICONV, 1, [use iconv])
+AS_IF([test "x$ac_cv_header_iconv_h" = xyes], [
+ ## Some iconv libraries like GNU's libiconv define iconv_open as a macro to
+ ## libiconv_open. As SEARCH_LIBS tests linking not compilation, check for
+ ## libiconv_open first. SEARCH_LIBS is smart enough to not add -liconv a second
+ ## time in case both versions are defined in the local libiconv.
+ use_libiconv=false
+ AC_SEARCH_LIBS([libiconv_open], [iconv], use_libiconv=true)
+ AC_SEARCH_LIBS([iconv_open], [iconv], use_libiconv=true)
+ AS_IF([test "x$use_libiconv" = xtrue], [
+ AC_DEFINE(CONFIG_ICONV, 1, [use iconv])
+ ])
])
# Locate math functions. Most systems have it either in libc or libm, but a few
# have some, eg C89, functions in libc and others in libm. Use C99 lrint to probe.