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 | |
mmentovai | e5dc608 | 2007-02-14 19:51:05 +0000 | [diff] [blame] | 33 | AC_INIT(breakpad, 0.1, opensource@google.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) |
| 42 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 43 | AC_PROG_CC |
| 44 | AC_PROG_CPP |
| 45 | AC_PROG_CXX |
| 46 | |
| 47 | AC_PROG_LIBTOOL |
| 48 | AC_SUBST(LIBTOOL_DEPS) |
| 49 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 50 | AC_HEADER_STDC |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 51 | m4_include(m4/ax_pthread.m4) |
| 52 | AX_PTHREAD |
| 53 | |
ted.mielczarek | 53a8b1a | 2010-08-31 15:09:01 +0000 | [diff] [blame] | 54 | # Only build Linux client libs when compiling for Linux |
| 55 | case $host in |
| 56 | *-*-linux*) |
| 57 | LINUX_HOST=true |
| 58 | ;; |
| 59 | esac |
| 60 | AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue) |
| 61 | |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 62 | AC_ARG_ENABLE(m32, |
| 63 | AS_HELP_STRING([--enable-m32], |
| 64 | [Compile/build with -m32] |
| 65 | [(default is no)]), |
| 66 | [case "${enableval}" in |
| 67 | yes) |
thestig@chromium.org | c40bcc7 | 2010-09-16 23:29:13 +0000 | [diff] [blame] | 68 | CFLAGS="${CFLAGS} -m32" |
| 69 | CXXFLAGS="${CXXFLAGS} -m32" |
nealsid | de545c0 | 2010-03-02 00:39:48 +0000 | [diff] [blame] | 70 | usem32=true |
| 71 | ;; |
| 72 | no) |
| 73 | usem32=false |
| 74 | ;; |
| 75 | *) |
| 76 | AC_MSG_ERROR(bad value ${enableval} for --enable-m32) |
| 77 | ;; |
| 78 | esac], |
| 79 | [usem32=false]) |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 80 | |
ted.mielczarek | e574a2a | 2010-10-05 19:38:22 +0000 | [diff] [blame^] | 81 | AC_ARG_ENABLE(processor, |
| 82 | AS_HELP_STRING([--disable-processor], |
| 83 | [Don't build processor library] |
| 84 | [(default is no)]), |
| 85 | [case "${enableval}" in |
| 86 | yes) |
| 87 | disable_processor=false |
| 88 | ;; |
| 89 | no) |
| 90 | disable_processor=true |
| 91 | ;; |
| 92 | *) |
| 93 | AC_MSG_ERROR(bad value ${enableval} for --disable-processor) |
| 94 | ;; |
| 95 | esac], |
| 96 | [disable_processor=false]) |
| 97 | AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue) |
| 98 | |
| 99 | if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue; then |
| 100 | AC_MSG_ERROR([--disable-processor was specified, and not building for Linux. Nothing to build!]) |
| 101 | fi |
| 102 | |
ted.mielczarek | b223627 | 2010-04-08 23:06:23 +0000 | [diff] [blame] | 103 | AC_CHECK_MEMBER(struct sockaddr.sa_len, |
| 104 | [AC_DEFINE([GET_SA_LEN(X)],[(((struct sockaddr*)&(X))->sa_len)], |
| 105 | [actual length of specific struct sockaddr])], |
| 106 | [AC_DEFINE([GET_SA_LEN(X)], |
| 107 | [(((struct sockaddr*)&(X))->sa_family == AF_INET ? sizeof(struct sockaddr_in) : \ |
| 108 | ((struct sockaddr*)&(X))->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr))], |
| 109 | [actual length of specific struct sockaddr])], |
| 110 | [#include <sys/socket.h>]) |
| 111 | |
mmentovai | 0dbedc9 | 2006-09-25 21:16:15 +0000 | [diff] [blame] | 112 | AC_ARG_ENABLE(selftest, |
| 113 | AS_HELP_STRING([--enable-selftest], |
| 114 | [Run extra tests with "make check" ] |
| 115 | [(may conflict with optimizations) ] |
| 116 | [(default is no)]), |
| 117 | [case "${enableval}" in |
| 118 | yes) |
| 119 | selftest=true |
| 120 | ;; |
| 121 | no) |
| 122 | selftest=false |
| 123 | ;; |
| 124 | *) |
| 125 | AC_MSG_ERROR(bad value ${enableval} for --enable-selftest) |
| 126 | ;; |
| 127 | esac], |
| 128 | [selftest=false]) |
| 129 | AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue) |
| 130 | |
bryner | cb91a2f | 2006-08-25 21:14:45 +0000 | [diff] [blame] | 131 | AC_CONFIG_FILES([Makefile]) |
| 132 | AC_OUTPUT |