Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

classic Classic list List threaded Threaded
54 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton
Administrator
On 26-Jan-2009, Thomas Treichl wrote:

| Ben Abbott schrieb:
| > Nice idea with regards to pulling the patch from the mail list.
| >
| > The configure process did respond with DHAVE_FRAMEWORK_CARBON=1 (see
| > below).
|
| Ok, fine. I hope it also compiles and produces the right output? Then I'll try
| to implement two more improvements before I continue with "-framework OpenGL"
| the next days - coming back to your idea about the build option:
|
| (a) Allow the user to turn on/off support for Carbon when doing "./configure",
| this might then look somehow like this
|
|    ./configure --with-framework-carbon
|
| which also is the default and "--with-framework-carbon" must not be given
| explicitly. Or turn off this support with
|
|    ./configure --without-framework-carbon
|
| so that we have the fallback to use X11.app instead or at least if the user set
| up his system correctly, ie. just use *nix traditional way.
|
| Given the name "--with-framework-carbon" and not only "--with-carbon" looking
| forward to also separate "--with-framework-opengl" from traditional X11/OpenGL
| and we have both "framework OpenGL" and "X11 OpenGL" on Macs that also are quite
| a bit different in their implementation (details soon).

OK.

| (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.

| Should I send a combined changeset or an improvement of my first patch? Any
| other objections?

I'm applying the first patch now, so send it as a separate change.

Thanks,

jwe

Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton
Administrator
In reply to this post by Thomas Treichl
On 25-Jan-2009, Thomas Treichl wrote:

| Thomas Treichl schrieb:
| >> Build time option?
| >
| > Good question, and my last question to John here before I prepare a
| > changeset tomorrow: Do we need a configure test to check for the LDFLAGS
| > '-framework Carbon' or can I just add this to the '*-*-darwin*)' flags
| > of the canonical_host_system in configure.in?
|
| Hi,
|
| I've adjusted display.cc and I'd like to introduce the m4 macro
| "OCTAVE_HAVE_FRAMEWORK". This script allows me to check for the compiler option
| "-framework NAME" and take further arguments $2 and $3 as file prologue and file
| body if some deeper tests should be performed. However, here is my output from
| the ./configure run
|
|    checking whether ld accepts -framework Carbon... yes
|    configure: adding -Wl,-framework -Wl,Carbon to LDFLAGS
|
| Compilation is successful and I also checked if the part HAVE_FRAMEWORK_CARBON
| in display.cc is compiled (and not the X11 part). The output before was
|
|    bash$ octave --quiet --eval 'get (0, "ScreenSize")'
|    ans = 0   0   0   0
|
| The correct new output is
|
|    bash$ octave --quiet --eval 'get (0, "ScreenSize")'
|    ans = 1      1   1680   1050
|
| Ben can you please check if this works on your 10.5 system? If it works, can it
| be included into the sources? Thanks,

I applied this patch with a few small changes.

Thanks,

jwe
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
In reply to this post by John W. Eaton
John W. Eaton schrieb:

> On 26-Jan-2009, Thomas Treichl wrote:
>
> | Ben Abbott schrieb:
> | > Nice idea with regards to pulling the patch from the mail list.
> | >
> | > The configure process did respond with DHAVE_FRAMEWORK_CARBON=1 (see
> | > below).
> |
> | Ok, fine. I hope it also compiles and produces the right output? Then I'll try
> | to implement two more improvements before I continue with "-framework OpenGL"
> | the next days - coming back to your idea about the build option:
> |
> | (a) Allow the user to turn on/off support for Carbon when doing "./configure",
> | this might then look somehow like this
> |
> |    ./configure --with-framework-carbon
> |
> | which also is the default and "--with-framework-carbon" must not be given
> | explicitly. Or turn off this support with
> |
> |    ./configure --without-framework-carbon
> |
> | so that we have the fallback to use X11.app instead or at least if the user set
> | up his system correctly, ie. just use *nix traditional way.
> |
> | Given the name "--with-framework-carbon" and not only "--with-carbon" looking
> | forward to also separate "--with-framework-opengl" from traditional X11/OpenGL
> | and we have both "framework OpenGL" and "X11 OpenGL" on Macs that also are quite
> | a bit different in their implementation (details soon).
>
> OK.
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

> | (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.

Best regards,

   Thomas

# HG changeset patch
# User Thomas Treichl <[hidden email]>
# 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  <[hidden email]>
+
+ * 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  <[hidden email]>
 
  * 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
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton
Administrator
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.

| > | (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.

Thanks,

jwe
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
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 <[hidden email]>
# 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  <[hidden email]>
+
+ * 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  <[hidden email]>
 
  * 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 <[hidden email]>
# 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  <[hidden email]>
+2009-01-29  Thomas Treichl  <[hidden email]>
 
  * 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  <[hidden email]>
 
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 | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

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

| 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.

There seem to be two hg changesets in your attachment.  I'm confused.
Which one are you saying should be applied?

jwe
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
John W. Eaton schrieb:
> On 29-Jan-2009, Thomas Treichl wrote:
>
> | 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.
>
> There seem to be two hg changesets in your attachment.  I'm confused.
> Which one are you saying should be applied?

I did

   hg export --git 8618 8635 >carbon.changeset

seems that this is not the way to create a new one?
How can I merge these two changesets into one changeset and export it?

   Thomas
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

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

| John W. Eaton schrieb:
| > On 29-Jan-2009, Thomas Treichl wrote:
| >
| > | 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.
| >
| > There seem to be two hg changesets in your attachment.  I'm confused.
| > Which one are you saying should be applied?
|
| I did
|
|    hg export --git 8618 8635 >carbon.changeset
|
| seems that this is not the way to create a new one?
| How can I merge these two changesets into one changeset and export it?

If you are using mercurial queues, then I think you can do it with
qfold.  Otherwise, check the mercurial wiki:

  http://www.selenic.com/mercurial/wiki/index.cgi/ConcatenatingChangesets

jwe
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
John W. Eaton schrieb:

> On 29-Jan-2009, Thomas Treichl wrote:
>
> | John W. Eaton schrieb:
> | > On 29-Jan-2009, Thomas Treichl wrote:
> | >
> | > | 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.
> | >
> | > There seem to be two hg changesets in your attachment.  I'm confused.
> | > Which one are you saying should be applied?
> |
> | I did
> |
> |    hg export --git 8618 8635 >carbon.changeset
> |
> | seems that this is not the way to create a new one?
> | How can I merge these two changesets into one changeset and export it?
>
> If you are using mercurial queues, then I think you can do it with
> qfold.  Otherwise, check the mercurial wiki:
>
>   http://www.selenic.com/mercurial/wiki/index.cgi/ConcatenatingChangesets
Ok thanks, none did work for me, but it doesn't matter (it's my fault: mercurial
is still a very big mystery for me). I did a mouse copy&paste of my changes to a
new repo and exported this old/new changeset once again. I hope it works now...

Best regards,

   Thomas

# HG changeset patch
# User Thomas Treichl <[hidden email]>
# Date 1233262909 -3600
# Node ID bef8f001032f792df1d4ec22e58042aff73e7eac
# Parent  cbd6545b0d85b21b1b9b1914ce34ba1034092c12
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-29  Thomas Treichl  <[hidden email]>
+
+ * aclocal.m4 (OCTAVE_HAVE_FRAMEWORK): Add support for
+ --with-framework-<name> and replace "$ac_safe" by "$1".
+ * configure.in: Change "have_carbon" with
+ "have_framework_carbon".
+
 2009-01-28  John W. Eaton  <[hidden email]>
 
  * configure.in: Check to see that pcre library has pcre_compile
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
@@ -272,11 +272,11 @@
 
 ### 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
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

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

| Ok thanks, none did work for me, but it doesn't matter (it's my fault: mercurial
| is still a very big mystery for me). I did a mouse copy&paste of my changes to a
| new repo and exported this old/new changeset once again. I hope it works now...

I checked it in.

Thanks,

jwe
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
In reply to this post by John W. Eaton
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.

I attached my play script configure.in (test from my virtual Linux box and my
Mac are include as comments at the bottom) to this email. If this is the right
thing then please consider the second file as the changeset.


> | > | (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.
I may come back to this idea somewhen the next days, is $(CARBON_LIBS) okay?

   Thomas

AC_INIT
AC_REVISION($Revision: 1.0 $)
AC_PREREQ(2.57)
AC_CONFIG_HEADER(config.h)

AC_PATH_X
if test "$have_x"; then
  AC_DEFINE(HAVE_X_WINDOWS, 1, [Define if you have X11])

  if test $x_includes != "NONE"; then
    X11_INCFLAGS="$x_includes"
  fi
  AC_SUBST(X11_INCFLAGS)

  if test -z $x_libraries; then
    AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=])
  elif test $x_libraries != "NONE"; then
    AC_CHECK_LIB(X11, XrmInitialize,
      [X11_LIBS="-L$x_libraries -lX11"], [X11_LIBS=], "-L$x_libraries")
  fi
  AC_SUBST(X11_LIBS)
