Home | History | Annotate | Download | only in open-vcdiff
      1 ## Process this file with autoconf to produce configure.
      2 ## In general, the safest way to proceed is to run ./autogen.sh
      3 
      4 # make sure we're interpreted by some minimal autoconf
      5 AC_PREREQ(2.57)
      6 
      7 AC_INIT(open-vcdiff, 0.7, opensource@google.com)
      8 AC_CONFIG_SRCDIR(README)
      9 AM_INIT_AUTOMAKE
     10 AM_CONFIG_HEADER(src/config.h)
     11 
     12 # Checks for programs.
     13 AC_PROG_CC
     14 AC_PROG_CPP
     15 AC_PROG_CXX
     16 AM_CONDITIONAL(GCC, test "$GCC" = yes)   # let the Makefile know if we're gcc
     17 AC_CANONICAL_HOST
     18 
     19 # Issue #21:  Fail to test on MinGW 5.1.4
     20 # Disabling fast install keeps libtool from creating wrapper scripts around
     21 # the executables it builds.  Such scripts have caused failures on MinGW.
     22 # Using this option means an extra link step is executed during "make install".
     23 AC_DISABLE_FAST_INSTALL
     24 
     25 AC_PROG_LIBTOOL
     26 AC_SUBST(LIBTOOL_DEPS)
     27 
     28 # Check whether some low-level functions/files are available
     29 AC_HEADER_STDC
     30 
     31 # Built-in memcmp can be inefficient when gcc compiles for x86 processors.
     32 # In those cases, use an alternative function instead of memcmp.
     33 case $host_cpu in
     34   *86*)
     35     if test "$GCC" = "yes"; then
     36       AC_DEFINE(VCDIFF_USE_BLOCK_COMPARE_WORDS, 1,
     37                 Use custom compare function instead of memcmp)
     38     fi
     39     ;;
     40 esac
     41 
     42 AC_CHECK_HEADERS([ext/rope])
     43 AC_CHECK_HEADERS([getopt.h])
     44 AC_CHECK_HEADERS([malloc.h])
     45 AC_CHECK_HEADERS([sys/mman.h])
     46 AC_CHECK_HEADERS([sys/time.h])
     47 AC_CHECK_HEADERS([unistd.h])
     48 AC_CHECK_HEADERS([windows.h])
     49 AC_CHECK_FUNCS([gettimeofday QueryPerformanceCounter])
     50 AC_CHECK_FUNCS([memalign posix_memalign])
     51 AC_CHECK_FUNCS([mprotect])
     52 
     53 # Start of definitions needed by gflags package
     54 
     55 AC_CHECK_HEADERS([stdint.h sys/types.h inttypes.h])
     56 AC_CHECK_HEADERS([fnmatch.h])
     57 AC_CHECK_FUNCS([strtoll strtoq])
     58 AC_CHECK_TYPES([uint16_t, u_int16_t, __int16])
     59 
     60 AX_C___ATTRIBUTE__
     61 
     62 # End of definitions needed by gflags package
     63 
     64 # Solaris 10 6/06 has a bug where /usr/sfw/lib/libstdc++.la is empty.
     65 # If so, we replace it with our own version.
     66 LIBSTDCXX_LA_LINKER_FLAG=
     67 if test -f /usr/sfw/lib/libstdc++.la && ! test -s /usr/sfw/lib/libstdc++.la
     68 then
     69   LIBSTDCXX_LA_LINKER_FLAG='-L$(top_srcdir)/src/solaris'
     70 fi
     71 AC_SUBST(LIBSTDCXX_LA_LINKER_FLAG)
     72 
     73 AC_CONFIG_FILES([Makefile])
     74 AC_OUTPUT
     75