blob: e2afc072c9c72841e73338f63e2806904bbbfe87 [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.
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
digit@chromium.org7e3c5382012-08-31 18:38:29 +000043AM_PROG_AS
brynercb91a2f2006-08-25 21:14:45 +000044AC_PROG_CC
ted.mielczarekd192a712010-10-05 19:38:51 +000045AM_PROG_CC_C_O
brynercb91a2f2006-08-25 21:14:45 +000046AC_PROG_CPP
47AC_PROG_CXX
ted.mielczarekd192a712010-10-05 19:38:51 +000048AC_PROG_RANLIB
ivan.penkov@gmail.com5f6e1f02012-07-02 22:55:57 +000049AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
brynercb91a2f2006-08-25 21:14:45 +000050
vapier@chromium.org302124a2013-12-10 06:28:08 +000051dnl This must come before all the feature tests below.
52AC_ARG_ENABLE(m32,
53 AS_HELP_STRING([--enable-m32],
54 [Compile/build with -m32]
55 [(default is no)]),
56 [case "${enableval}" in
57 yes)
58 CFLAGS="${CFLAGS} -m32"
59 CXXFLAGS="${CXXFLAGS} -m32"
60 usem32=true
61 ;;
62 no)
63 usem32=false
64 ;;
65 *)
66 AC_MSG_ERROR(bad value ${enableval} for --enable-m32)
67 ;;
68 esac],
69 [usem32=false])
70
brynercb91a2f2006-08-25 21:14:45 +000071AC_HEADER_STDC
vapier@chromium.org302124a2013-12-10 06:28:08 +000072AC_SYS_LARGEFILE
nealsidde545c02010-03-02 00:39:48 +000073m4_include(m4/ax_pthread.m4)
74AX_PTHREAD
ted.mielczarekdbf409c2011-02-28 14:05:22 +000075AC_CHECK_HEADERS([a.out.h])
nealsidde545c02010-03-02 00:39:48 +000076
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000077# Only build Linux client libs when compiling for Linux
78case $host in
digit@chromium.org62d486b2012-08-21 14:34:48 +000079 *-*-linux* | *-android* )
80 LINUX_HOST=true
81 ;;
ted.mielczarek53a8b1a2010-08-31 15:09:01 +000082esac
83AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue)
84
digit@chromium.org62d486b2012-08-21 14:34:48 +000085# Only use Android support headers when compiling for Android
86case $host in
87 *-android*)
88 ANDROID_HOST=true
89 ;;
90esac
91AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue)
92
ted.mielczareke574a2a2010-10-05 19:38:22 +000093AC_ARG_ENABLE(processor,
94 AS_HELP_STRING([--disable-processor],
95 [Don't build processor library]
96 [(default is no)]),
97 [case "${enableval}" in
98 yes)
99 disable_processor=false
100 ;;
101 no)
102 disable_processor=true
103 ;;
104 *)
105 AC_MSG_ERROR(bad value ${enableval} for --disable-processor)
106 ;;
107 esac],
108 [disable_processor=false])
109AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue)
110
ted.mielczarekdbf409c2011-02-28 14:05:22 +0000111AC_ARG_ENABLE(tools,
112 AS_HELP_STRING([--disable-tools],
113 [Don't build tool binaries]
114 [(default is no)]),
115 [case "${enableval}" in
116 yes)
117 disable_tools=false
118 ;;
119 no)
120 disable_tools=true
121 ;;
122 *)
123 AC_MSG_ERROR(bad value ${enableval} for --disable-tools)
124 ;;
125 esac],
126 [disable_tools=false])
127AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue)
128
129if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then
130 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 +0000131fi
132
mmentovai0dbedc92006-09-25 21:16:15 +0000133AC_ARG_ENABLE(selftest,
134 AS_HELP_STRING([--enable-selftest],
135 [Run extra tests with "make check" ]
136 [(may conflict with optimizations) ]
137 [(default is no)]),
138 [case "${enableval}" in
139 yes)
140 selftest=true
141 ;;
142 no)
143 selftest=false
144 ;;
145 *)
146 AC_MSG_ERROR(bad value ${enableval} for --enable-selftest)
147 ;;
148 esac],
149 [selftest=false])
150AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue)
151
brynercb91a2f2006-08-25 21:14:45 +0000152AC_CONFIG_FILES([Makefile])
153AC_OUTPUT