$NetBSD: patch-src_cache.cc_configure.ac,v 1.1 2017/09/15 22:18:00 ast Exp $ * Compile with pre-2016/12/16 v1.36 dirent.h on NetBSD --- configure.ac.orig 2017-03-06 10:29:41.000000000 +0100 +++ configure.ac 2017-09-15 23:47:38.595038637 +0200 @@ -45,6 +45,27 @@ Please install pkg-config and re-run autoconf.]) ]) +dnl Check scandir prototype in dirent.h (NetBSD pre-2016/12/16 v1.36) +AC_MSG_CHECKING([if scandir's compar() expects const void * pointers]) +AC_LANG_WERROR +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ + const char *dirname; + struct dirent ***namelist; + int (*f_select)(const struct dirent *); + int (*f_compar)(const void *, const void *); + scandir(dirname, namelist, f_select, f_compar); + ]])], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED([SCANDIR_COMPAR_USES_CONST_VOID_POINTER], 1, [Define to 1 if you have to use const void * with scandir's compar() function, to 0 if you are using the IEEE Std 1003.1 standard const struct dirent **.]) + ], + [ + AC_MSG_RESULT([no]) + AC_DEFINE_UNQUOTED([SCANDIR_COMPAR_USES_CONST_VOID_POINTER], 0, [Define to 1 if you have to use const void * with scandir's compar() function, to 0 if you are using the IEEE Std 1003.1 standard const struct dirent **.]) + ] +) + dnl Poppler checking PKG_CHECK_MODULES(poppler_cpp, poppler-cpp) AC_SUBST(poppler_cpp_CFLAGS)