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