Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gd version checking code is wrong #4696

Closed
ryandesign opened this issue Jul 8, 2013 · 9 comments
Closed

gd version checking code is wrong #4696

ryandesign opened this issue Jul 8, 2013 · 9 comments

Comments

@ryandesign
Copy link

Configuring mapserver 6.2.1 with gd 2.1.0 leads to:

configure: error: GD version 2.1.0 too old. need at least 2.0.28
@dmorissette
Copy link
Contributor

The test is indeed wrong. Here is an untested patch to configure.in that should fix this:

diff --git a/configure.in b/configure.in
index a8ffbcf..fff6b95 100755
--- a/configure.in
+++ b/configure.in
@@ -506,8 +506,9 @@ AC_DEFUN([MS_CHECK_GD],[
       fi


-
-      if test $GDMAJOR -lt 2 -o $GDMINOR -lt 0 -o $GDREV -lt 28 ; then
+      $GDVERSION_NUM=`expr $GDMAJOR \* 1000000 \+ $GDMINOR \* 1000 \+ $GDREV`
+      $GDVERSION_REQ=`expr 2 \* 1000000 \+ 0 \* 1000 \+ 28` 
+      if test $GDVERSION_NUM -lt $GDVERSION_REQ ; then
          AC_MSG_ERROR([GD version $GDVERSION too old. need at least 2.0.28])
       fi

(Need to run autoconf after patching configure.in for the change to take effect)

@ryandesign
Copy link
Author

Almost! This works:

--- a/configure.in
+++ b/configure.in
@@ -506,8 +506,9 @@ AC_DEFUN([MS_CHECK_GD],[
       fi


-
-      if test $GDMAJOR -lt 2 -o $GDMINOR -lt 0 -o $GDREV -lt 28 ; then
+      GDVERSION_NUM=`expr $GDMAJOR \* 1000000 \+ $GDMINOR \* 1000 \+ $GDREV`
+      GDVERSION_REQ=`expr 2 \* 1000000 \+ 0 \* 1000 \+ 28` 
+      if test $GDVERSION_NUM -lt $GDVERSION_REQ ; then
          AC_MSG_ERROR([GD version $GDVERSION too old. need at least 2.0.28])
       fi

@ryandesign
Copy link
Author

mldonkey's configure script has a similar error, so I ported your solution to their code and submitted a bug report. They found that this method doesn't work when the gd version number isn't completely numeric. For example, the lastest development verison of gd2 reports its version as "2.1.1-dev", which leads expr to complain about a non-integer argument. They have a revised solution: https://savannah.nongnu.org/patch/?8123

@tbonfort
Copy link
Member

I'll apply a working patch if someone wants to come up with one. (not high priority for me, given GD will be completely dropped soon)

@ryandesign
Copy link
Author

Oh I see. Well the developers of mldonkey committed what seems to be a working version to their project; I'm sure it could be easily adapted to mapserver.

@tbonfort
Copy link
Member

@ryandesign if you're interested in having this in 6.2.x or 6.4, the safest solution is to provide a hassle-free pull request I can apply.

@tbonfort
Copy link
Member

tbonfort commented Aug 5, 2013

This does not apply to the 6.4 release, as it doesn't use autoconf anymore. Milestoning for 6.2.x for now, awaiting a working patch to move forward.

@tbonfort
Copy link
Member

Confirming that newer GD library versions are correctly detected with the cmake build

@jratike80
Copy link

Support for GD renderer removed in MS 7.0: http://mapserver.org/development/rfc/ms-rfc-99.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants