After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 348203 - obsolete macros and new tests in configure.in
obsolete macros and new tests in configure.in
Status: RESOLVED FIXED
Product: gnome-mag
Classification: Deprecated
Component: others
unspecified
Other All
: Normal normal
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks: 348375
 
 
Reported: 2006-07-21 01:36 UTC by Carlos Eduardo Rodrigues Diógenes
Modified: 2007-03-12 13:39 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
This patch replaces the obsolete macros and add the new test needed for full screen magnification (4.40 KB, patch)
2006-07-21 01:38 UTC, Carlos Eduardo Rodrigues Diógenes
needs-work Details | Review
This patch corrects the old tests and add a new one to check for Xrender (5.44 KB, patch)
2006-07-21 15:54 UTC, Carlos Eduardo Rodrigues Diógenes
reviewed Details | Review
Add the AC_SUBST of X_FLAGS to the other patchs (9.51 KB, patch)
2006-07-21 19:10 UTC, Carlos Eduardo Rodrigues Diógenes
reviewed Details | Review
The patch above corrected to only patch what is needed. (5.65 KB, patch)
2006-07-24 23:50 UTC, Carlos Eduardo Rodrigues Diógenes
none Details | Review
This replaces AC_TRY_LINK with AC_CHECK_LIB and add the new tests (5.71 KB, patch)
2006-07-27 20:34 UTC, Carlos Eduardo Rodrigues Diógenes
none Details | Review
replace the obsolete macro AC_TRY_LINK with AC_CHECK_LIB (823 bytes, patch)
2007-03-10 22:08 UTC, Carlos Eduardo Rodrigues Diógenes
committed Details | Review

Description Carlos Eduardo Rodrigues Diógenes 2006-07-21 01:36:56 UTC
The macro AC_TRY_LINK is considered obsolete in the Autoconf info manual. Moreover, new tests are needed to a magnifier that will implement full screen magnification, since the use o Composite, Overlay window and ShapeInput are importants to achieve a good user interaction.
Comment 1 Carlos Eduardo Rodrigues Diógenes 2006-07-21 01:38:53 UTC
Created attachment 69300 [details] [review]
This patch replaces the obsolete macros and add the new test needed for full screen magnification
Comment 2 Carlos Eduardo Rodrigues Diógenes 2006-07-21 15:54:53 UTC
Created attachment 69338 [details] [review]
This patch corrects the old tests and add a new one to check for Xrender
Comment 3 Carlos Eduardo Rodrigues Diógenes 2006-07-21 19:10:36 UTC
Created attachment 69354 [details] [review]
Add the AC_SUBST of X_FLAGS to the other patchs
Comment 4 Carlos Eduardo Rodrigues Diógenes 2006-07-24 23:50:34 UTC
Created attachment 69538 [details] [review]
The patch above corrected to only patch what is needed.
Comment 5 bill.haneman 2006-07-27 13:45:01 UTC
Comment on attachment 69538 [details] [review]
The patch above corrected to only patch what is needed.