fi

AC_MSG_NOTICE([
  X11 include flags:    $X11_INCFLAGS
  X11 libraries:        $X11_LIBS
])

AC_OUTPUT

# On Linux (before and now): autoheader && autoconf && ./configure
#   checking for X... libraries , headers
#   checking for XrmInitialize in -lX11... yes
#   configure:
#     X11 include flags:    
#     X11 libraries:        -lX11

# On Linux (before): autoheader && autoconf && ./configure --without-x
#   checking for X... disabled
#   checking for XrmInitialize in -lX11... yes
#   configure:
#     X11 include flags:    NONE
#     X11 libraries:        -lX11

# On Linux (now): autoheader && autoconf && ./configure --without-x
#   checking for X... disabled
#   configure:
#     X11 include flags:    
#     X11 libraries:        

# On Mac (before): autoheader && autoconf && ./configure
#   checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
#   checking for XrmInitialize in -lX11... no
#   configure:
#     X11 include flags:    /usr/X11R6/include
#     X11 libraries:        

# On Mac (now): autoheader && autoconf && ./configure
#   checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
#   checking for XrmInitialize in -lX11... yes
#   configure:
#     X11 include flags:    /usr/X11R6/include
#     X11 libraries:        -L/usr/X11R6/lib -lX11

