1 ## configure.ac -- Process this file with autoconf to produce configure
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; version 2 of the License.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program; if not, write to the Free Software
14 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 AC_INIT([petitboot], [@version@], [Geoff Levand <geoff@infradead.org>])
19 AC_CONFIG_MACRO_DIR([m4])
21 AC_PREFIX_DEFAULT([/usr/local])
23 AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])])
31 AC_CHECK_HEADERS([stdarg.h])
32 AC_CHECK_HEADERS([varargs.h])
34 dnl Checking for va_copy availability
35 AC_MSG_CHECKING([for va_copy])
36 AC_TRY_LINK([#include <stdarg.h>
37 va_list ap1,ap2;], [va_copy(ap1,ap2);],
40 AC_MSG_RESULT($have_va_copy)
41 if test x"$have_va_copy" = x"yes"; then
42 AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
44 AC_MSG_CHECKING([for __va_copy])
45 AC_TRY_LINK([#include <stdarg.h>
46 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
49 AC_MSG_RESULT($have___va_copy)
50 if test x"$have___va_copy" = x"yes"; then
51 AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
57 [AS_HELP_STRING([--with-ncurses],
58 [build text console UI programs using ncurses [default=yes]]
63 AM_CONDITIONAL([WITH_NCURSES], [test "x$with_ncurses" = "xyes"])
67 [AS_HELP_STRING([--with-twin-x11],
68 [build x11 GUI programs using the twin window system [default=yes]]
73 AM_CONDITIONAL([WITH_TWIN_X11], [test "x$with_twin_x11" = "xyes"])
79 [build frame buffer GUI programs using the twin window system [default=no]]
84 AM_CONDITIONAL([WITH_TWIN_FBDEV], [test "x$with_twin_fbdev" = "xyes"])
88 [test "x$with_twin_x11" = "xyes" || test "x$with_twin_fbdev" = "xyes"])
91 [test "x$with_twin_x11" = "xyes" || test "x$with_twin_fbdev" = "xyes"],
95 [SAVE_LIBS="$LIBS" LIBS="$LIBS $twin_LIBS"
100 [AC_MSG_FAILURE([--with-twin was given, but test for twin failed])]
104 [AC_MSG_RESULT([$twin_PKG_ERRORS])
105 AC_MSG_FAILURE([ Consider adjusting PKG_CONFIG_PATH environment variable])
111 [test "x$with_twin_x11" = "xyes"],
112 [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $twin_CFLAGS"
114 [libtwin/twin_x11.h],
116 [AC_MSG_FAILURE([ --with-twin-x11 given but libtwin/twin_x11.h not found])]
118 CPPFLAGS="$SAVE_CPPFLAGS"
123 [test "x$with_twin_fbdev" = "xyes"],
124 [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $twin_CFLAGS"
126 [libtwin/twin_fbdev.h],
128 [AC_MSG_FAILURE([ --with-twin-fbdev given but libtwin/twin_fbdev.h not found])]
130 CPPFLAGS="$SAVE_CPPFLAGS"
138 [build programs with extra support for busybox [default=no]])
143 #AM_CONDITIONAL([ENABLE_BUSYBOX], [test "x$enable_busybox" = "xyes"])
149 [build additional programs for the PS3 game console [default=no]]
154 AM_CONDITIONAL([ENABLE_PS3], [test "x$enable_ps3" = "xyes"])
158 [AS_HELP_STRING([--enable-debug],
159 [build programs with extra debug info [default=no]]
164 #AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"])
166 default_cflags="--std=gnu99 -g \
167 -Wall -W -Wunused -Wstrict-prototypes -Wmissing-prototypes \
168 -Wmissing-declarations -Wredundant-decls -Winline"
172 [AS_HELP_STRING([--enable-werror],
173 [build programs with -Werror]
175 [default_cflags="$default_cflags -Werror"]
179 [test "x$enable_debug" = "xyes"],
180 [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O0 -DDEBUG"])],
181 [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O2 -DNDEBUG"])]
185 AC_SUBST([LIBTOOL_DEPS])
188 AC_CONFIG_HEADERS([config.h])