]>
Commit | Line | Data |
---|---|---|
9c60689e | 1 | AC_PREREQ([2.65]) |
c7aa54aa | 2 | AC_INIT([Cycript], [0.9], [saurik@saurik.com], [cycript], [http://www.cycript.org/]) |
35fa52c0 | 3 | AC_CONFIG_SRCDIR([Console.cpp]) |
6b66678a | 4 | AC_CONFIG_AUX_DIR([.]) |
549f29b5 | 5 | LT_INIT([disable-static]) |
3fd51f51 | 6 | PKG_PROG_PKG_CONFIG([0.22]) |
47aaa820 DWT |
7 | AC_PROG_CXX |
8 | AC_LANG([C++]) | |
35fa52c0 DWT |
9 | AX_PROG_BISON([ |
10 | BISON=`echo $YACC | $SED -e 's/ -y//'` | |
11 | BISON_VERSION=`$BISON -V | $SED -e 's/^bison (GNU Bison) \(.*\)$/\1/p;d'` | |
27557508 | 12 | ], [AC_MSG_ERROR([You need bison 2.3 or greater])]) |
35fa52c0 | 13 | AC_PROG_AWK |
27557508 DWT |
14 | AC_MSG_CHECKING([if bison is >= 2.3]) |
15 | AS_VERSION_COMPARE([$BISON_VERSION], [2.3], [ | |
35fa52c0 | 16 | AC_MSG_RESULT([no]) |
27557508 | 17 | AC_MSG_ERROR([You need bison 2.3 or greater]) |
6b66678a | 18 | ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])]) |
35fa52c0 | 19 | AC_SUBST([BISON]) |
6b66678a DWT |
20 | AX_PROG_FLEX([ |
21 | FLEX=$LEX | |
3fd51f51 DWT |
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])]) | |
50ac250c DWT |
24 | AC_MSG_CHECKING([if flex is >= 2.5.33]) |
25 | AS_VERSION_COMPARE([$FLEX_VERSION], [2.5.33], [ | |
6b66678a | 26 | AC_MSG_RESULT([no]) |
50ac250c | 27 | AC_MSG_ERROR([You need flex 2.5.33 or greater]) |
6b66678a DWT |
28 | ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])]) |
29 | AC_SUBST([FLEX]) | |
9c60689e | 30 | AC_CHECK_PROGS([_BASH], [bash]) |
27557508 | 31 | AC_ARG_VAR([GPERF], [perfect hash function generator]) |
9c60689e | 32 | AC_CHECK_PROGS([GPERF], [gperf]) |
3fd51f51 DWT |
33 | AC_MSG_CHECKING([if gperf >= 3.0.3]) |
34 | GPERF_VERSION=[`$GPERF --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`] | |
35 | AS_VERSION_COMPARE([$GPERF_VERSION], [3.0.3], [ | |
36 | AC_MSG_RESULT([no]) | |
37 | AC_MSG_ERROR([You need gperf 3.0.3 or greater]) | |
38 | ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])]) | |
3530897b | 39 | AC_CHECK_PROGS([TIME], [time]) |
309b0535 DWT |
40 | APR_FIND_APR([], [], [1], [1]) |
41 | AS_CASE([$apr_found], [yes], [ | |
42 | AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`]) | |
549f29b5 | 43 | AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`]) |
309b0535 | 44 | ], [AC_MSG_ERROR([You need apr])]) |
9c60689e | 45 | VL_LIB_READLINE |
35fa52c0 | 46 | AC_PROG_INSTALL |
94690cff | 47 | AC_LANG_PUSH([C]) |
35fa52c0 | 48 | AM_ICONV |
94690cff | 49 | AC_LANG_POP([C]) |
35fa52c0 | 50 | AS_CASE([$am_cv_func_iconv], [yes], [], [AC_MSG_ERROR([You need iconv])]) |
3fd51f51 DWT |
51 | PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [ |
52 | WEBKIT=yes | |
53 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags webkit-1.0`]) | |
54 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`]) | |
55 | ], [ | |
56 | PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [ | |
57 | WEBKIT=yes | |
58 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags WebKitGtk`]) | |
59 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`]) | |
60 | ], [WEBKIT=no]) | |
35fa52c0 DWT |
61 | ]) |
62 | AS_CASE([$WEBKIT], [yes], [ | |
3fd51f51 DWT |
63 | AC_SUBST([CY_EXECUTE], [1]) |
64 | PKG_CHECK_MODULES([LIBFFI], [libffi], [ | |
65 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags libffi`]) | |
66 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs libffi`]) | |
67 | ], [ | |
6b66678a DWT |
68 | AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break]) |
69 | AS_IF([test "x$ac_cv_header_ffi_h" = xno && test "x$ac_cv_header_ffi_ffi_h" = xno], [ | |
70 | AC_MSG_ERROR([You need libffi]) | |
71 | ]) | |
72 | AC_SEARCH_LIBS([ffi_call], [ffi]) | |
73 | AS_CASE([$ac_cv_search_ffi_call], [no], [ | |
74 | AC_MSG_ERROR([You need libffi]) | |
75 | ]) | |
76 | ]) | |
3fd51f51 | 77 | ], [ |
3fd51f51 DWT |
78 | AC_MSG_WARN([No JavaScript engine!]) |
79 | ]) | |
47aaa820 DWT |
80 | AC_PROG_OBJCXX |
81 | AC_LANG_PUSH([Objective C++]) | |
82 | AC_MSG_CHECKING([if we really have Objective C++]) | |
83 | AC_COMPILE_IFELSE([ | |
84 | // This space intentionally left blank | |
85 | ], [ | |
86 | CY_OBJECTIVEC=1 | |
87 | AC_MSG_RESULT([yes]) | |
88 | ], [AC_MSG_RESULT([no])]) | |
89 | AC_LANG_POP([Objective C++]) | |
90 | AS_IF([test "x$CY_OBJECTIVEC" = x1], [ | |
91 | # TODO: Darwin | |
92 | AC_CHECK_PROGS([GNUSTEP_CONFIG], [gnustep-config]) | |
93 | AS_IF([test "x$GNUSTEP_CONFIG" != x], [ | |
94 | AC_SUBST([CY_OBJECTIVEC]) | |
95 | AC_LIB_APPENDTOVAR([OBJCXXFLAGS], [`$GNUSTEP_CONFIG --objc-flags`]) | |
96 | AC_LIB_APPENDTOVAR([LIBS], [`$GNUSTEP_CONFIG --base-libs`]) | |
97 | ]) | |
98 | ]) | |
309b0535 | 99 | CHECK_GNU_MAKE |
6b66678a | 100 | AS_IF([test "x$_cv_gnu_make_command" = x], [AC_MSG_ERROR([You need GNU make])]) |
9c60689e DWT |
101 | AC_CONFIG_FILES([GNUmakefile]) |
102 | AC_OUTPUT |