>Index: configure.in
>===================================================================
>RCS file: /cvs/gnome/gnome-mag/configure.in,v
>retrieving revision 1.113
>diff -u -p -r1.113 configure.in
>--- configure.in	24 Jul 2006 23:12:37 -0000	1.113
>+++ configure.in	24 Jul 2006 23:46:25 -0000
>@@ -118,7 +118,7 @@ if test "x$XDAMAGE_LIBS" = x; then
>     *solaris*) XDAMAGE_RPATH_FLAGS="-R$xdamagepath" ;;
>     esac
>     AC_MSG_CHECKING(for -lXdamage in $xdamagepath)
>-    AC_TRY_LINK([], [XDamageCreate()], [

Why did you change AC_TRY_LINK to AC_CHECK_FUNC here?
Shouldn't it be AC_LINK_IFELSE ?

>+    AC_CHECK_FUNC(XDamageCreate, [
> 	AC_MSG_RESULT(yes)
> 	XDAMAGE_LIBS="$XDAMAGE_RPATH_FLAGS -L$xdamagepath -lXdamage"
>         LIBS="$save_LIBS"
>@@ -154,7 +154,7 @@ if test "x$XFIXES_LIBS" = x; then
>     *solaris*) XFIXES_RPATH_FLAGS="-R$xfixespath" ;;
>     esac
>     AC_MSG_CHECKING(for -lXfixes in $xfixespath)
>-    AC_TRY_LINK([], [XFixesCreateRegion()], [
>+    AC_CHECK_FUNC(XFixesCreateRegion, [

Same question here.

> 	AC_MSG_RESULT(yes)
> 	XFIXES_LIBS="$XFIXES_RPATH_FLAGS -L$xfixespath -lXfixes"
>         LIBS="$save_LIBS"
>@@ -174,6 +174,136 @@ else
>   AC_DEFINE(HAVE_XFIXES, 1, [The XFIXES extension is present])
> fi
> 
>+dnl path to XRENDER
>+AC_CHECK_LIB(Xrender, XRenderCreatePicture, XRENDER_LIBS=-lXrender)
>+if test "x$XRENDER_LIBS" = x; then
>+  save_LIBS="$LIBS"
>+  for xrenderpath in $x_libraries; do
>+    LIBS="-L$xrenderpath -lXrender -lX11"
>+    case "$host" in
>+    *solaris*) XRENDER_RPATH_FLAGS="-R$xrenderpath" ;;
>+    esac
>+    AC_MSG_CHECKING(for -lXrender in $xrenderpath)
>+    AC_CHECK_FUNC(XRenderCreatePicture, [
>+	AC_MSG_RESULT(yes)
>+	XRENDER_LIBS="$XRENDER_RPATH_FLAGS -L$xrenderpath -lXrender"
>+        LIBS="$save_LIBS"
>+	break],[AC_MSG_RESULT(no)])
>+  done
>+  if test "x$XRENDER_LIBS" = x; then
>+    AC_MSG_WARN(Couldn't find the XRENDER library. Check config.log for details)
>+    LIBS="$save_LIBS"
>+  else
>+    X_LIBS="$X_LIBS $XRENDER_LIBS"
>+    AC_CHECK_HEADER(X11/extensions/Xrender.h, have_xrender=yes)
>+    AC_DEFINE(HAVE_RENDER, 1, [The XRENDER extension is present])
>+  fi
>+else
>+  X_LIBS="$X_LIBS $XRENDER_LIBS"
>+  AC_CHECK_HEADER(X11/extensions/Xrender.h, have_xrender=yes)
>+  AC_DEFINE(HAVE_RENDER, 1, [The XRENDER extension is present])
>+fi
>+
>+dnl path to XCOMPOSITE
>+AC_CHECK_LIB(Xcomposite, XCompositeQueryExtension, XCOMPOSITE_LIBS=-lXcomposite)
>+if test "x$XCOMPOSITE_LIBS" = x; then
>+  save_LIBS="$LIBS"
>+  for xcompositepath in $x_libraries; do
>+    LIBS="-L$xcompositepath -lXcomposite -lX11"
>+    case "$host" in
>+    *solaris*) XCOMPOSITE_RPATH_FLAGS="-R$xcompositepath" ;;
>+    esac
>+    AC_MSG_CHECKING(for -lXcomposite in $xcompositepath)
>+    AC_CHECK_FUNC(XCompositeQueryExtension, [
>+        AC_MSG_RESULT(yes)
>+        XCOMPOSITE_LIBS="$XCOMPOSITE_RPATH_FLAGS -L$xcompositepath -lXcomposite"
>+        LIBS="$save_LIBS"
>+        break],[AC_MSG_RESULT(no)])
>+  done
>+  if test "x$XCOMPOSITE_LIBS" = x; then
>+    AC_MSG_WARN(Couldn't find the XCOMPOSITE library. Check config.log for details)
>+    LIBS="$save_LIBS"
>+  else
>+    save_LIBS="$LIBS"
>+    X_LIBS="$X_LIBS $XCOMPOSITE_LIBS"
>+    LIBS="$X_LIBS"
>+    AC_CHECK_HEADER(X11/extensions/Xcomposite.h, have_xcomposite=yes)
>+    AC_DEFINE(HAVE_COMPOSITE, 1, [The XCOMPOSITE extension is present])
>+    AC_CHECK_FUNC(XCompositeGetOverlayWindow, [
>+        AC_DEFINE(HAVE_OVERLAY, 1, [The Composite extension has Overlay window])])
>+    LIBS="$save_LIBS"
>+  fi
>+else
>+  save_LIBS="$LIBS"
>+  X_LIBS="$X_LIBS $XCOMPOSITE_LIBS"
>+  LIBS="$X_LIBS"
>+  AC_CHECK_HEADER(X11/extensions/Xcomposite.h, have_xcomposite=yes)
>+  AC_DEFINE(HAVE_COMPOSITE, 1, [The XCOMPOSITE extension is present])
>+  AC_CHECK_FUNC(XCompositeGetOverlayWindow, [
>+      AC_DEFINE(HAVE_OVERLAY, 1, [The Composite extension has Overlay window])])
>+  LIBS="$save_LIBS"
>+fi
>+
>+dnl path to XEXT
>+AC_CHECK_LIB(Xext, XShapeCombineRectangles, XEXT_LIBS=-lXext)
>+if test "x$XEXT_LIBS" = x; then
>+  save_LIBS="$LIBS"
>+  for xextpath in $x_libraries; do
>+    LIBS="-L$xextpath -lXext -lX11"
>+    case "$host" in
>+    *solaris*) XEXT_RPATH_FLAGS="-R$xextpath" ;;
>+    esac
>+    AC_MSG_CHECKING(for -lXext in $xextpath)
>+    AC_CHECK_FUNC(XShapeCombineRectangles, [
>+        AC_MSG_RESULT(yes)
>+        XEXT_LIBS="$XEXT_RPATH_FLAGS -L$xextpath -lXext"
>+        LIBS="$save_LIBS"
>+        break],[AC_MSG_RESULT(no)])
>+  done
>+  if test "x$XEXT_LIBS" = x; then
>+    AC_MSG_WARN(Couldn't find the XShape function in Xext library. Check config.log for details)
>+    LIBS="$save_LIBS"
>+  else
>+    save_LIBS="$LIBS"
>+    save_CFLAGS="$CFLAGS"
>+    X_LIBS="$X_LIBS $XEXT_LIBS"
>+    LIBS="$X_LIBS"
>+    CFLAGS="-I$x_includes $CFLAGS"
>+    AC_CHECK_HEADER(X11/extensions/shape.h, have_xshape=yes)
>+    AC_DEFINE(HAVE_XSHAPE, 1, [The XShape extension is present])
>+    if test "x$have_xshape" = x; then
>+      AC_MSG_WARN(Couldn't find XShape shape.h header. Check config.log for details)
>+    else
>+      AC_CHECK_DECL(ShapeInput, [
>+          AC_DEFINE(HAVE_SHAPEINPUT, 1, [
>+	      The Shape extension have ShapeInput])],
>+          [], [#include <X11/extensions/shape.h>])
>+    fi
>+    LIBS="$save_LIBS"
>+    CFLAGS="$save_CFLAGS"
>+  fi
>+else
>+  save_LIBS="$LIBS"
>+  save_CFLAGS="$CFLAGS"
>+  X_LIBS="$X_LIBS $XEXT_LIBS"
>+  LIBS="$X_LIBS"
>+  CFLAGS="-I$x_includes $CFLAGS"
>+  AC_CHECK_HEADER(X11/extensions/shape.h, have_xshape=yes)
>+  AC_DEFINE(HAVE_XSHAPE, 1, [The XShape extension is present])
>+  if test "x$have_xshape" = x; then
>+    AC_MSG_WARN(Couldn't find XShape shape.h header. Check config.log for details)
>+  else
>+    AC_CHECK_DECL(ShapeInput, [
>+        AC_DEFINE(HAVE_SHAPEINPUT, 1, [
>+	    The Shape extension have ShapeInput])],
>+        [], [#include <X11/extensions/shape.h>])
>+  fi
>+  LIBS="$save_LIBS"
>+  CFLAGS="$save_CFLAGS"
>+fi
>+
>+X_FLAGS="-I$x_includes"
>+AC_SUBST(X_FLAGS)
> AC_SUBST(X_LIBS)
> 
> PKG_CHECK_MODULES(LIBDEPS, [
Comment 6 Carlos Eduardo Rodrigues Diógenes 2006-07-27 15:29:37 UTC
Thanks for point this Bill. When I was reading autoconf documentation I realize that AC_CHECK_FUNC could be a good choose, but reading it again it does no appear the more appropriate macro for this. I believe that a better choice then AC_LINK_IFELSE is AC_CHECK_LIB. What do you think?
Comment 7 bill.haneman 2006-07-27 18:07:12 UTC
I read today (somewhere) that AC_LINK is 'better' than AC_CHECK_LIB because it checks to make sure that a program using the function can actually be linked.  We are already using AC_CHECK_LIB in the outer 'if' - perhaps it would still be enough to use AC_CHECK_LIB when searching the other library paths.  But I am not an autotools expert!
Comment 8 Carlos Eduardo Rodrigues Diógenes 2006-07-27 20:20:25 UTC
I think that what you read is false, because of this information that can be found in the autoconf info page about the AC_CHECK_LIB macro:

"... try to ensure that the C, C++, or Fortran function FUNCTION is available by checking whether a test program can be *linked* with the library LIBRARY to get the function. ..."

I think that you are right, it would be enough to use AC_CHECK_LIB to the other paths. I will try it and put here the patch if it works.
Comment 9 Carlos Eduardo Rodrigues Diógenes 2006-07-27 20:32:57 UTC
Bill, I create a new patch for it using AC_CHECK_LIB. I think that a positive point to AC_CHECK_LIB is that the FUNCTION is linked with the specified LIBRARY, because this guarantees that the function we want is in the rigth library.
Comment 10 Carlos Eduardo Rodrigues Diógenes 2006-07-27 20:34:26 UTC
Created attachment 69762 [details] [review]
This replaces AC_TRY_LINK with AC_CHECK_LIB and add the new tests
Comment 11 Carlos Eduardo Rodrigues Diógenes 2007-03-10 22:08:22 UTC
Created attachment 84360 [details] [review]
replace the obsolete macro AC_TRY_LINK with AC_CHECK_LIB
Comment 12 Carlos Eduardo Rodrigues Diógenes 2007-03-12 13:39:48 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.