toolkit/crashreporter/google-breakpad/src/third_party/glog/configure.ac

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/google-breakpad/src/third_party/glog/configure.ac	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,207 @@
     1.4 +## Process this file with autoconf to produce configure.
     1.5 +## In general, the safest way to proceed is to run the following:
     1.6 +##    % aclocal -I . -I `pwd`/../autoconf && autoheader && autoconf && automake
     1.7 +
     1.8 +# make sure we're interpreted by some minimal autoconf
     1.9 +AC_PREREQ(2.57)
    1.10 +
    1.11 +AC_INIT(glog, 0.3.1, opensource@google.com)
    1.12 +# The argument here is just something that should be in the current directory
    1.13 +# (for sanity checking)
    1.14 +AC_CONFIG_SRCDIR(README)
    1.15 +AC_CONFIG_MACRO_DIR([m4])
    1.16 +AM_INIT_AUTOMAKE
    1.17 +AM_CONFIG_HEADER(src/config.h)
    1.18 +
    1.19 +AC_LANG(C++)
    1.20 +
    1.21 +# Checks for programs.
    1.22 +AC_PROG_CC
    1.23 +AC_PROG_CPP
    1.24 +AC_PROG_CXX
    1.25 +AM_CONDITIONAL(GCC, test "$GCC" = yes)   # let the Makefile know if we're gcc
    1.26 +
    1.27 +AC_PROG_LIBTOOL
    1.28 +AC_SUBST(LIBTOOL_DEPS)
    1.29 +
    1.30 +# Check whether some low-level functions/files are available
    1.31 +AC_HEADER_STDC
    1.32 +
    1.33 +# These are tested for by AC_HEADER_STDC, but I check again to set the var
    1.34 +AC_CHECK_HEADER(stdint.h, ac_cv_have_stdint_h=1, ac_cv_have_stdint_h=0)
    1.35 +AC_CHECK_HEADER(sys/types.h, ac_cv_have_systypes_h=1, ac_cv_have_systypes_h=0)
    1.36 +AC_CHECK_HEADER(inttypes.h, ac_cv_have_inttypes_h=1, ac_cv_have_inttypes_h=0)
    1.37 +AC_CHECK_HEADERS(unistd.h, ac_cv_have_unistd_h=1, ac_cv_have_unistd_h=0)
    1.38 +AC_CHECK_HEADERS(syscall.h)
    1.39 +AC_CHECK_HEADERS(sys/syscall.h)
    1.40 +# For backtrace with glibc.
    1.41 +AC_CHECK_HEADERS(execinfo.h)
    1.42 +# For backtrace with libunwind.
    1.43 +AC_CHECK_HEADERS(libunwind.h, ac_cv_have_libunwind_h=1, ac_cv_have_libunwind_h=0)
    1.44 +AC_CHECK_HEADERS(ucontext.h)
    1.45 +AC_CHECK_HEADERS(sys/utsname.h)
    1.46 +AC_CHECK_HEADERS(pwd.h)
    1.47 +AC_CHECK_HEADERS(syslog.h)
    1.48 +AC_CHECK_HEADERS(sys/time.h)
    1.49 +AC_CHECK_HEADERS(glob.h)
    1.50 +
    1.51 +AC_CHECK_SIZEOF(void *)
    1.52 +
    1.53 +# These are the types I need.  We look for them in either stdint.h,
    1.54 +# sys/types.h, or inttypes.h, all of which are part of the default-includes.
    1.55 +AC_CHECK_TYPE(uint16_t, ac_cv_have_uint16_t=1, ac_cv_have_uint16_t=0)
    1.56 +AC_CHECK_TYPE(u_int16_t, ac_cv_have_u_int16_t=1, ac_cv_have_u_int16_t=0)
    1.57 +AC_CHECK_TYPE(__uint16, ac_cv_have___uint16=1, ac_cv_have___uint16=0)
    1.58 +
    1.59 +AC_CHECK_FUNC(sigaltstack,
    1.60 +              AC_DEFINE(HAVE_SIGALTSTACK, 1,
    1.61 +                        [Define if you have the `sigaltstack' function]))
    1.62 +AC_CHECK_FUNC(dladdr,
    1.63 +              AC_DEFINE(HAVE_DLADDR, 1,
    1.64 +                        [Define if you have the `dladdr' function]))
    1.65 +AC_CHECK_FUNC(fcntl,
    1.66 +              AC_DEFINE(HAVE_FCNTL, 1,
    1.67 +                        [Define if you have the `fcntl' function]))
    1.68 +
    1.69 +AX_C___ATTRIBUTE__
    1.70 +# We only care about these two attributes.
    1.71 +if test x"$ac_cv___attribute__" = x"yes"; then
    1.72 +  ac_cv___attribute___noreturn="__attribute__ ((noreturn))"
    1.73 +  ac_cv___attribute___printf_4_5="__attribute__((__format__ (__printf__, 4, 5)))"
    1.74 +else
    1.75 +  ac_cv___attribute___noreturn=
    1.76 +  ac_cv___attribute___printf_4_5=
    1.77 +fi
    1.78 +
    1.79 +AX_C___BUILTIN_EXPECT
    1.80 +if test x"$ac_cv___builtin_expect" = x"yes"; then
    1.81 +  ac_cv_have___builtin_expect=1
    1.82 +else
    1.83 +  ac_cv_have___builtin_expect=0
    1.84 +fi
    1.85 +
    1.86 +AX_C___SYNC_VAL_COMPARE_AND_SWAP
    1.87 +
    1.88 +# On x86_64, instead of libunwind, we can choose to compile with frame-pointers
    1.89 +# (This isn't needed on i386, where -fno-omit-frame-pointer is the default).
    1.90 +AC_ARG_ENABLE(frame_pointers,
    1.91 +              AS_HELP_STRING([--enable-frame-pointers],
    1.92 +                             [On x86_64 systems, compile with -fno-omit-frame-pointer (see INSTALL)]),,
    1.93 +              enable_frame_pointers=no)
    1.94 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __x86_64__ == 1 ? 0 : 1])],
    1.95 +                  [is_x86_64=yes], [is_x86_64=no])
    1.96 +AM_CONDITIONAL(ENABLE_FRAME_POINTERS, test "$enable_frame_pointers" = yes)
    1.97 +AM_CONDITIONAL(X86_64, test "$is_x86_64" = yes)
    1.98 +
    1.99 +# Some of the code in this directory depends on pthreads
   1.100 +ACX_PTHREAD
   1.101 +if test x"$acx_pthread_ok" = x"yes"; then
   1.102 +  # To make libglog depend on libpthread on Linux, we need to add
   1.103 +  # -lpthread in addition to -pthread.
   1.104 +  AC_CHECK_LIB(pthread, pthread_self)
   1.105 +fi
   1.106 +
   1.107 +# Check if there is google-gflags library installed.
   1.108 +SAVE_CFLAGS="$CFLAGS"
   1.109 +SAVE_LIBS="$LIBS"
   1.110 +AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR],
   1.111 +  GFLAGS_CFLAGS="-I${with_gflags}/include"
   1.112 +  GFLAGS_LIBS="-L${with_gflags}/lib -lgflags"
   1.113 +  CFLAGS="$CFLAGS $GFLAGS_CFLAGS"
   1.114 +  LIBS="$LIBS $GFLAGS_LIBS"
   1.115 +)
   1.116 +AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0)
   1.117 +if test x"$ac_cv_have_libgflags" = x"1"; then
   1.118 +  AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library])
   1.119 +  if test x"$GFLAGS_LIBS" = x""; then
   1.120 +    GFLAGS_LIBS="-lgflags"
   1.121 +  fi
   1.122 +else
   1.123 +  GFLAGS_CFLAGS=
   1.124 +  GFLAGS_LIBS=
   1.125 +fi
   1.126 +CFLAGS="$SAVE_CFLAGS"
   1.127 +LIBS="$SAVE_LIBS"
   1.128 +
   1.129 +# TODO(hamaji): Use official m4 macros provided by testing libraries
   1.130 +#               once the m4 macro of Google Mocking becomes ready.
   1.131 +# Check if there is Google Test library installed.
   1.132 +AC_CHECK_PROG(GTEST_CONFIG, gtest-config, "yes")
   1.133 +if test x"$GTEST_CONFIG" = "xyes"; then
   1.134 +  GTEST_CFLAGS=`gtest-config --cppflags --cxxflags`
   1.135 +  GTEST_LIBS=`gtest-config --ldflags --libs`
   1.136 +  AC_DEFINE(HAVE_LIB_GTEST, 1, [define if you have google gtest library])
   1.137 +
   1.138 +  # Check if there is Google Mocking library installed.
   1.139 +  AC_CHECK_PROG(GMOCK_CONFIG, gmock-config, "yes")
   1.140 +  if test x"$GMOCK_CONFIG" = "xyes"; then
   1.141 +    GMOCK_CFLAGS=`gmock-config --cppflags --cxxflags`
   1.142 +    GMOCK_LIBS=`gmock-config --ldflags --libs`
   1.143 +    AC_DEFINE(HAVE_LIB_GMOCK, 1, [define if you have google gmock library])
   1.144 +  else
   1.145 +    # We don't run test cases which use Google Mocking framework.
   1.146 +    GMOCK_CFLAGS=
   1.147 +    GMOCK_LIBS=
   1.148 +  fi
   1.149 +else
   1.150 +  # We'll use src/googletest.h for our unittests.
   1.151 +  GTEST_CFLAGS=
   1.152 +  GTEST_LIBS=
   1.153 +fi
   1.154 +AM_CONDITIONAL(HAVE_GMOCK, test x"$GMOCK_CONFIG" = "xyes")
   1.155 +
   1.156 +# We want to link in libunwind if it exists
   1.157 +UNWIND_LIBS=
   1.158 +# Unfortunately, we need to check the header file in addition to the
   1.159 +# lib file to check if libunwind is available since libunwind-0.98
   1.160 +# doesn't install all necessary header files.
   1.161 +if test x"$ac_cv_have_libunwind_h" = x"1"; then
   1.162 + AC_CHECK_LIB(unwind, backtrace, UNWIND_LIBS=-lunwind)
   1.163 +fi
   1.164 +AC_SUBST(UNWIND_LIBS)
   1.165 +if test x"$UNWIND_LIBS" != x""; then
   1.166 +  AC_DEFINE(HAVE_LIB_UNWIND, 1, [define if you have libunwind])
   1.167 +fi
   1.168 +
   1.169 +# We'd like to use read/write locks in several places in the code.
   1.170 +# See if our pthreads support extends to that.  Note: for linux, it
   1.171 +# does as long as you define _XOPEN_SOURCE appropriately.
   1.172 +AC_RWLOCK
   1.173 +
   1.174 +# Find out what namespace 'normal' STL code lives in, and also what namespace
   1.175 +# the user wants our classes to be defined in
   1.176 +AC_CXX_STL_NAMESPACE
   1.177 +AC_DEFINE_GOOGLE_NAMESPACE(google)
   1.178 +
   1.179 +AC_CXX_USING_OPERATOR
   1.180 +
   1.181 +AC_PC_FROM_UCONTEXT(AC_MSG_WARN(Could not find the PC.  Will not output failed addresses...))
   1.182 +
   1.183 +AC_DEFINE_UNQUOTED(TEST_SRC_DIR, "$srcdir", [location of source code])
   1.184 +
   1.185 +# These are what's needed by logging.h.in and raw_logging.h.in
   1.186 +AC_SUBST(ac_google_start_namespace)
   1.187 +AC_SUBST(ac_google_end_namespace)
   1.188 +AC_SUBST(ac_google_namespace)
   1.189 +AC_SUBST(ac_cv_cxx_using_operator)
   1.190 +AC_SUBST(ac_cv___attribute___noreturn)
   1.191 +AC_SUBST(ac_cv___attribute___printf_4_5)
   1.192 +AC_SUBST(ac_cv_have___builtin_expect)
   1.193 +AC_SUBST(ac_cv_have_stdint_h)
   1.194 +AC_SUBST(ac_cv_have_systypes_h)
   1.195 +AC_SUBST(ac_cv_have_inttypes_h)
   1.196 +AC_SUBST(ac_cv_have_unistd_h)
   1.197 +AC_SUBST(ac_cv_have_uint16_t)
   1.198 +AC_SUBST(ac_cv_have_u_int16_t)
   1.199 +AC_SUBST(ac_cv_have___uint16)
   1.200 +AC_SUBST(ac_cv_have_libgflags)
   1.201 +AC_SUBST(GFLAGS_CFLAGS)
   1.202 +AC_SUBST(GTEST_CFLAGS)
   1.203 +AC_SUBST(GMOCK_CFLAGS)
   1.204 +AC_SUBST(GFLAGS_LIBS)
   1.205 +AC_SUBST(GTEST_LIBS)
   1.206 +AC_SUBST(GMOCK_LIBS)
   1.207 +
   1.208 +# Write generated configuration file
   1.209 +AC_CONFIG_FILES([Makefile src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h])
   1.210 +AC_OUTPUT(libglog.pc)

mercurial