octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties


From: Thomas Treichl
Subject: Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties
Date: Thu, 29 Jan 2009 21:05:01 +0100
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

John W. Eaton schrieb:
On 29-Jan-2009, Thomas Treichl wrote:

| Ok, here is my second changeset. *Note* that I also made a small change to the | test of X11, I added "-L$x_libraries" to AC_CHECK_LIB as the 5th argument | because if I use --x-libraries=/usr/X11R6/lib for configure then this option is | currently ignored and the test then fails because XrmInitialize is not found. I | hope this was the right thing to do?! | | I compiled both ways, both do work very well (the Carbon compiled test with | normal Desktop, X11 under X1.app). If somebody wants to compile without | framework Carbon support then a typical line would look like | | ./configure --without-framework-carbon --x-includes=/usr/X11R6/include | --x-libraries=/usr/X11R6/lib | | a typical output then for this line is | | checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
|    checking for XrmInitialize in -lX11... yes
|    checking whether ld accepts -framework Carbon... yes
|    configure: framework rejected by --without-framework-carbon

OK, I tried this patch and now I see

checking for X... libraries , headers checking for XrmInitialize in -lX11... no
  checking whether ld accepts -framework Carbon... no

and no X11 libraries show up in the summary output.  Without the
patch, I see

checking for X... libraries , headers checking for XrmInitialize in -lX11... yes
  checking whether ld accepts -framework Carbon... no

and the summary output was

X11 include flags: X11 libraries: -lX11

so something is not quite right.

Oooppss, sorry, I expect that your $x_libraries is empty, right? Then "-L " is added to your test and this is not the right way. I need a better idea for this... I removed this changes and created a new changeset just for the Carbon part.

| > | (b) Turn off empty output of configuration summary if Carbon is used, eg.
| > | | > | X11 include flags:
| > |    X11 libraries:
| > | | > | and turn on output about Carbon framework instead, eg. | > | | > | Carbon libraries: -Wl,-framework -Wl,Carbon | > | > I don't think this part is really necessary, so I'd say omit it. | | Yes ok.

I meant the part about removing the empty X11 include and library
flags.  It would be OK to put the Carbon libraries in the summary if
they are stored in a separate variable.  But I see that you are
currently adding them to LIBS, so in that case I don't think a
separate line is needed.

LIBS was the better way to go than LDFLAGS before...

  Thomas
# HG changeset patch
# User Thomas Treichl <address@hidden>
# Date 1233254677 -3600
# Node ID 6e7e7faab054db9208d6379ba9763c1359ce116f
# Parent  4b26e9fbbb379382fd83e39cdd03ff2ae2fb1515
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX 
Carbon framework.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-26  Thomas Treichl  <address@hidden>
+
+       * aclocal.m4 (OCTAVE_HAVE_FRAMEWORK): Add support for 
+       --with-framework-<name> and replace "$ac_safe" by "$1".
+       * configure.in: Add "-L$x_libraries" to X11 test and
+       change "have_carbon" with "have_framework_carbon".
+
 2009-01-27  Benjamin Lindner  <address@hidden>
 
        * configure.in: Add of -lregex to REGEX_LIBS.
diff --git a/aclocal.m4 b/aclocal.m4
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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 --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -266,17 +266,17 @@
   X11_INCFLAGS="$x_includes"
   AC_SUBST(X11_INCFLAGS)
 
-  AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=])
+  AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=], 
"-L$x_libraries")
   AC_SUBST(X11_LIBS)
 fi
 
 ### On MacOSX system the Carbon framework is used to determine ScreenSize
 OCTAVE_HAVE_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>], [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
# HG changeset patch
# User Thomas Treichl <address@hidden>
# Date 1233259122 -3600
# Node ID d3fdae0f06ee98b4a831e6c9cf5d566ceaf5fc3e
# Parent  6e7e7faab054db9208d6379ba9763c1359ce116f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the
 MacOSX Carbon framework.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,9 @@
-2009-01-26  Thomas Treichl  <address@hidden>
+2009-01-29  Thomas Treichl  <address@hidden>
 
        * aclocal.m4 (OCTAVE_HAVE_FRAMEWORK): Add support for 
        --with-framework-<name> and replace "$ac_safe" by "$1".
-       * configure.in: Add "-L$x_libraries" to X11 test and
-       change "have_carbon" with "have_framework_carbon".
+       * configure.in: Change "have_carbon" with 
+       "have_framework_carbon".
 
 2009-01-27  Benjamin Lindner  <address@hidden>
 
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -266,7 +266,7 @@
   X11_INCFLAGS="$x_includes"
   AC_SUBST(X11_INCFLAGS)
 
-  AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=], 
"-L$x_libraries")
+  AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=])
   AC_SUBST(X11_LIBS)
 fi
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]