]>
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]) |
632b71ea | 7 | CHECK_GNU_MAKE |
790e5246 DWT |
8 | AC_SUBST([GMAKE], [$_cv_gnu_make_command]) |
9 | AS_IF([test "x$GMAKE" = x], [AC_MSG_ERROR([You need GNU make])]) | |
e9c9a47c DWT |
10 | AC_PATH_PROGS([_BASH], [bash]) |
11 | AS_IF([test "x$_BASH" = x], [AC_MSG_ERROR([You need GNU bash])]) | |
12 | AC_PATH_PROGS([TIME], [time]) | |
13 | AC_DEFUN([CY_CHECK_PROGS_VERSION], [ | |
14 | AC_MSG_CHECKING(for ]$2[ >= ]$5[) | |
15 | AC_PATH_PROGS_FEATURE_CHECK(]$1[, ]$3[, | |
16 | AS_VERSION_COMPARE(`$ac_path_]$1[ ]$4[`, ]$5[, , | |
17 | ac_cv_path_]$1[=$ac_path_]$1[ | |
18 | , | |
19 | ac_cv_path_]$1[=$ac_path_]$1[ | |
20 | ) | |
21 | , | |
b5bd4353 | 22 | AC_MSG_RESULT(no) |
e9c9a47c DWT |
23 | AC_MSG_ERROR(You need ]$2[ ]$5[ or greater) |
24 | ) | |
25 | AC_SUBST(]$1[, $ac_cv_path_]$1[) | |
26 | AC_MSG_RESULT($]$1[) | |
27 | ]) | |
28 | AC_ARG_VAR([BISON], [GNU Project parser generator (yacc replacement)]) | |
29 | CY_CHECK_PROGS_VERSION([BISON], [bison], [bison], | |
30 | [-V | $SED -e '1 s/^bison (GNU Bison) \(.*\)$/\1/p;d'], [2.3]) | |
31 | AC_ARG_VAR([FLEX], [the fast lexical analyser generator]) | |
32 | CY_CHECK_PROGS_VERSION([FLEX], [flex], [flex], | |
33 | [--version | $SED -e '1 s/^.* \(@<:@0-9.@:>@*\)$/\1/p;d'], [2.5.33]) | |
34 | AC_ARG_VAR([GPERF], [perfect hash function generator]) | |
35 | CY_CHECK_PROGS_VERSION([GPERF], [gperf], [gperf], | |
36 | [--version | $SED -e '1 s/^.* \(@<:@0-9.@:>@*\)$/\1/p;d'], [3.0.3]) | |
37 | AC_PROG_INSTALL | |
b5bd4353 | 38 | AC_MSG_CHECKING([for GNU tar >=1.19]) |
e9c9a47c DWT |
39 | AC_PATH_PROGS_FEATURE_CHECK([GNUTAR], [tar gtar gnutar], [ |
40 | AS_IF([test "x`$ac_path_GNUTAR --version | $SED -e '1 s/^tar (GNU tar)/&/p;d'`" != x], [ | |
b5bd4353 DWT |
41 | AS_VERSION_COMPARE([`$ac_path_GNUTAR --version | $SED -e '1 s/^tar (GNU tar) \(.*\)$/\1/p;d'`], [1.19], , [ |
42 | ac_cv_path_GNUTAR=$ac_path_GNUTAR | |
43 | ], [ | |
44 | ac_cv_path_GNUTAR=$ac_path_GNUTAR | |
45 | ]) | |
e9c9a47c DWT |
46 | ]) |
47 | ]) | |
48 | AS_IF([test "x$ac_cv_path_GNUTAR" != x], [ | |
49 | AC_SUBST([GNUTAR], [$ac_cv_path_GNUTAR]) | |
50 | AC_MSG_RESULT([$GNUTAR]) | |
51 | ], [ | |
52 | AC_SUBST([GNUTAR], [:]) | |
b5bd4353 | 53 | AC_MSG_RESULT([no]) |
e9c9a47c | 54 | ]) |
b65019fe DWT |
55 | AC_CHECK_PROGS([SVN], [svn]) |
56 | AC_CHECK_PROGS([SVNVERSION], [svnversion]) | |
47aaa820 | 57 | AC_PROG_CXX |
632b71ea DWT |
58 | AC_PROG_OBJCXX |
59 | AC_ARG_WITH([frameworks], [AS_HELP_STRING( | |
60 | [--with-frameworks=DIRS], | |
61 | [add to DIRS (space separated) to the Darwin include path for frameworks with -F] | |
62 | )], [ | |
63 | for framework in $withval; do | |
64 | AC_LIB_APPENDTOVAR([CFLAGS], [-F$framework]) | |
65 | AC_LIB_APPENDTOVAR([CXXFLAGS], [-F$framework]) | |
66 | AC_LIB_APPENDTOVAR([OBJCCXXFLAGS], [-F$framework]) | |
67 | done | |
68 | ]) | |
47aaa820 | 69 | AC_LANG([C++]) |
309b0535 DWT |
70 | APR_FIND_APR([], [], [1], [1]) |
71 | AS_CASE([$apr_found], [yes], [ | |
72 | AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`]) | |
549f29b5 | 73 | AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`]) |
309b0535 | 74 | ], [AC_MSG_ERROR([You need apr])]) |
9c60689e | 75 | VL_LIB_READLINE |
19c905b4 | 76 | AS_CASE([$vl_cv_lib_readline], [no], [AC_MSG_ERROR([You need readline])]) |
94690cff | 77 | AC_LANG_PUSH([C]) |
35fa52c0 | 78 | AM_ICONV |
94690cff | 79 | AC_LANG_POP([C]) |
35fa52c0 | 80 | AS_CASE([$am_cv_func_iconv], [yes], [], [AC_MSG_ERROR([You need iconv])]) |
b66977f1 DWT |
81 | AC_DEFUN([CY_CHECK_JAVASCRIPTCORE], [ |
82 | PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [ | |
a667869d | 83 | CY_EXECUTE=1 |
b66977f1 DWT |
84 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags webkit-1.0`]) |
85 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`]) | |
b128dfee | 86 | ], [ |
b66977f1 DWT |
87 | PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [ |
88 | CY_EXECUTE=1 | |
89 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags WebKitGtk`]) | |
90 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`]) | |
91 | ], [ | |
92 | AC_CHECK_FRAMEWORK([JavaScriptCore], [ | |
93 | #include <JavaScriptCore/JSBase.h> | |
94 | ], [JSEvaluateScript(0, 0, 0, 0, 0, 0);], [CY_EXECUTE=1]) | |
95 | ]) | |
b128dfee | 96 | ]) |
35fa52c0 | 97 | ]) |
b66977f1 DWT |
98 | AC_DEFUN([CY_CHECK_JAVASCRIPT], [ |
99 | CY_CHECK_JAVASCRIPTCORE | |
100 | ]) | |
101 | AC_ARG_ENABLE([javascript], [AS_HELP_STRING( | |
102 | [--enable-javascript@<:@=ENGINE@:>@], | |
103 | [use a JavaScript runtime (currently the only available option for ENGINE is JavaScriptCore) @<:@default=yes@:>@] | |
104 | )], [ | |
105 | AS_CASE([$enableval], [yes], [CY_CHECK_JAVASCRIPT], [no], [ | |
106 | AC_SUBST([CY_EXECUTE], [0]) | |
107 | ], [JavaScriptCore], [ | |
108 | CY_CHECK_JAVASCRIPTCORE | |
109 | ], [AC_MSG_ERROR([Unknown JavaScript engine: $enableval])]) | |
110 | ], [CY_CHECK_JAVASCRIPT]) | |
a667869d DWT |
111 | AS_CASE([$CY_EXECUTE], [1], [ |
112 | AC_SUBST([CY_EXECUTE]) | |
3fd51f51 DWT |
113 | PKG_CHECK_MODULES([LIBFFI], [libffi], [ |
114 | AC_LIB_APPENDTOVAR([CXXFLAGS], [`$PKG_CONFIG --cflags libffi`]) | |
115 | AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs libffi`]) | |
116 | ], [ | |
6b66678a DWT |
117 | AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break]) |
118 | AS_IF([test "x$ac_cv_header_ffi_h" = xno && test "x$ac_cv_header_ffi_ffi_h" = xno], [ | |
119 | AC_MSG_ERROR([You need libffi]) | |
120 | ]) | |
121 | AC_SEARCH_LIBS([ffi_call], [ffi]) | |
122 | AS_CASE([$ac_cv_search_ffi_call], [no], [ | |
123 | AC_MSG_ERROR([You need libffi]) | |
124 | ]) | |
125 | ]) | |
a667869d DWT |
126 | AC_LANG_PUSH([Objective C++]) |
127 | AC_MSG_CHECKING([if we really have Objective C++]) | |
128 | AC_COMPILE_IFELSE([ | |
129 | // This space intentionally left blank | |
130 | ], [ | |
131 | CY_OBJECTIVEC=1 | |
132 | AC_MSG_RESULT([yes]) | |
133 | ], [AC_MSG_RESULT([no])]) | |
a667869d | 134 | AS_IF([test "x$CY_OBJECTIVEC" = x1], [ |
c823f118 DWT |
135 | AC_CHECK_FRAMEWORK([CoreFoundation], [ |
136 | #include <CoreFoundation/CFBase.h> | |
137 | ], [CFAllocatorGetDefault();], [ | |
a667869d | 138 | AC_SUBST([CY_OBJECTIVEC]) |
c823f118 DWT |
139 | AC_CHECK_FRAMEWORK([Foundation], [ |
140 | #include <Foundation/NSObject.h> | |
141 | ], [[[[NSObject alloc] init];]]) | |
142 | AC_CHECK_FRAMEWORK([WebKit], [ | |
143 | #include <WebKit/WebScriptObject.h> | |
144 | ], [[[[WebScriptObject alloc] init];]]) | |
145 | ], [ | |
790e5246 | 146 | AC_ARG_VAR([GNUSTEP_CONFIG], [prints information about the current gnustep installation]) |
c823f118 DWT |
147 | AC_CHECK_PROGS([GNUSTEP_CONFIG], [gnustep-config]) |
148 | AS_IF([test "x$GNUSTEP_CONFIG" != x], [ | |
149 | AC_SUBST([CY_OBJECTIVEC]) | |
150 | AC_LIB_APPENDTOVAR([OBJCXXFLAGS], [`$GNUSTEP_CONFIG --objc-flags`]) | |
151 | AC_LIB_APPENDTOVAR([LIBS], [`$GNUSTEP_CONFIG --base-libs`]) | |
152 | ], [AC_SUBST([CY_OBJECTIVEC], [0])]) | |
a667869d DWT |
153 | ]) |
154 | ]) | |
c823f118 | 155 | AC_LANG_POP([Objective C++]) |
3fd51f51 | 156 | ]) |
e1cce270 DWT |
157 | AS_IF([test "x$CY_OBJECTIVEC" = x1], [ |
158 | AC_CHECK_HEADER([mach/mach.h], [ | |
159 | AS_CASE([$OTOOL], [:], [AC_MSG_WARN([Missing otool?])], [AC_SUBST([CY_OBJECTIVEC_MACH], [1])]) | |
160 | ]) | |
161 | ]) | |
790e5246 DWT |
162 | AS_IF([test "x$GMAKE" != xmake], [ |
163 | AC_CONFIG_FILES([Makefile]) | |
164 | ]) | |
9c60689e DWT |
165 | AC_CONFIG_FILES([GNUmakefile]) |
166 | AC_OUTPUT |