diff options
Diffstat (limited to 'Build/source/texk/lcdf-typetools/configure.ac')
-rw-r--r-- | Build/source/texk/lcdf-typetools/configure.ac | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/Build/source/texk/lcdf-typetools/configure.ac b/Build/source/texk/lcdf-typetools/configure.ac index 38678afc7a6..490afd71bb7 100644 --- a/Build/source/texk/lcdf-typetools/configure.ac +++ b/Build/source/texk/lcdf-typetools/configure.ac @@ -144,30 +144,57 @@ AC_CHECK_HEADERS(new.h unistd.h) dnl -dnl functions such as strerror, working strtod, strtoul, time -dnl headers such as unistd.h +dnl endianness +dnl + +AC_C_BIGENDIAN(, [AC_DEFINE([WORDS_LITTLEENDIAN], 1, [Define to 1 if your processor stores words with the least significant byte + first (like Intel and VAX, unlike Motorola and SPARC).])]) + + +dnl +dnl functions such as strerror, working strtod, working strnlen, strtoul, +dnl time headers such as unistd.h dnl AC_LANG_C need_fixlibc=0 -AC_CHECK_FUNCS(strerror, :, [need_fixlibc=1]) +AC_CHECK_FUNCS([strerror], [:], [need_fixlibc=1]) -AC_CACHE_CHECK(whether strtod works, ac_cv_working_strtod, +AC_CACHE_CHECK([for broken strtod], [ac_cv_broken_strtod], [AC_TRY_RUN([#include <stdio.h> #include <stdlib.h> int main(int c, char **v) { char s[] = "12 "; char *endp; double d = strtod(s, &endp); - exit(*endp == 0 ? 1 : 0); -}], [ac_cv_working_strtod=yes], [ac_cv_working_strtod=no], -[ac_cv_working_strtod=yes])]) -if test "x$ac_cv_working_strtod" = xno; then + return (s + 2) == endp; +}], [ac_cv_broken_strtod=yes], [ac_cv_broken_strtod=no], +[ac_cv_broken_strtod=no])]) +if test "x$ac_cv_broken_strtod" = xyes; then need_fixlibc=1 - AC_DEFINE(BROKEN_STRTOD, 1, [Define if strtod is broken.]) + AC_DEFINE(HAVE_BROKEN_STRTOD, 1, [Define if strtod is broken.]) +fi + +AC_LANG_CPLUSPLUS +AC_CHECK_DECLS([strnlen]) +AC_LANG_C +AC_CHECK_FUNCS([strnlen], [have_strnlen=1], [need_fixlibc=1]) +if test "x$have_strnlen" = x1; then + AC_CACHE_CHECK([for broken strnlen], [ac_cv_broken_strnlen], + [AC_TRY_RUN([#include <string.h> +#include <stdio.h> +int main(int c, char **v) { + char s[] = "01234567891"; + return strnlen(s, 10) == 10; +}], [ac_cv_broken_strnlen=yes], [ac_cv_broken_strnlen=no], +[ac_cv_broken_strnlen=no])]) + if test "x$ac_cv_broken_strnlen" = xyes; then + need_fixlibc=1 + AC_DEFINE([HAVE_BROKEN_STRNLEN], [1], [Define if strnlen is broken.]) + fi fi -AC_CHECK_FUNCS([ctime ftruncate mkstemp sigaction strnlen strtoul waitpid]) +AC_CHECK_FUNCS([ctime ftruncate mkstemp sigaction strdup strtoul vsnprintf waitpid]) AC_CHECK_FUNC([floor], [:], [AC_CHECK_LIB(m, floor)]) AC_CHECK_FUNC([fabs], [:], [AC_CHECK_LIB(m, fabs)]) AC_CHECK_HEADERS([unistd.h fcntl.h sys/time.h sys/wait.h]) |