blob: 2a3ed2c88c8171d4b48754d98738f36005479fd9 [file] [log] [blame]
mmentovai7daf2462006-09-20 21:16:16 +00001# 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.
mmentovai425d2562006-08-30 20:05:05 +000029
30
brynercb91a2f2006-08-25 21:14:45 +000031AC_PREREQ(2.57)
32
mmentovaie5dc6082007-02-14 19:51:05 +000033AC_INIT(breakpad, 0.1, opensource@google.com)
mmentovai425d2562006-08-30 20:05:05 +000034dnl Sanity check: the argument is just a file that should exist.
brynercb91a2f2006-08-25 21:14:45 +000035AC_CONFIG_SRCDIR(README)
mmentovai425d2562006-08-30 20:05:05 +000036AC_CONFIG_AUX_DIR(autotools)
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000037AC_CONFIG_MACRO_DIR([m4])
38AC_CANONICAL_HOST
mmentovai425d2562006-08-30 20:05:05 +000039
jimblandy71f75802010-02-11 19:31:48 +000040AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.11.1)
brynercb91a2f2006-08-25 21:14:45 +000041AM_CONFIG_HEADER(src/config.h)
42
brynercb91a2f2006-08-25 21:14:45 +000043AC_PROG_CC
44AC_PROG_CPP
45AC_PROG_CXX
46
47AC_PROG_LIBTOOL
48AC_SUBST(LIBTOOL_DEPS)
49
brynercb91a2f2006-08-25 21:14:45 +000050AC_HEADER_STDC
nealsidde545c02010-03-02 00:39:48 +000051m4_include(m4/ax_pthread.m4)
52AX_PTHREAD
53
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000054# Only build Linux client libs when compiling for Linux
55case $host in
56 *-*-linux*)
57 LINUX_HOST=true
58 ;;
59esac
60AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue)
61
nealsidde545c02010-03-02 00:39:48 +000062AC_ARG_ENABLE(m32,
63 AS_HELP_STRING([--enable-m32],
64 [Compile/build with -m32]
65 [(default is no)]),
66 [case "${enableval}" in
67 yes)
68 CFLAGS=$(CFLAGS) -m32
69 usem32=true
70 ;;
71 no)
72 usem32=false
73 ;;
74 *)
75 AC_MSG_ERROR(bad value ${enableval} for --enable-m32)
76 ;;
77 esac],
78 [usem32=false])
brynercb91a2f2006-08-25 21:14:45 +000079
ted.mielczarekb2236272010-04-08 23:06:23 +000080AC_CHECK_MEMBER(struct sockaddr.sa_len,
81 [AC_DEFINE([GET_SA_LEN(X)],[(((struct sockaddr*)&(X))->sa_len)],
82 [actual length of specific struct sockaddr])],
83 [AC_DEFINE([GET_SA_LEN(X)],
84 [(((struct sockaddr*)&(X))->sa_family == AF_INET ? sizeof(struct sockaddr_in) : \
85 ((struct sockaddr*)&(X))->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr))],
86 [actual length of specific struct sockaddr])],
87 [#include <sys/socket.h>])
88
mmentovai0dbedc92006-09-25 21:16:15 +000089AC_ARG_ENABLE(selftest,
90 AS_HELP_STRING([--enable-selftest],
91 [Run extra tests with "make check" ]
92 [(may conflict with optimizations) ]
93 [(default is no)]),
94 [case "${enableval}" in
95 yes)
96 selftest=true
97 ;;
98 no)
99 selftest=false
100 ;;
101 *)
102 AC_MSG_ERROR(bad value ${enableval} for --enable-selftest)
103 ;;
104 esac],
105 [selftest=false])
106AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue)
107
brynercb91a2f2006-08-25 21:14:45 +0000108AC_CONFIG_FILES([Makefile])
109AC_OUTPUT