Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.5 KiB

5 years ago
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.67])
  4. AC_INIT([epdfinfo], 1.0, [politza@fh-trier.de])
  5. AM_INIT_AUTOMAKE([-Wall -Wno-override foreign silent-rules])
  6. AC_CONFIG_SRCDIR([epdfinfo.h])
  7. AC_CONFIG_HEADERS([config.h])
  8. # Checks for programs.
  9. AC_PROG_CC
  10. AM_PROG_CC_C_O
  11. AC_PROG_CXX
  12. AC_PROG_RANLIB
  13. AM_PROG_AR
  14. # Checks for libraries.
  15. HAVE_POPPLER_FIND_OPTS="no (requires poppler-glib >= 0.22)"
  16. HAVE_POPPLER_ANNOT_WRITE="no (requires poppler-glib >= 0.19.4)"
  17. HAVE_POPPLER_ANNOT_MARKUP="no (requires poppler-glib >= 0.26)"
  18. PKG_CHECK_MODULES([png], [libpng])
  19. PKG_CHECK_MODULES([glib], [glib-2.0])
  20. PKG_CHECK_MODULES([poppler], [poppler])
  21. PKG_CHECK_MODULES([poppler_glib], [poppler-glib >= 0.16.0])
  22. PKG_CHECK_EXISTS([poppler-glib >= 0.19.4], [HAVE_POPPLER_ANNOT_WRITE=yes])
  23. PKG_CHECK_EXISTS([poppler-glib >= 0.22], [HAVE_POPPLER_FIND_OPTS=yes])
  24. PKG_CHECK_EXISTS([poppler-glib >= 0.26], [HAVE_POPPLER_ANNOT_MARKUP=yes])
  25. PKG_CHECK_MODULES([zlib], [zlib])
  26. AC_COMPILE_IFELSE(
  27. [AC_LANG_PROGRAM([[
  28. #ifndef _WIN32
  29. error
  30. #endif
  31. ]])], [have_w32=true], [have_w32=false])
  32. AM_CONDITIONAL(HAVE_W32, [test "$have_w32" = true])
  33. if test "$have_w32" = true; then
  34. if test "$MSYSTEM" = MINGW32 -o "$MSYSTEM" = MINGW64; then
  35. # glib won't work properly on msys2 without it.
  36. CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CFLAGS"
  37. fi
  38. fi
  39. SAVED_CPPFLAGS=$CPPFLAGS
  40. CPPFLAGS=$poppler_CFLAGS
  41. AC_LANG_PUSH([C++])
  42. # Check if we can use the -std=c++11 option.
  43. m4_include([m4/ax_check_compile_flag.m4])
  44. AX_CHECK_COMPILE_FLAG([-std=c++11], [HAVE_STD_CXX11=yes])
  45. if test "$HAVE_STD_CXX11" = yes; then
  46. CXXFLAGS="-std=c++11 $CXXFLAGS"
  47. fi
  48. # Check for private poppler header.
  49. AC_CHECK_HEADERS([Annot.h PDFDocEncoding.h], [],
  50. AC_MSG_ERROR([cannot find necessary poppler-private header (see README.org)]))
  51. AC_LANG_POP([C++])
  52. CPPFLAGS=$SAVED_CPPFLAGS
  53. # Setup compile time features.
  54. if test "$HAVE_POPPLER_FIND_OPTS" = yes; then
  55. AC_DEFINE([HAVE_POPPLER_FIND_OPTS],1,
  56. [Define to 1 to enable case sensitive searching (requires poppler-glib >= 0.22).])
  57. fi
  58. if test "$HAVE_POPPLER_ANNOT_WRITE" = yes; then
  59. AC_DEFINE([HAVE_POPPLER_ANNOT_WRITE],1,
  60. [Define to 1 to enable writing of annotations (requires poppler-glib >= 0.19.4).])
  61. fi
  62. if test "$HAVE_POPPLER_ANNOT_MARKUP" = yes; then
  63. AC_DEFINE([HAVE_POPPLER_ANNOT_MARKUP],1,
  64. [Define to 1 to enable adding of markup annotations (requires poppler-glib >= 0.26).])
  65. fi
  66. AC_CANONICAL_HOST
  67. # Checks for header files.
  68. AC_CHECK_HEADERS([stdlib.h string.h strings.h err.h])
  69. AC_MSG_CHECKING([for error.h])
  70. SAVED_CFLAGS=$CFLAGS
  71. CFLAGS="$poppler_CFLAGS $poppler_glib_CFLAGS"
  72. AC_LANG_PUSH([C])
  73. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  74. #include <error.h>
  75. ],[error (0, 0, "");])],
  76. [AC_DEFINE([HAVE_ERROR_H],1, [Define to 1 if error.h is usable.])
  77. AC_MSG_RESULT([yes])],
  78. AC_MSG_RESULT([no]))
  79. AC_LANG_POP([C])
  80. CFLAGS=$SAVED_CFLAGS
  81. # Checks for typedefs, structures, and compiler characteristics.
  82. AC_TYPE_SIZE_T
  83. AC_TYPE_SSIZE_T
  84. AC_CHECK_TYPES([ptrdiff_t])
  85. AC_C_BIGENDIAN
  86. # Checks for library functions.
  87. AC_FUNC_ERROR_AT_LINE
  88. AC_FUNC_STRTOD
  89. AC_CHECK_FUNCS([strcspn strtol getline])
  90. AC_CONFIG_FILES([Makefile])
  91. AC_OUTPUT
  92. echo
  93. echo "Is case-sensitive searching enabled ? ${HAVE_POPPLER_FIND_OPTS}"
  94. echo "Is modifying text annotations enabled ? ${HAVE_POPPLER_ANNOT_WRITE}"
  95. echo "Is modifying markup annotations enabled ? ${HAVE_POPPLER_ANNOT_MARKUP}"
  96. echo