Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 1 | ## Process this file with autoconf to produce configure. |
Craig Silverstein | 2b66a84 | 2007-06-12 23:59:42 +0000 | [diff] [blame] | 2 | ## In general, the safest way to proceed is to run ./autogen.sh |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 3 | |
| 4 | # make sure we're interpreted by some minimal autoconf |
| 5 | AC_PREREQ(2.57) |
| 6 | |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame^] | 7 | AC_INIT(gflags, 0.9, opensource@google.com) |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 8 | # The argument here is just something that should be in the current directory |
| 9 | # (for sanity checking) |
| 10 | AC_CONFIG_SRCDIR(README) |
| 11 | AM_INIT_AUTOMAKE |
| 12 | AM_CONFIG_HEADER(src/config.h) |
| 13 | |
| 14 | # Checks for programs. |
| 15 | AC_PROG_CC |
| 16 | AC_PROG_CPP |
| 17 | AC_PROG_CXX |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame^] | 18 | AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 19 | |
| 20 | # Uncomment this if you'll be exporting libraries (.so's) |
| 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 | # These are tested for by AC_HEADER_STDC, but I check again to set the var |
| 28 | AC_CHECK_HEADER(stdint.h, ac_cv_have_stdint_h=1, ac_cv_have_stdint_h=0) |
| 29 | AC_CHECK_HEADER(sys/types.h, ac_cv_have_systypes_h=1, ac_cv_have_systypes_h=0) |
| 30 | AC_CHECK_HEADER(inttypes.h, ac_cv_have_inttypes_h=1, ac_cv_have_inttypes_h=0) |
| 31 | |
| 32 | # These are the types I need. We look for them in either stdint.h, |
| 33 | # sys/types.h, or inttypes.h, all of which are part of the default-includes. |
| 34 | AC_CHECK_TYPE(uint16_t, ac_cv_have_uint16_t=1, ac_cv_have_uint16_t=0) |
| 35 | AC_CHECK_TYPE(u_int16_t, ac_cv_have_u_int16_t=1, ac_cv_have_u_int16_t=0) |
| 36 | AC_CHECK_TYPE(__uint16, ac_cv_have___uint16=1, ac_cv_have___uint16=0) |
| 37 | |
Craig Silverstein | 690172b | 2007-04-20 21:16:33 +0000 | [diff] [blame] | 38 | AC_CHECK_FUNCS(strtoll) |
| 39 | AC_CHECK_FUNCS(strtoq) |
| 40 | |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 41 | AX_C___ATTRIBUTE__ |
Craig Silverstein | eb20839 | 2007-08-15 19:44:54 +0000 | [diff] [blame] | 42 | # We only care about __attribute__ ((unused)) |
| 43 | if test x"$ac_cv___attribute__" = x"yes"; then |
| 44 | ac_cv___attribute__unused="__attribute__ ((unused))" |
| 45 | else |
| 46 | ac_cv___attribute__unused= |
| 47 | fi |
| 48 | |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 49 | ACX_PTHREAD |
| 50 | |
| 51 | # Find out what namespace 'normal' STL code lives in, and also what namespace |
| 52 | # the user wants our classes to be defined in |
| 53 | AC_CXX_STL_NAMESPACE |
| 54 | AC_DEFINE_GOOGLE_NAMESPACE(google) |
| 55 | |
| 56 | # These are what's needed by gflags.h.in |
| 57 | AC_SUBST(ac_google_start_namespace) |
| 58 | AC_SUBST(ac_google_end_namespace) |
| 59 | AC_SUBST(ac_google_namespace) |
Craig Silverstein | eb20839 | 2007-08-15 19:44:54 +0000 | [diff] [blame] | 60 | AC_SUBST(ac_cv___attribute__unused) |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 61 | AC_SUBST(ac_cv_have_stdint_h) |
| 62 | AC_SUBST(ac_cv_have_systypes_h) |
| 63 | AC_SUBST(ac_cv_have_inttypes_h) |
| 64 | AC_SUBST(ac_cv_have_uint16_t) |
| 65 | AC_SUBST(ac_cv_have_u_int16_t) |
| 66 | AC_SUBST(ac_cv_have___uint16) |
| 67 | |
| 68 | ## Check out ../autoconf/ for other macros you can call to do useful stuff |
| 69 | |
| 70 | # Write generated configuration file, and also .h files |
Craig Silverstein | c79c32d | 2008-07-22 23:29:39 +0000 | [diff] [blame^] | 71 | AC_CONFIG_FILES([Makefile src/google/gflags.h src/google/gflags_completions.h]) |
Craig Silverstein | b9f2348 | 2007-03-22 00:15:41 +0000 | [diff] [blame] | 72 | AC_OUTPUT |