dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

configure.ac (3017B)


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