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])
10 BISON=`echo $YACC | $SED -e 's/ -y//'`
11 BISON_VERSION=`$BISON -V | $SED -e 's/^bison (GNU Bison) \(.*\)$/\1/p;d'`
12 ], [AC_MSG_ERROR([You need bison 2.4 or greater])])
14 AC_MSG_CHECKING([if bison is >= 2.4])
15 AS_VERSION_COMPARE([$BISON_VERSION], [2.4], [
17 AC_MSG_ERROR([You need bison 2.4 or greater])
18 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
22 FLEX_VERSION=[`$FLEX --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
23 ], [AC_MSG_ERROR([You need flex 2.5.33 or greater])])
24 AC_MSG_CHECKING([if flex is >= 2.5.33])
25 AS_VERSION_COMPARE([$FLEX_VERSION], [2.5.33], [
27 AC_MSG_ERROR([You need flex 2.5.33 or greater])
28 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
30 AC_CHECK_PROGS([_BASH], [bash])
31 AC_CHECK_PROGS([GPERF], [gperf])
32 AC_MSG_CHECKING([if gperf >= 3.0.3])
33 GPERF_VERSION=[`$GPERF --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
34 AS_VERSION_COMPARE([$GPERF_VERSION], [3.0.3], [
36 AC_MSG_ERROR([You need gperf 3.0.3 or greater])
37 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
38 AC_CHECK_PROGS([TIME], [time])
39 APR_FIND_APR([], [], [1], [1])
40 AS_CASE([$apr_found], [yes], [
41 AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`])
42 AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`])
43 ], [AC_MSG_ERROR([You need apr])])
49 AS_CASE([$am_cv_func_iconv], [yes], [], [AC_MSG_ERROR([You need iconv])])
50 PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [
52 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags webkit-1.0`])
53 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`])
55 PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [
57 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags WebKitGtk`])
58 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`])
61 AS_CASE([$WEBKIT], [yes], [
62 AC_SUBST([CY_EXECUTE], [1])
63 PKG_CHECK_MODULES([LIBFFI], [libffi], [
64 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags libffi`])
65 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs libffi`])
67 AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break])
68 AS_IF([test "x$ac_cv_header_ffi_h" = xno && test "x$ac_cv_header_ffi_ffi_h" = xno], [
69 AC_MSG_ERROR([You need libffi])
71 AC_SEARCH_LIBS([ffi_call], [ffi])
72 AS_CASE([$ac_cv_search_ffi_call], [no], [
73 AC_MSG_ERROR([You need libffi])
77 AC_MSG_WARN([No JavaScript engine!])
80 AC_LANG_PUSH([Objective C++])
81 AC_MSG_CHECKING([if we really have Objective C++])
83 // This space intentionally left blank
87 ], [AC_MSG_RESULT([no])])
88 AC_LANG_POP([Objective C++])
89 AS_IF([test "x$CY_OBJECTIVEC" = x1], [
91 AC_CHECK_PROGS([GNUSTEP_CONFIG], [gnustep-config])
92 AS_IF([test "x$GNUSTEP_CONFIG" != x], [
93 AC_SUBST([CY_OBJECTIVEC])
94 AC_LIB_APPENDTOVAR([OBJCXXFLAGS], [`$GNUSTEP_CONFIG --objc-flags`])
95 AC_LIB_APPENDTOVAR([LIBS], [`$GNUSTEP_CONFIG --base-libs`])
99 AS_IF([test "x$_cv_gnu_make_command" = x], [AC_MSG_ERROR([You need GNU make])])
100 AC_CONFIG_FILES([GNUmakefile])