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. |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 35 | AC_CONFIG_SRCDIR(README) |
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 | 67ce33b | 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 | |
digit@chromium.org | 979d8f4 | 2012-08-31 18:38:29 +0000 | [diff] [blame] | 44 | AM_PROG_AS |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 45 | AC_PROG_CC |
ted.mielczarek | d192a71 | 2010-10-05 19:38:51 +0000 | [diff] [blame] | 46 | AM_PROG_CC_C_O |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 47 | AC_PROG_CPP |
| 48 | AC_PROG_CXX |
ted.mielczarek | d192a71 | 2010-10-05 19:38:51 +0000 | [diff] [blame] | 49 | AC_PROG_RANLIB |
ivan.penkov@gmail.com | b732342 | 2012-07-02 22:55:57 +0000 | [diff] [blame] | 50 | 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] | 51 | |
vapier@chromium.org | 597e2a7 | 2013-12-10 06:28:08 +0000 | [diff] [blame] | 52 | dnl This must come before all the feature tests below. |
| 53 | AC_ARG_ENABLE(m32, |
| 54 | AS_HELP_STRING([--enable-m32], |
| 55 | [Compile/build with -m32] |
| 56 | [(default is no)]), |
| 57 | [case "${enableval}" in |
| 58 | yes) |
| 59 | CFLAGS="${CFLAGS} -m32" |
| 60 | CXXFLAGS="${CXXFLAGS} -m32" |
| 61 | usem32=true |
| 62 | ;; |
| 63 | no) |
| 64 | usem32=false |
| 65 | ;; |
| 66 | *) |
| 67 | AC_MSG_ERROR(bad value ${enableval} for --enable-m32) |
| 68 | ;; |
| 69 | esac], |
| 70 | [usem32=false]) |
| 71 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 72 | AC_HEADER_STDC |
vapier@chromium.org | 597e2a7 | 2013-12-10 06:28:08 +0000 | [diff] [blame] | 73 | AC_SYS_LARGEFILE |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 74 | m4_include(m4/ax_pthread.m4) |
| 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 | |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 78 | # Only build Linux client libs when compiling for Linux |
| 79 | case $host in |
digit@chromium.org | ed58167 | 2012-08-21 14:34:48 +0000 | [diff] [blame] | 80 | *-*-linux* | *-android* ) |
| 81 | LINUX_HOST=true |
| 82 | ;; |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 83 | esac |
| 84 | AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue) |
| 85 | |
digit@chromium.org | ed58167 | 2012-08-21 14:34:48 +0000 | [diff] [blame] | 86 | # Only use Android support headers when compiling for Android |
| 87 | case $host in |
| 88 | *-android*) |
| 89 | ANDROID_HOST=true |
| 90 | ;; |
| 91 | esac |
| 92 | AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue) |
| 93 | |
ted.mielczarek | e574a2a | 2010-10-05 19:38:22 +0000 | [diff] [blame] | 94 | AC_ARG_ENABLE(processor, |
| 95 | AS_HELP_STRING([--disable-processor], |
| 96 | [Don't build processor library] |
| 97 | [(default is no)]), |
| 98 | [case "${enableval}" in |
| 99 | yes) |
| 100 | disable_processor=false |
| 101 | ;; |
| 102 | no) |
| 103 | disable_processor=true |
| 104 | ;; |
| 105 | *) |
| 106 | AC_MSG_ERROR(bad value ${enableval} for --disable-processor) |
| 107 | ;; |
| 108 | esac], |
| 109 | [disable_processor=false]) |
| 110 | AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue) |
| 111 | |
ted.mielczarek | dbf409c | 2011-02-28 14:05:22 +0000 | [diff] [blame] | 112 | AC_ARG_ENABLE(tools, |
| 113 | AS_HELP_STRING([--disable-tools], |
| 114 | [Don't build tool binaries] |
| 115 | [(default is no)]), |
| 116 | [case "${enableval}" in |
| 117 | yes) |
| 118 | disable_tools=false |
| 119 | ;; |
| 120 | no) |
| 121 | disable_tools=true |
| 122 | ;; |
| 123 | *) |
| 124 | AC_MSG_ERROR(bad value ${enableval} for --disable-tools) |
| 125 | ;; |
| 126 | esac], |
| 127 | [disable_tools=false]) |
| 128 | AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue) |
| 129 | |
| 130 | if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then |
| 131 | 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] | 132 | fi |
| 133 | |
mmentovai | 0dbedc9 | 2006-09-25 21:16:15 +0000 | [diff] [blame] | 134 | AC_ARG_ENABLE(selftest, |
| 135 | AS_HELP_STRING([--enable-selftest], |
| 136 | [Run extra tests with "make check" ] |
| 137 | [(may conflict with optimizations) ] |
| 138 | [(default is no)]), |
| 139 | [case "${enableval}" in |
| 140 | yes) |
| 141 | selftest=true |
| 142 | ;; |
| 143 | no) |
| 144 | selftest=false |
| 145 | ;; |
| 146 | *) |
| 147 | AC_MSG_ERROR(bad value ${enableval} for --enable-selftest) |
| 148 | ;; |
| 149 | esac], |
| 150 | [selftest=false]) |
| 151 | AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue) |
| 152 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 153 | AC_CONFIG_FILES([Makefile]) |
| 154 | AC_OUTPUT |