2 dnl Copyright © 2008 Keith Packard <keithp@keithp.com>
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful, but
10 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License along
15 dnl with this program; if not, write to the Free Software Foundation, Inc.,
16 dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 dnl Process this file with autoconf to create configure.
22 AM_INIT_AUTOMAKE(cctools, 0.1)
25 dnl ==========================================================================
27 AM_CONFIG_HEADER(config.h)
37 if test "x$GCC" = "xyes"; then
38 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
39 -Wmissing-prototypes -Wmissing-declarations \
40 -Wnested-externs -fno-strict-aliasing"
41 AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
42 [Can use #warning in C files])
46 dnl ==========================================================================
48 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
50 dnl ==========================================================================
52 # Setup for compiling build tools (fc-glyphname, etc)
53 AC_MSG_CHECKING([for a C compiler for build tools])
54 if test $cross_compiling = yes; then
55 AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
59 AC_MSG_RESULT([$CC_FOR_BUILD])
60 AC_SUBST(CC_FOR_BUILD)
62 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
64 AC_MSG_CHECKING([for suffix of executable build tools])
65 if test $cross_compiling = yes; then
66 cat >conftest.c <<\_______EOF
74 compile="$CC_FOR_BUILD conftest.c -o conftest$i"
75 if AC_TRY_EVAL(compile); then
76 if (./conftest) 2>&AC_FD_CC; then
83 if test "${EXEEXT_FOR_BUILD+set}" != set; then
84 AC_MSG_ERROR([Cannot determine suffix of executable build tools])
87 EXEEXT_FOR_BUILD=$EXEEXT
89 AC_MSG_RESULT([$EXEEXT_FOR_BUILD])
90 AC_SUBST(EXEEXT_FOR_BUILD)