]> git.saurik.com Git - cycript.git/blob - configure.ac
Progress on injection?
[cycript.git] / configure.ac
1 AC_PREREQ([2.65])
2 AC_INIT([Cycript], [0.9], [saurik@saurik.com], [cycript], [http://www.cycript.org/])
3 AC_CONFIG_SRCDIR([Console.cpp])
4 AC_CONFIG_AUX_DIR([.])
5 LT_INIT([disable-static])
6 PKG_PROG_PKG_CONFIG([0.22])
7 AC_PROG_CXX
8 AC_LANG([C++])
9 AC_PROG_SED
10 AX_PROG_BISON([
11 BISON=`echo $YACC | $SED -e 's/ -y//'`
12 BISON_VERSION=`$BISON -V | $SED -e 's/^bison (GNU Bison) \(.*\)$/\1/p;d'`
13 ], [AC_MSG_ERROR([You need bison 2.3 or greater])])
14 AC_PROG_AWK
15 AC_MSG_CHECKING([if bison is >= 2.3])
16 AS_VERSION_COMPARE([$BISON_VERSION], [2.3], [
17 AC_MSG_RESULT([no])
18 AC_MSG_ERROR([You need bison 2.3 or greater])
19 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
20 AC_SUBST([BISON])
21 AX_PROG_FLEX([
22 FLEX=$LEX
23 FLEX_VERSION=[`$FLEX --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
24 ], [AC_MSG_ERROR([You need flex 2.5.33 or greater])])
25 AC_MSG_CHECKING([if flex is >= 2.5.33])
26 AS_VERSION_COMPARE([$FLEX_VERSION], [2.5.33], [
27 AC_MSG_RESULT([no])
28 AC_MSG_ERROR([You need flex 2.5.33 or greater])
29 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
30 AC_SUBST([FLEX])
31 AC_CHECK_PROGS([_BASH], [bash])
32 AC_ARG_VAR([GPERF], [perfect hash function generator])
33 AC_CHECK_PROGS([GPERF], [gperf])
34 AC_MSG_CHECKING([if gperf >= 3.0.3])
35 GPERF_VERSION=[`$GPERF --version | $SED -e 's/^.* \([0-9.]*\)$/\1/p;d'`]
36 AS_VERSION_COMPARE([$GPERF_VERSION], [3.0.3], [
37 AC_MSG_RESULT([no])
38 AC_MSG_ERROR([You need gperf 3.0.3 or greater])
39 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])])
40 AC_CHECK_PROGS([TIME], [time])
41 APR_FIND_APR([], [], [1], [1])
42 AS_CASE([$apr_found], [yes], [
43 AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`])
44 AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`])
45 ], [AC_MSG_ERROR([You need apr])])
46 VL_LIB_READLINE
47 AC_PROG_INSTALL
48 AC_LANG_PUSH([C])
49 AM_ICONV
50 AC_LANG_POP([C])
51 AS_CASE([$am_cv_func_iconv], [yes], [], [AC_MSG_ERROR([You need iconv])])
52 PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [
53 CY_EXECUTE=1
54 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags webkit-1.0`])
55 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`])
56 ], [
57 PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [
58 CY_EXECUTE=1
59 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags WebKitGtk`])
60 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`])
61 ], [
62 AC_CHECK_FRAMEWORK([JavaScriptCore], [
63 #include <JavaScriptCore/JSBase.h>
64 ], [JSEvaluateScript(0, 0, 0, 0, 0, 0);], [CY_EXECUTE=1])
65 ])
66 ])
67 AC_PROG_OBJCXX
68 AS_CASE([$CY_EXECUTE], [1], [
69 AC_SUBST([CY_EXECUTE])
70 PKG_CHECK_MODULES([LIBFFI], [libffi], [
71 AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags libffi`])
72 AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs libffi`])
73 ], [
74 AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break])
75 AS_IF([test "x$ac_cv_header_ffi_h" = xno && test "x$ac_cv_header_ffi_ffi_h" = xno], [
76 AC_MSG_ERROR([You need libffi])
77 ])
78 AC_SEARCH_LIBS([ffi_call], [ffi])
79 AS_CASE([$ac_cv_search_ffi_call], [no], [
80 AC_MSG_ERROR([You need libffi])
81 ])
82 ])
83 AC_LANG_PUSH([Objective C++])
84 AC_MSG_CHECKING([if we really have Objective C++])
85 AC_COMPILE_IFELSE([
86 // This space intentionally left blank
87 ], [
88 CY_OBJECTIVEC=1
89 AC_MSG_RESULT([yes])
90 ], [AC_MSG_RESULT([no])])
91 AS_IF([test "x$CY_OBJECTIVEC" = x1], [
92 AC_CHECK_FRAMEWORK([CoreFoundation], [
93 #include <CoreFoundation/CFBase.h>
94 ], [CFAllocatorGetDefault();], [
95 AC_SUBST([CY_OBJECTIVEC])
96 AC_CHECK_FRAMEWORK([Foundation], [
97 #include <Foundation/NSObject.h>
98 ], [[[[NSObject alloc] init];]])
99 AC_CHECK_FRAMEWORK([WebKit], [
100 #include <WebKit/WebScriptObject.h>
101 ], [[[[WebScriptObject alloc] init];]])
102 ], [
103 AC_CHECK_PROGS([GNUSTEP_CONFIG], [gnustep-config])
104 AS_IF([test "x$GNUSTEP_CONFIG" != x], [
105 AC_SUBST([CY_OBJECTIVEC])
106 AC_LIB_APPENDTOVAR([OBJCXXFLAGS], [`$GNUSTEP_CONFIG --objc-flags`])
107 AC_LIB_APPENDTOVAR([LIBS], [`$GNUSTEP_CONFIG --base-libs`])
108 ], [AC_SUBST([CY_OBJECTIVEC], [0])])
109 ])
110 ])
111 AC_LANG_POP([Objective C++])
112 ], [
113 AC_MSG_WARN([No JavaScript engine!])
114 ])
115 AS_IF([test "x$CY_OBJECTIVEC" = x1], [
116 AC_CHECK_HEADER([mach/mach.h], [
117 AS_CASE([$OTOOL], [:], [AC_MSG_WARN([Missing otool?])], [AC_SUBST([CY_OBJECTIVEC_MACH], [1])])
118 ])
119 ])
120 CHECK_GNU_MAKE
121 AS_IF([test "x$_cv_gnu_make_command" = x], [AC_MSG_ERROR([You need GNU make])])
122 AC_CONFIG_FILES([GNUmakefile])
123 AC_OUTPUT