]> git.ozlabs.org Git - petitboot/blob - configure.ac
Add PS3 ncurses CUI program
[petitboot] / configure.ac
1 ## configure.ac -- Process this file with autoconf to produce configure
2 #
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.
6 #
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.
11 #
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
15 #
16
17 AC_INIT([petitboot], [0.2], [Jeremy Kerr <jk@ozlabs.org>])
18
19 AC_CONFIG_HEADERS([config.h])
20 AC_CONFIG_FILES([Makefile])
21
22 default_CFLAGS="--std=gnu99 -O2 -g -Wall -W -Wunused -Wstrict-prototypes \
23 -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Winline"
24
25 if test "x$CFLAGS" = "x"; then
26     CFLAGS="$default_CFLAGS"
27 fi
28
29 AC_PROG_CC
30 AC_PROG_INSTALL
31
32 AC_ARG_ENABLE([ps3],
33         [AS_HELP_STRING([--enable-ps3],
34                 [build support for the PS3 game console])],
35         [],
36         [enable_ps3=check])
37
38 AS_IF([test "x$enable_ps3" != xno],
39         [AC_SUBST([ENABLE_PS3], ["y"])],
40         [AC_SUBST([ENABLE_PS3], ["n"])])
41
42 AC_ARG_WITH([twin],
43         [AS_HELP_STRING([--with-twin],
44                 [build GUI versions using the twin window system])],
45         [],
46         [with_twin=check])
47
48 PBTWIN=
49 LIBTWIN=
50 AS_IF([test "x$with_twin" != xno],
51         [PKG_CHECK_MODULES([twin], [libtwin], [],
52                 [AC_MSG_RESULT([$twin_PKG_ERRORS])
53                 AC_MSG_RESULT([Consider adjusting PKG_CONFIG_PATH environment variable])])
54         AC_CHECK_LIB([twin], [main],
55                 [AC_SUBST([LIBTWIN], ["-ltwin"])
56                         AC_SUBST([PBTWIN], ["y"])
57                         AC_DEFINE([HAVE_LIBTWIN], [1], [Define if you have libtwin])],
58                 [if test "x$with_twin" != xcheck; then
59                         AC_MSG_FAILURE([--with-twin was given, but test for twin failed])
60                 fi],
61                 [${twin_LIBS}])])
62
63 mkdir -p discover lib/list lib/log lib/pb-protocol lib/system lib/talloc \
64         lib/waiter test ui/common ui/ncurses ui/test ui/twin utils
65
66 AC_OUTPUT