2 AC_INIT([Cycript], [0.9], [saurik@saurik.com], [cycript], [http://www.cycript.org/])
3 AC_CONFIG_SRCDIR([Console.cpp])
5 LT_INIT([disable-static])
6 PKG_PROG_PKG_CONFIG([0.22])
8 BISON=`echo $YACC | $SED -e 's/ -y//'`
9 BISON_VERSION=`$BISON -V | $SED -e 's/^bison (GNU Bison) \(.*\)$/\1/p;d'`
10 ], [AC_MSG_ERROR([You need bison 2.4 or greater])])
12 AC_MSG_CHECKING([if bison is >= 2.4])
13 AS_VERSION_COMPARE([$BISON_VERSION], [2.4], [
15 AC_MSG_ERROR([You need bison 2.4 or greater])
16 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
20 FLEX_VERSION=[`$FLEX --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
21 ], [AC_MSG_ERROR([You need flex 2.5.33 or greater])])
22 AC_MSG_CHECKING([if flex is >= 2.5.33])
23 AS_VERSION_COMPARE([$FLEX_VERSION], [2.5.33], [
25 AC_MSG_ERROR([You need flex 2.5.33 or greater])
26 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
28 AC_CHECK_PROGS([_BASH], [bash])
29 AC_CHECK_PROGS([GPERF], [gperf])
30 AC_MSG_CHECKING([if gperf >= 3.0.3])
31 GPERF_VERSION=[`$GPERF --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
32 AS_VERSION_COMPARE([$GPERF_VERSION], [3.0.3], [
34 AC_MSG_ERROR([You need gperf 3.0.3 or greater])
35 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
36 AC_CHECK_PROGS([TIME], [time])
37 APR_FIND_APR([], [], [1], [1])
38 AS_CASE([$apr_found], [yes], [
39 AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`])
40 AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`])
41 ], [AC_MSG_ERROR([You need apr])])
46 AS_CASE([$am_cv_func_iconv], [yes], [], [AC_MSG_ERROR([You need iconv])])
47 PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [
49 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags webkit-1.0`])
50 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`])
52 PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [
54 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags WebKitGtk`])
55 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`])
58 AS_CASE([$WEBKIT], [yes], [
59 AC_SUBST([CY_EXECUTE], [1])
60 PKG_CHECK_MODULES([LIBFFI], [libffi], [
61 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags libffi`])
62 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs libffi`])
64 AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break])
65 AS_IF([test "x$ac_cv_header_ffi_h" = xno && test "x$ac_cv_header_ffi_ffi_h" = xno], [
66 AC_MSG_ERROR([You need libffi])
68 AC_SEARCH_LIBS([ffi_call], [ffi])
69 AS_CASE([$ac_cv_search_ffi_call], [no], [
70 AC_MSG_ERROR([You need libffi])
74 AC_SUBST([CY_EXECUTE], [0])
75 AC_MSG_WARN([No JavaScript engine!])
78 AS_IF([test "x$_cv_gnu_make_command" = x], [AC_MSG_ERROR([You need GNU make])])
81 AC_CONFIG_FILES([GNUmakefile])