blob: c2dc7b3faf52480bfbc922bf5107475c3da03120 [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
thestig@chromium.org43e6db72010-11-08 19:49:41 +000033AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com)
mmentovai425d2562006-08-30 20:05:05 +000034dnl Sanity check: the argument is just a file that should exist.
Mark Mentovaif74c85d2015-09-23 10:46:55 -040035AC_CONFIG_SRCDIR(README.md)
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)
ted.mielczarek@gmail.com07bb2312013-12-10 12:28:11 +000042AM_MAINTAINER_MODE
brynercb91a2f2006-08-25 21:14:45 +000043
Mike Frysingerf217ae42015-11-11 13:43:14 -050044AM_PROG_AR
digit@chromium.org7e3c5382012-08-31 18:38:29 +000045AM_PROG_AS
brynercb91a2f2006-08-25 21:14:45 +000046AC_PROG_CC
ted.mielczarekd192a712010-10-05 19:38:51 +000047AM_PROG_CC_C_O
brynercb91a2f2006-08-25 21:14:45 +000048AC_PROG_CPP
49AC_PROG_CXX
ted.mielczarekd192a712010-10-05 19:38:51 +000050AC_PROG_RANLIB
ivan.penkov@gmail.com5f6e1f02012-07-02 22:55:57 +000051AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
brynercb91a2f2006-08-25 21:14:45 +000052
vapier@chromium.org302124a2013-12-10 06:28:08 +000053dnl This must come before all the feature tests below.
54AC_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
brynercb91a2f2006-08-25 21:14:45 +000073AC_HEADER_STDC
vapier@chromium.org302124a2013-12-10 06:28:08 +000074AC_SYS_LARGEFILE
nealsidde545c02010-03-02 00:39:48 +000075AX_PTHREAD
ted.mielczarekdbf409c2011-02-28 14:05:22 +000076AC_CHECK_HEADERS([a.out.h])
nealsidde545c02010-03-02 00:39:48 +000077
Lei Zhang728bcdf2016-01-08 00:27:48 -080078AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
79
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000080# Only build Linux client libs when compiling for Linux
81case $host in
digit@chromium.org62d486b2012-08-21 14:34:48 +000082 *-*-linux* | *-android* )
83 LINUX_HOST=true
84 ;;
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000085esac
86AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue)
87
digit@chromium.org62d486b2012-08-21 14:34:48 +000088# Only use Android support headers when compiling for Android
89case $host in
90 *-android*)
91 ANDROID_HOST=true
92 ;;
93esac
94AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue)
95
Mike Frysinger3f736ce2016-01-27 16:45:21 -050096# Some tools (like mac ones) only support x86 currently.
97case $host_cpu in
98 i?86|x86_64)
99 X86_HOST=true
100 ;;
101esac
102AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue)
103
ted.mielczareke574a2a2010-10-05 19:38:22 +0000104AC_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])
120AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue)
121
ted.mielczarekdbf409c2011-02-28 14:05:22 +0000122AC_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])
138AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue)
139
140if 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.mielczareke574a2a2010-10-05 19:38:22 +0000142fi
143
Mike Frysingerf820ead2016-01-25 19:27:56 -0500144AC_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])
160AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue)
161
162AC_ARG_VAR([GMOCK_CONFIG], [Path to gmock-config script])
163AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock])
164AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock])
165AC_ARG_VAR([GTEST_CONFIG], [Path to gtest-config script])
166AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest])
167AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest])
168if 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`
175fi
176
mmentovai0dbedc92006-09-25 21:16:15 +0000177AC_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])
194AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue)
195
Ted Mielczarek2ecb2ba2016-10-24 15:16:28 -0400196AC_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])
218AC_ARG_VAR([RUST_DEMANGLE_CFLAGS], [Compiler flags for rust-demangle])
219AC_ARG_VAR([RUST_DEMANGLE_LIBS], [Linker flags for rust-demangle])
220
vapier@chromium.org1b309ed2014-08-27 02:10:55 +0000221AC_CONFIG_FILES(m4_flatten([
222 breakpad.pc
223 breakpad-client.pc
224 Makefile
225]))
226
brynercb91a2f2006-08-25 21:14:45 +0000227AC_OUTPUT