# HG changeset patch # User Thomas Treichl # Date 1233262909 -3600 # Node ID bef8f001032f792df1d4ec22e58042aff73e7eac # Parent cbd6545b0d85b21b1b9b1914ce34ba1034092c12 Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework. diff -r cbd6545b0d85 -r bef8f001032f ChangeLog --- a/ChangeLog Thu Jan 29 14:52:38 2009 -0500 +++ b/ChangeLog Thu Jan 29 22:01:49 2009 +0100 @@ -1,3 +1,10 @@ +2009-01-29 Thomas Treichl + + * aclocal.m4 (OCTAVE_HAVE_FRAMEWORK): Add support for + --with-framework- and replace "$ac_safe" by "$1". + * configure.in: Change "have_carbon" with + "have_framework_carbon". + 2009-01-28 John W. Eaton * configure.in: Check to see that pcre library has pcre_compile diff -r cbd6545b0d85 -r bef8f001032f aclocal.m4 --- a/aclocal.m4 Thu Jan 29 14:52:38 2009 -0500 +++ b/aclocal.m4 Thu Jan 29 22:01:49 2009 +0100 @@ -1272,25 +1272,37 @@ 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 "-framework $1" for the given prologue $2 and the given body $3 of +dnl a source file. Arguments 2 and 3 optionally can also be empty. +dnl Add options (lower case letters $1) "--with-framework-$1" and +dnl "--without-framework-$1". If this test is successful then perform +dnl $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, [ + AC_CACHE_VAL(octave_cv_framework_$1, [ XLDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -framework $1" + AC_LANG_PUSH(C++) AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])], - eval "octave_cv_framework_$ac_safe=yes", - eval "octave_cv_framework_$ac_safe=no") + eval "octave_cv_framework_$1=yes", + eval "octave_cv_framework_$1=no") + AC_LANG_POP(C++) LDFLAGS="$XLDFLAGS" ]) - if eval "test \"`echo '$octave_cv_framework_'$ac_safe`\" = yes"; then + if test "$octave_cv_framework_$1" = "yes"; then AC_MSG_RESULT(yes) - [$4] + AC_ARG_WITH(framework-m4_tolower($1), + [AS_HELP_STRING([--without-framework-m4_tolower($1)], + [don't use framework $1])], + with_have_framework=$withval, with_have_framework="yes") + if test "$with_have_framework" = "yes"; then + [$4] + else + AC_MSG_NOTICE([framework rejected by --without-framework-m4_tolower($1)]) + [$5] + fi else AC_MSG_RESULT(no) [$5] diff -r cbd6545b0d85 -r bef8f001032f configure.in --- a/configure.in Thu Jan 29 14:52:38 2009 -0500 +++ b/configure.in Thu Jan 29 22:01:49 2009 +0100 @@ -272,11 +272,11 @@ ### On MacOSX system the Carbon framework is used to determine ScreenSize OCTAVE_HAVE_FRAMEWORK(Carbon, [#include ], [CGMainDisplayID ()], - [have_carbon="yes"], [have_carbon="no"]) -if test $have_carbon = "yes"; then + [have_framework_carbon="yes"], [have_framework_carbon="no"]) +if test $have_framework_carbon = "yes"; then AC_DEFINE(HAVE_FRAMEWORK_CARBON, 1, [Define if framework CARBON is available.]) - LDFLAGS="$LDFLAGS -Wl,-framework -Wl,Carbon" - AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to LDFLAGS]) + LIBS="$LIBS -Wl,-framework -Wl,Carbon" + AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to LIBS]) fi ### On Intel systems with gcc, we may need to compile with -mieee-fp