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.8.3, opensource@google.com)
      8 AC_CONFIG_SRCDIR(README)
      9 AC_CONFIG_MACRO_DIR(m4)
     10 AM_INIT_AUTOMAKE
     11 AM_CONFIG_HEADER(src/config.h)
     12 
     13 # Checks for programs.
     14 AC_PROG_CC
     15 AC_PROG_CPP
     16 AC_PROG_CXX
     17 AM_CONDITIONAL(GCC, test "$GCC" = yes)   # let the Makefile know if we're gcc
     18 AC_CANONICAL_HOST
     19 
     20 LT_INIT
     21 AC_PROG_LIBTOOL
     22 AC_SUBST(LIBTOOL_DEPS)
     23 
     24 # Check whether some low-level functions/files are available
     25 AC_HEADER_STDC
     26 
     27 # Built-in memcmp can be inefficient when gcc compiles for x86 or PowerPC
     28 # processors.  In those cases, use an alternative function instead of memcmp.
     29 case $host_cpu in
     30   *86*|powerpc*)
     31     if test "$GCC" = "yes"; then
     32       AC_DEFINE(VCDIFF_USE_BLOCK_COMPARE_WORDS, 1,
     33                 Use custom compare function instead of memcmp)
     34     fi
     35     ;;
     36 esac
     37 
     38 AC_CHECK_HEADERS([ext/rope])
     39 AC_CHECK_HEADERS([getopt.h])
     40 AC_CHECK_HEADERS([malloc.h])
     41 AC_CHECK_HEADERS([sys/mman.h])
     42 AC_CHECK_HEADERS([sys/time.h])
     43 AC_CHECK_HEADERS([unistd.h])
     44 AC_CHECK_HEADERS([windows.h])
     45 AC_CHECK_FUNCS([gettimeofday QueryPerformanceCounter])
     46 AC_CHECK_FUNCS([memalign posix_memalign])
     47 AC_CHECK_FUNCS([mprotect])
     48 
     49 # Start of definitions needed by gflags package
     50 
     51 # These are tested for by AC_HEADER_STDC, but I check again to set the var
     52 AC_CHECK_HEADER(stdint.h, ac_cv_have_stdint_h=1, ac_cv_have_stdint_h=0)
     53 AC_CHECK_HEADER(sys/types.h, ac_cv_have_systypes_h=1, ac_cv_have_systypes_h=0)
     54 AC_CHECK_HEADER(inttypes.h, ac_cv_have_inttypes_h=1, ac_cv_have_inttypes_h=0)
     55 AC_CHECK_HEADERS([fnmatch.h])
     56 
     57 # These are the types I need.  We look for them in either stdint.h,
     58 # sys/types.h, or inttypes.h, all of which are part of the default-includes.
     59 AC_CHECK_TYPE(uint16_t, ac_cv_have_uint16_t=1, ac_cv_have_uint16_t=0)
     60 AC_CHECK_TYPE(u_int16_t, ac_cv_have_u_int16_t=1, ac_cv_have_u_int16_t=0)
     61 AC_CHECK_TYPE(__int16, ac_cv_have___int16=1, ac_cv_have___int16=0)
     62 
     63 AC_CHECK_FUNCS([strtoll strtoq])
     64 AC_CHECK_FUNCS([setenv putenv])    # MinGW has putenv but not setenv
     65 
     66 AX_C___ATTRIBUTE__
     67 # We only care about __attribute__ ((unused))
     68 if test x"$ac_cv___attribute__" = x"yes"; then
     69   ac_cv___attribute__unused="__attribute__ ((unused))"
     70 else
     71   ac_cv___attribute__unused=
     72 fi
     73 
     74 ACX_PTHREAD
     75 
     76 # Find out what namespace 'normal' STL code lives in, and also what namespace
     77 # the user wants our classes to be defined in
     78 AC_CXX_STL_NAMESPACE
     79 AC_DEFINE_GOOGLE_NAMESPACE(google)
     80 
     81 # These are what's needed by gflags.h.in
     82 AC_SUBST(ac_google_start_namespace)
     83 AC_SUBST(ac_google_end_namespace)
     84 AC_SUBST(ac_google_namespace)
     85 AC_SUBST(ac_cv___attribute__unused)
     86 AC_SUBST(ac_cv_have_stdint_h)
     87 AC_SUBST(ac_cv_have_systypes_h)
     88 AC_SUBST(ac_cv_have_inttypes_h)
     89 AC_SUBST(ac_cv_have_uint16_t)
     90 AC_SUBST(ac_cv_have_u_int16_t)
     91 AC_SUBST(ac_cv_have___int16)
     92 
     93 # For windows, this has a non-trivial value (__declspec(export)), but any
     94 # system that uses configure wants this to be the empty string.
     95 AC_DEFINE(GFLAGS_DLL_DECL,,
     96           [Always the empty-string on non-windows systems.
     97            On windows, should be "__declspec(dllexport)".
     98            This way, when we compile the dll, we export our functions/classes.
     99            It's safe to define this here because config.h is only used
    100            internally, to compile the DLL, and every DLL source file
    101            #includes "config.h" before anything else.])
    102 
    103 # End of definitions needed by gflags package
    104 
    105 # Solaris 10 6/06 has a bug where /usr/sfw/lib/libstdc++.la is empty.
    106 # If so, we replace it with our own version.
    107 LIBSTDCXX_LA_LINKER_FLAG=
    108 if test -f /usr/sfw/lib/libstdc++.la && ! test -s /usr/sfw/lib/libstdc++.la
    109 then
    110   LIBSTDCXX_LA_LINKER_FLAG='-L$(top_srcdir)/src/solaris'
    111 fi
    112 AC_SUBST(LIBSTDCXX_LA_LINKER_FLAG)
    113 
    114 AC_CONFIG_FILES([Makefile
    115                  gflags/src/gflags/gflags.h
    116                  gflags/src/gflags/gflags_completions.h])
    117 AC_OUTPUT
    118