]> git.saurik.com Git - cycript.git/blobdiff - framework.m4
Add a debug.sh script that configures with -g3 -O0.
[cycript.git] / framework.m4
index ef7f375058a3e444d6c8ac8900376466b5c19c98..1de128fec9644b04fbe59d23110650b5d677ad49 100644 (file)
@@ -1,4 +1,4 @@
-# AC_CHECK_FRAMEWORK(FRAMEWORK, FUNCTION,
+# AC_CHECK_FRAMEWORK(FRAMEWORK, PROLOGUE, BODY,
 #              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
 #              [OTHER-LIBRARIES])
 # ------------------------------------------------------
@@ -8,7 +8,7 @@
 # just for framework $1.  Separate tests with the same $1 and different $2s
 # may have different results.
 #
-# Note that using directly AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1_$2])
+# Note that using directly AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
 # is asking for troubles, since AC_CHECK_FRAMEWORK($framework, fun) would give
 # ac_cv_framework_$framework_fun, which is definitely not what was meant.  Hence
 # the AS_LITERAL_IF indirection.
 # changed but still want to use AC_CHECK_FRAMEWORK, so they save `LIBS'.
 # And ``ac_save_LIBS' is too tempting a name, so let's leave them some
 # freedom.
-AC_DEFUN([AC_CHECK_FRAMEWORK],
-[m4_ifval([$3], , [AH_CHECK_FRAMEWORK([$1])])dnl
-AS_LITERAL_IF([$1],
-         [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1_$2])],
-         [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1''_$2])])dnl
-AC_CACHE_CHECK([for $2 in $1 framework], ac_Framework,
-[ac_check_framework_save_LIBS=$LIBS
-LIBS="-framework $1 $5 $LIBS"
-AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
-          [AS_VAR_SET(ac_Framework, yes)],
-          [AS_VAR_SET(ac_Framework, no)])
-LIBS=$ac_check_framework_save_LIBS])
-AS_IF([test AS_VAR_GET(ac_Framework) = yes],
-      [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FRAMEWORK_$1))
-  LIBS="-framework $1 $LIBS"
-])],
-      [$4])dnl
-AS_VAR_POPDEF([ac_Framework])dnl
+AC_DEFUN([AC_CHECK_FRAMEWORK], [
+       m4_ifval([$4], , [AH_CHECK_FRAMEWORK([$1])])dnl
+       AS_LITERAL_IF([$1], [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])],
+               [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1''])]
+       )dnl
+       AC_CACHE_CHECK([for framework $1], ac_Framework, [
+               ac_check_framework_save_LIBS=$LIBS
+               LIBS="-framework $1 $6 $LIBS"
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],[
+                       AS_VAR_SET(ac_Framework, yes)
+               ], [AS_VAR_SET(ac_Framework, no)])
+               LIBS=$ac_check_framework_save_LIBS]
+       )
+       AS_IF([test AS_VAR_GET(ac_Framework) = yes], [
+               AC_LIB_APPENDTOVAR([LIBS], ["-framework $1 $LIBS"])
+               m4_default([$4], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FRAMEWORK_$1))])
+       ], [$5])dnl
+       AS_VAR_POPDEF([ac_Framework])dnl
 ])# AC_CHECK_FRAMEWORK
 
 # AH_CHECK_FRAMEWORK(FRAMEWORK)
 # ---------------------
-m4_define([AH_CHECK_FRAMEWORK],
-[AH_TEMPLATE(AS_TR_CPP(HAVE_FRAMEWORK_$1),
-        [Define to 1 if you have the `]$1[' framework (-framework ]$1[).])])
+m4_define([AH_CHECK_FRAMEWORK], [
+       AH_TEMPLATE(AS_TR_CPP(HAVE_FRAMEWORK_$1),
+       [Define to 1 if you have the `]$1[' framework (-framework ]$1[).]
+)])