# On Mac (before): autoheader && autoconf && ./configure --without-x
#   checking for X... disabled
#   checking for XrmInitialize in -lX11... no
#   configure:
#     X11 include flags:    NONE
#     X11 libraries:        

# On Mac (now): autoheader && autoconf && ./configure --without-x
#   checking for X... disabled
#   configure:
#     X11 include flags:    
#     X11 libraries:        

# HG changeset patch
# User Thomas Treichl <[hidden email]>
# Date 1233351758 -3600
# Node ID 29e12afa2789a4a78e50a46a5a658b3745334553
# Parent  06f5dd901f301c7f87127004846d410046f26623
Fix test for X11 if "--without-x" is given.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-30  Thomas Treichl  <[hidden email]>
+
+ * configure.in: Fix test for X11 if "--without-x" is given.
+
 2009-01-30  Marco Atzeri  <[hidden email]>
 
  * configure.in (SHLLIBPRE, SHLBINPRE): Fix definitions for Cygwin.
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -263,10 +263,17 @@
 if test "$have_x"; then
   AC_DEFINE(HAVE_X_WINDOWS, 1, [Define if you have X11])
 
-  X11_INCFLAGS="$x_includes"
+  if test $x_includes != "NONE"; then
+    X11_INCFLAGS="$x_includes"
+  fi
   AC_SUBST(X11_INCFLAGS)
 
-  AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=])
+  if test -z $x_libraries; then
+    AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=])
+  elif test $x_libraries != "NONE"; then
+    AC_CHECK_LIB(X11, XrmInitialize,
+      [X11_LIBS="-L$x_libraries -lX11"], [X11_LIBS=], "-L$x_libraries")
+  fi
   AC_SUBST(X11_LIBS)
 fi
 
Reply | Threaded
Open this post in threaded view
|

[changeset] Missing ScreenSize & ScreenPixelsPerInch properties

Thomas Treichl
Thomas Treichl schrieb:

