diff aclocal.m4 @ 8595:dee5d60257e4

Use Carbon framework to determine ScreenSize on Mac.
author Thomas Treichl <Thomas.Treichl@gmx.net>
date Mon, 26 Jan 2009 23:07:09 -0500
parents 66bc6f9b4f72
children bef8f001032f
line wrap: on
line diff
--- a/aclocal.m4	Mon Jan 26 22:43:29 2009 -0500
+++ b/aclocal.m4	Mon Jan 26 23:07:09 2009 -0500
@@ -1270,4 +1270,29 @@
  AC_DEFINE(HAVE_FAST_INT_OPS,1,[Define if signed integers use two's complement])],
 [AC_MSG_RESULT([no])])
 AC_LANG_POP(C++)])
-
+dnl
+dnl Check to see if the compiler and the linker can handle the flags
+dnl "-framework $1" for the given prologue $2 and the given body $3
+dnl of a source file.  Arguments 2 and 3 optionally can also be empty.
+dnl If this test is dnl successful then perform $4, otherwise do $5.
+dnl
+dnl OCTAVE_HAVE_FRAMEWORK
+AC_DEFUN(OCTAVE_HAVE_FRAMEWORK, [
+  ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'`
+  AC_MSG_CHECKING(whether ${LD-ld} accepts -framework $1)
+  AC_CACHE_VAL(octave_cv_framework_$ac_safe, [
+    XLDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS -framework $1"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
+      eval "octave_cv_framework_$ac_safe=yes",
+      eval "octave_cv_framework_$ac_safe=no")
+    LDFLAGS="$XLDFLAGS"
+  ])
+  if eval "test \"`echo '$octave_cv_framework_'$ac_safe`\" = yes"; then
+    AC_MSG_RESULT(yes)
+    [$4]
+  else
+    AC_MSG_RESULT(no)
+    [$5]
+  fi
+])