From: Douglas William Thrift Date: Fri, 2 Apr 2010 08:26:20 +0000 (+0000) Subject: Add AC_CHECK_FRAMEWORK from ImageMagick before modifying it. X-Git-Tag: v0.9.432~99 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/a8732b131b8f59699aec047106c0d04fd99e8e16?ds=sidebyside Add AC_CHECK_FRAMEWORK from ImageMagick before modifying it. --- diff --git a/autogen.sh b/autogen.sh index b10be3f..ac7cc6c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -shopt -s expand_aliases +shopt -s expand_aliases extglob unalias -a case `uname` in (Linux) @@ -13,7 +13,7 @@ case `uname` in esac aclocal sed -e 's/AC_PROG_AWK/dnl &/' -i aclocal.m4 -cat `aclocal --print-ac-dir`/check_gnu_make.m4 find_apr.m4 >> aclocal.m4 +cat `aclocal --print-ac-dir`/check_gnu_make.m4 !(aclocal).m4 >> aclocal.m4 function filter() { sed -e '/no proper invocation of AM_INIT_AUTOMAKE was found\./d' \ diff --git a/framework.m4 b/framework.m4 new file mode 100644 index 0000000..ef7f375 --- /dev/null +++ b/framework.m4 @@ -0,0 +1,49 @@ +# AC_CHECK_FRAMEWORK(FRAMEWORK, FUNCTION, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [OTHER-LIBRARIES]) +# ------------------------------------------------------ +# +# Use a cache variable name containing both the framework and function name, +# because the test really is for framework $1 defining function $2, not +# 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]) +# 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. +# +# FIXME: This macro is extremely suspicious. It DEFINEs unconditionally, +# whatever the FUNCTION, in addition to not being a *S macro. Note +# that the cache does depend upon the function we are looking for. +# +# It is on purpose we used `ac_check_framework_save_LIBS' and not just +# `ac_save_LIBS': there are many macros which don't want to see `LIBS' +# 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_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[).])])