>> | > | (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.
>
> I may come back to this idea somewhen the next days, is $(CARBON_LIBS)
> okay?
I attached a changeset that uses $(CARBON_LIBS) instead of just $(LIBS). Should
this also find its place in mkoctfile.in and octave-config.in? I was looking for
$(X11_LIBS) in these files but couldn't find any, my implementation leans on X11
ie. I can more easily find out where it should be added. I'll also send a
changeset for the documentation when I've finished the framework OpenGL test, too.

Did you already have a chance to take a look at my second trial X11 test from my
previous email of this thread?

Best regards,

   Thomas

# HG changeset patch
# User Thomas Treichl <[hidden email]>
# Date 1233868769 -3600
# Node ID dbcb4e41805bd8c0aac81d12d5c51cec30ffeba7
# Parent  6f5b2835325cd17552ea2f5f085c066f1518a45f
Use CARBON_LIBS instead of LIBS for framework Carbon.

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-04  Thomas Treichl  <[hidden email]>
+
+ * Makeconf.in: Substitute CARBON_LIBS.
+ * configure.in: Use CARBON_LIBS instead of LIBS for framework Carbon.
+
 2009-02-03  Jaroslav Hajek  <[hidden email]>
 
  * aclocal.m4 (AC_CHECK_QHULL_OK): New macro, based on suggestion by
diff --git a/Makeconf.in b/Makeconf.in
--- a/Makeconf.in
+++ b/Makeconf.in
@@ -152,6 +152,8 @@
 
 X11_INCFLAGS = @X11_INCFLAGS@
 X11_LIBS = @X11_LIBS@
+
+CARBON_LIBS = @CARBON_LIBS@
 
 MAGICK_CONFIG = @MAGICK_CONFIG@
 MAGICK_INCFLAGS = $(shell $(MAGICK_CONFIG) --cppflags)
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -275,8 +275,9 @@
   [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.])
-  LIBS="$LIBS -Wl,-framework -Wl,Carbon"
-  AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to LIBS])
+  CARBON_LIBS="-Wl,-framework -Wl,Carbon"
+  AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to CARBON_LIBS])
+  AC_SUBST(CARBON_LIBS)
 fi
 
 ### On Intel systems with gcc, we may need to compile with -mieee-fp
@@ -2119,6 +2120,7 @@
   FLTK backend libs:    $GRAPHICS_LIBS
   X11 include flags:    $X11_INCFLAGS
   X11 libraries:        $X11_LIBS
+  CARBON libraries:     $CARBON_LIBS
   LIBS:                 $LIBS
   Default pager:        $DEFAULT_PAGER
   gnuplot:              $GNUPLOT
diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-21  John W. Eaton  <[hidden email]>
+
+ * Makefile.in (octave$(EXEEXT)): Link with CARBON_LIBS.
+
 2009-02-04  John W. Eaton  <[hidden email]>
 
  * pt-loop.h, pt-loop.cc (evaluating_looping_command):
diff --git a/src/Makefile.in b/src/Makefile.in
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -374,7 +374,7 @@
  $(LEXLIB) $(UMFPACK_LIBS) $(AMD_LIBS) $(CAMD_LIBS) $(COLAMD_LIBS) \
  $(CHOLMOD_LIBS) $(CCOLAMD_LIBS) $(CXSPARSE_LIBS) $(BLAS_LIBS) \
  $(FFTW_LIBS) $(QRUPDATE_LIBS) $(ARPACK_LIBS) $(OPENGL_LIBS) \
- $(X11_LIBS) $(LIBS) $(FLIBS)
+ $(X11_LIBS) $(CARBON_LIBS) $(LIBS) $(FLIBS)
 
 stmp-pic: pic
  @if [ -f stmp-pic ]; then \
Reply | Threaded
Open this post in threaded view
|

Re: [changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton
Administrator
In reply to this post by Thomas Treichl
On 30-Jan-2009, Thomas Treichl wrote:

| I attached my play script configure.in (test from my virtual Linux box and my
| Mac are include as comments at the bottom) to this email. If this is the right
| thing then please consider the second file as the changeset.

OK, I applied this patch.

Thanks,

jwe
Reply | Threaded
Open this post in threaded view
|

[changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton
Administrator
In reply to this post by Thomas Treichl
On  5-Feb-2009, Thomas Treichl wrote:

| Thomas Treichl schrieb:
| >> | > | (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.
| >
| > I may come back to this idea somewhen the next days, is $(CARBON_LIBS)
| > okay?
|
| I attached a changeset that uses $(CARBON_LIBS) instead of just $(LIBS). Should
| this also find its place in mkoctfile.in and octave-config.in? I was looking for
| $(X11_LIBS) in these files but couldn't find any, my implementation leans on X11
| ie. I can more easily find out where it should be added. I'll also send a
| changeset for the documentation when I've finished the framework OpenGL test, too.

I applied this changeset, and also added CARBON_LIBS, X11_INCFLAGS,
and X11_LIBS to the octave_config_info struct.  Changeet here:

  http://hg.savannah.gnu.org/hgweb/octave/rev/d3382daaf4d2

Thanks,

jwe
123