From: Jay Freeman (saurik) Date: Thu, 20 Jun 2013 09:49:48 +0000 (-0700) Subject: Prefer JavaScriptCore to pkg-config for WebKit. X-Git-Tag: v0.9.500%b1~85 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/4a762893e3ddb9d69ca22ab00ad300f638404113 Prefer JavaScriptCore to pkg-config for WebKit. --- diff --git a/configure.ac b/configure.ac index fa4d7dd..763f6bd 100644 --- a/configure.ac +++ b/configure.ac @@ -148,24 +148,20 @@ AC_ARG_WITH([frameworks], [AS_HELP_STRING( ]) dnl }}} dnl --enable-javascript {{{ AC_DEFUN([CY_CHECK_JAVASCRIPTCORE], [ - PKG_CHECK_MODULES([WEBKIT], [webkit-1.0], [ + AC_CHECK_FRAMEWORK([JavaScriptCore], [ + #include + ], [ + JSEvaluateScript(0, 0, 0, 0, 0, 0); + ], [ AC_SUBST([CY_EXECUTE], [1]) - CY_COMPILE_FLAG([`$PKG_CONFIG --cflags webkit-1.0`]) - AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs webkit-1.0`]) ], [ - PKG_CHECK_MODULES([WEBKIT], [WebKitGtk], [ - AC_SUBST([CY_EXECUTE], [1]) - CY_COMPILE_FLAG([`$PKG_CONFIG --cflags WebKitGtk`]) - AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs WebKitGtk`]) - ], [ - AC_CHECK_FRAMEWORK([JavaScriptCore], [ - #include - ], [ - JSEvaluateScript(0, 0, 0, 0, 0, 0); - ], [ + for cy_webkit_pkg in "webkit-1.0" "WebKitGtk"; do + PKG_CHECK_MODULES([WEBKIT], [$cy_webkit_pkg], [ AC_SUBST([CY_EXECUTE], [1]) - ]) - ]) + CY_COMPILE_FLAG([`$PKG_CONFIG --cflags $cy_webkit_pkg`]) + AC_LIB_APPENDTOVAR([LIBS], [`$PKG_CONFIG --libs $cy_webkit_pkg`]) + ], [:]); if test "x$CY_EXECUTE" = x1; then break; fi + done ]) ])