mmentovai | 7daf246 | 2006-09-20 21:16:16 +0000 | [diff] [blame] | 1 | # Copyright (c) 2006, Google Inc. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are |
| 6 | # met: |
| 7 | # |
| 8 | # * Redistributions of source code must retain the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer. |
| 10 | # * Redistributions in binary form must reproduce the above |
| 11 | # copyright notice, this list of conditions and the following disclaimer |
| 12 | # in the documentation and/or other materials provided with the |
| 13 | # distribution. |
| 14 | # * Neither the name of Google Inc. nor the names of its |
| 15 | # contributors may be used to endorse or promote products derived from |
| 16 | # this software without specific prior written permission. |
| 17 | # |
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mmentovai | 425d256 | 2006-08-30 20:05:05 +0000 | [diff] [blame] | 29 | |
| 30 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 31 | AC_PREREQ(2.57) |
| 32 | |
thestig@chromium.org | 43e6db7 | 2010-11-08 19:49:41 +0000 | [diff] [blame] | 33 | AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com) |
mmentovai | 425d256 | 2006-08-30 20:05:05 +0000 | [diff] [blame] | 34 | dnl Sanity check: the argument is just a file that should exist. |
Mark Mentovai | f74c85d | 2015-09-23 10:46:55 -0400 | [diff] [blame] | 35 | AC_CONFIG_SRCDIR(README.md) |
mmentovai | 425d256 | 2006-08-30 20:05:05 +0000 | [diff] [blame] | 36 | AC_CONFIG_AUX_DIR(autotools) |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 37 | AC_CONFIG_MACRO_DIR([m4]) |
| 38 | AC_CANONICAL_HOST |
mmentovai | 425d256 | 2006-08-30 20:05:05 +0000 | [diff] [blame] | 39 | |
jimblandy | 71f7580 | 2010-02-11 19:31:48 +0000 | [diff] [blame] | 40 | AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.11.1) |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 41 | AM_CONFIG_HEADER(src/config.h) |
ted.mielczarek@gmail.com | 07bb231 | 2013-12-10 12:28:11 +0000 | [diff] [blame] | 42 | AM_MAINTAINER_MODE |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 43 | |
Mike Frysinger | f217ae4 | 2015-11-11 13:43:14 -0500 | [diff] [blame] | 44 | AM_PROG_AR |
digit@chromium.org | 7e3c538 | 2012-08-31 18:38:29 +0000 | [diff] [blame] | 45 | AM_PROG_AS |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 46 | AC_PROG_CC |
ted.mielczarek | d192a71 | 2010-10-05 19:38:51 +0000 | [diff] [blame] | 47 | AM_PROG_CC_C_O |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 48 | AC_PROG_CPP |
| 49 | AC_PROG_CXX |
ted.mielczarek | d192a71 | 2010-10-05 19:38:51 +0000 | [diff] [blame] | 50 | AC_PROG_RANLIB |
ivan.penkov@gmail.com | 5f6e1f0 | 2012-07-02 22:55:57 +0000 | [diff] [blame] | 51 | AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 52 | |
vapier@chromium.org | 302124a | 2013-12-10 06:28:08 +0000 | [diff] [blame] | 53 | dnl This must come before all the feature tests below. |
| 54 | AC_ARG_ENABLE(m32, |
| 55 | AS_HELP_STRING([--enable-m32], |
| 56 | [Compile/build with -m32] |
| 57 | [(default is no)]), |
| 58 | [case "${enableval}" in |
| 59 | yes) |
| 60 | CFLAGS="${CFLAGS} -m32" |
| 61 | CXXFLAGS="${CXXFLAGS} -m32" |
| 62 | usem32=true |
| 63 | ;; |
| 64 | no) |
| 65 | usem32=false |
| 66 | ;; |
| 67 | *) |
| 68 | AC_MSG_ERROR(bad value ${enableval} for --enable-m32) |
| 69 | ;; |
| 70 | esac], |
| 71 | [usem32=false]) |
| 72 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 73 | AC_HEADER_STDC |
vapier@chromium.org | 302124a | 2013-12-10 06:28:08 +0000 | [diff] [blame] | 74 | AC_SYS_LARGEFILE |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 75 | AX_PTHREAD |
ted.mielczarek | dbf409c | 2011-02-28 14:05:22 +0000 | [diff] [blame] | 76 | AC_CHECK_HEADERS([a.out.h]) |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 77 | |
Lei Zhang | 728bcdf | 2016-01-08 00:27:48 -0800 | [diff] [blame] | 78 | AX_CXX_COMPILE_STDCXX(11, noext, mandatory) |
| 79 | |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 80 | # Only build Linux client libs when compiling for Linux |
| 81 | case $host in |
digit@chromium.org | 62d486b | 2012-08-21 14:34:48 +0000 | [diff] [blame] | 82 | *-*-linux* | *-android* ) |
| 83 | LINUX_HOST=true |
| 84 | ;; |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 85 | esac |
| 86 | AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue) |
| 87 | |
digit@chromium.org | 62d486b | 2012-08-21 14:34:48 +0000 | [diff] [blame] | 88 | # Only use Android support headers when compiling for Android |
| 89 | case $host in |
| 90 | *-android*) |
| 91 | ANDROID_HOST=true |
| 92 | ;; |
| 93 | esac |
| 94 | AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue) |
| 95 | |
Mike Frysinger | 3f736ce | 2016-01-27 16:45:21 -0500 | [diff] [blame] | 96 | # Some tools (like mac ones) only support x86 currently. |
| 97 | case $host_cpu in |
| 98 | i?86|x86_64) |
| 99 | X86_HOST=true |
| 100 | ;; |
| 101 | esac |
| 102 | AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue) |
| 103 | |
ted.mielczarek | e574a2a | 2010-10-05 19:38:22 +0000 | [diff] [blame] | 104 | AC_ARG_ENABLE(processor, |
| 105 | AS_HELP_STRING([--disable-processor], |
| 106 | [Don't build processor library] |
| 107 | [(default is no)]), |
| 108 | [case "${enableval}" in |
| 109 | yes) |
| 110 | disable_processor=false |
| 111 | ;; |
| 112 | no) |
| 113 | disable_processor=true |
| 114 | ;; |
| 115 | *) |
| 116 | AC_MSG_ERROR(bad value ${enableval} for --disable-processor) |
| 117 | ;; |
| 118 | esac], |
| 119 | [disable_processor=false]) |
| 120 | AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue) |
| 121 | |
ted.mielczarek | dbf409c | 2011-02-28 14:05:22 +0000 | [diff] [blame] | 122 | AC_ARG_ENABLE(tools, |
| 123 | AS_HELP_STRING([--disable-tools], |
| 124 | [Don't build tool binaries] |
| 125 | [(default is no)]), |
| 126 | [case "${enableval}" in |
| 127 | yes) |
| 128 | disable_tools=false |
| 129 | ;; |
| 130 | no) |
| 131 | disable_tools=true |
| 132 | ;; |
| 133 | *) |
| 134 | AC_MSG_ERROR(bad value ${enableval} for --disable-tools) |
| 135 | ;; |
| 136 | esac], |
| 137 | [disable_tools=false]) |
| 138 | AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue) |
| 139 | |
| 140 | if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then |
| 141 | AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!]) |
ted.mielczarek | e574a2a | 2010-10-05 19:38:22 +0000 | [diff] [blame] | 142 | fi |
| 143 | |
Mike Frysinger | f820ead | 2016-01-25 19:27:56 -0500 | [diff] [blame] | 144 | AC_ARG_ENABLE(system-test-libs, |
| 145 | AS_HELP_STRING([--enable-system-test-libs], |
| 146 | [Use gtest/gmock/etc... from the system instead ] |
| 147 | [of the local copies (default is local)]), |
| 148 | [case "${enableval}" in |
| 149 | yes) |
| 150 | system_test_libs=true |
| 151 | ;; |
| 152 | no) |
| 153 | system_test_libs=false |
| 154 | ;; |
| 155 | *) |
| 156 | AC_MSG_ERROR(bad value ${enableval} for --enable-system-test-libs) |
| 157 | ;; |
| 158 | esac], |
| 159 | [system_test_libs=false]) |
| 160 | AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue) |
| 161 | |
| 162 | AC_ARG_VAR([GMOCK_CONFIG], [Path to gmock-config script]) |
| 163 | AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock]) |
| 164 | AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock]) |
| 165 | AC_ARG_VAR([GTEST_CONFIG], [Path to gtest-config script]) |
| 166 | AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest]) |
| 167 | AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest]) |
| 168 | if test x$system_test_libs = xtrue; then |
| 169 | AC_CHECK_TOOL([GMOCK_CONFIG], [gmock-config]) |
| 170 | AC_CHECK_TOOL([GTEST_CONFIG], [gtest-config]) |
| 171 | GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags` |
| 172 | GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs` |
| 173 | GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags` |
| 174 | GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs` |
| 175 | fi |
| 176 | |
mmentovai | 0dbedc9 | 2006-09-25 21:16:15 +0000 | [diff] [blame] | 177 | AC_ARG_ENABLE(selftest, |
| 178 | AS_HELP_STRING([--enable-selftest], |
| 179 | [Run extra tests with "make check" ] |
| 180 | [(may conflict with optimizations) ] |
| 181 | [(default is no)]), |
| 182 | [case "${enableval}" in |
| 183 | yes) |
| 184 | selftest=true |
| 185 | ;; |
| 186 | no) |
| 187 | selftest=false |
| 188 | ;; |
| 189 | *) |
| 190 | AC_MSG_ERROR(bad value ${enableval} for --enable-selftest) |
| 191 | ;; |
| 192 | esac], |
| 193 | [selftest=false]) |
| 194 | AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue) |
| 195 | |
Ted Mielczarek | 2ecb2ba | 2016-10-24 15:16:28 -0400 | [diff] [blame] | 196 | AC_ARG_WITH(rust-demangle, |
| 197 | AS_HELP_STRING([--with-rust-demangle=/path/to/rust-demangle-capi], |
| 198 | [Link against the rust-demangle library] |
| 199 | [to demangle Rust language symbols during] |
| 200 | [symbol dumping (default is no)] |
| 201 | [Pass the path to the crate root.]), |
| 202 | [case "${withval}" in |
| 203 | yes) |
| 204 | AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle) |
| 205 | ;; |
| 206 | no) |
| 207 | rust_demangle=false |
| 208 | ;; |
| 209 | *) |
| 210 | if ! test -f "${withval}/Cargo.toml"; then |
| 211 | AC_MSG_ERROR(You must pass the path to the rust-demangle-capi crate for --with-rust-demangle) |
| 212 | fi |
| 213 | RUST_DEMANGLE_CFLAGS="-DHAVE_RUST_DEMANGLE -I${withval}/target/include" |
| 214 | RUST_DEMANGLE_LIBS="-L${withval}/target/release -lrust_demangle -lpthread -ldl" |
| 215 | ;; |
| 216 | esac], |
| 217 | [rust_demangle=false]) |
| 218 | AC_ARG_VAR([RUST_DEMANGLE_CFLAGS], [Compiler flags for rust-demangle]) |
| 219 | AC_ARG_VAR([RUST_DEMANGLE_LIBS], [Linker flags for rust-demangle]) |
| 220 | |
vapier@chromium.org | 1b309ed | 2014-08-27 02:10:55 +0000 | [diff] [blame] | 221 | AC_CONFIG_FILES(m4_flatten([ |
| 222 | breakpad.pc |
| 223 | breakpad-client.pc |
| 224 | Makefile |
| 225 | ])) |
| 226 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 227 | AC_OUTPUT |