Patch for bootstrap-sh (automake 1.10)

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
mduf
Trader
Trader
Posts: 21
Joined: Tue May 29, 2007 6:51 pm
Location: Quebec, Canada

Patch for bootstrap-sh (automake 1.10)

Post by mduf »

In the svn version (11014 at the time off this post), bootsrap-sh tells that automake version 1.10 is older than 1.5. With this patch the version number will be compare like version number not like string.

The changes are in checkversion()

Code: Select all

--- bootstrap-sh	2007-05-28 11:59:21.000000000 -0400
+++ bootstrap2-sh	2007-06-28 09:41:41.000000000 -0400
@@ -29,7 +29,12 @@
 {
   ver_ok=NO
   read t1 t2 t3 t4 t5;
-  if (test x$t4 "<" x$ver_needed) then
+  if (echo $t4 $ver_needed |
+     awk 'BEGIN { FS = "."; RS = "[[:space:]]"; prevnf = 0}
+          {
+          if (prevnf == 0){for ( i = 1; i <= NF; i++) { arr[i] = $i}; prevnf = NF}
+          else {for ( i in arr){if (arr[i] < $i){exit 0};if (arr[i] > $i){exit 1} }; if (prevnf < NF){exit 0}; exit 1}
+          }' ) then
     ver_ok=NO
   else
     ver_ok=OK

By the way automake 1.10 works well.
You do not have the required permissions to view the files attached to this post.
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

Awesome! I had to install automake 1.9 because of this bug... I'll see about getting the patch into trunk.

Any chance of patching that misleading glut error as well?
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

Actually, the patch doesn't work for me. I uninstalled automake1.9 to test and I got the same error as I do in the unpatched file. I don't think it's an svn issue since the file has been unchanged for 16 months.

EDIT: Apparently this is due to an issue with the debian package for automake1.10. When I have automake1.9 installed and run the current bootstrap-sh in SVN, it runs fine. With the patch it gives me the version error instead.

I don't think I can commit this patch to the trunk since it appears to break the bootstrap script for users of debian [me] and debian-based distributions such as ubuntu. This was a good effort though- please let me know if you find a way to fix this issue for most people without breaking compatibility with debian.

Thanks for your time!
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

It could be a Debian issue... I'm also using debian... but I'm pretty sure when I looked, it had the proper version of 1.10.

I know that the existing problem is due to a lexographic compare rather than a numerical compare ( "<" vs. -lt ) (1 < 10 < 2 < 9 while 1 -lt 2 -lt 9 -lt 10 )

This should cause problems on any version of Linux, but it depends on the quantity of autoconf's installed (or their version numbers), which is where distributions like Debian work differently.

This can be fixed by splitting up the strings using cut or something else, so that the "1.nn" gets stipped down to the minor number "nn"... Then, I can use the "-lt" option of test for numerical compare.

The AWK script looks like a more complicated way of doing it... I'll try to commit a fix to this using shell commands tonight....
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

Great!

I also prefer the use of basic unix tools (cut, paste, shell logic) in place of languages like AWK when possible.
While you're patching it, do you think you can fix the missing GLUT bug as well?
mduf
Trader
Trader
Posts: 21
Joined: Tue May 29, 2007 6:51 pm
Location: Quebec, Canada

Post by mduf »

The patch work on my ubuntu. Strange it did not work on debian, maybe awk compatibility thing.

I know there a lot of of awk variant (classic unix, posix, gawk addition) and it can cause a lot of problem.

I thought it was not big deal because awk was already used in the bootstrap-sh script and I was lazy. I'm not an experience shell script programmer, I didn't know how to manipulate string in shell script and isolate the 10 in 1.10.

At least it was useful for me, sorry it wasn't for you halleck.

I will look at ace123 fix, I'll probably learn something.
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

No worries, thanks again for taking the time to at least try to fix that gargantuan and scary script. ;)
Hopefully ace will have better (more portable) luck.
mduf
Trader
Trader
Posts: 21
Joined: Tue May 29, 2007 6:51 pm
Location: Quebec, Canada

Post by mduf »

this one should be better

Code: Select all

--- bootstrap-sh	2007-07-06 16:31:21.000000000 -0400
+++ bootstrap2-sh	2007-07-06 17:39:03.000000000 -0400
@@ -29,10 +29,14 @@
 {
   ver_ok=NO
   read t1 t2 t3 t4 t5;
-  if (test x$t4 "<" x$ver_needed) then
+  if ( test `echo $t4 | cut -d. -f1` -lt `echo $ver_needed | cut -d. -f1`) then
     ver_ok=NO
   else
-    ver_ok=OK
+    if ( test `echo $t4 | cut -d. -f2` -lt `echo $ver_needed | cut -d. -f2`) then
+      ver_ok=NO    
+    else    
+      ver_ok=OK
+    fi
   fi
   while read; do
     true;
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

I'm trying to test this but I think there are whitespace problems in the diff due to copy-and-paste across browsers... I can try testing it again if you upload a patch file.

Code: Select all

patching file bootstrap-sh
patch: **** malformed patch at line 14:                +    else
mduf
Trader
Trader
Posts: 21
Joined: Tue May 29, 2007 6:51 pm
Location: Quebec, Canada

Post by mduf »

There it is
mduf
Trader
Trader
Posts: 21
Joined: Tue May 29, 2007 6:51 pm
Location: Quebec, Canada

Post by mduf »

Sorry i had a problem when i tried to post the file
You do not have the required permissions to view the files attached to this post.
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

Well I think that works and it doesn't appear to break compatibility with automake1.9.

Here's my output when running automake1.10:

Code: Select all

Running aclocal
/usr/share/aclocal/smpeg.m4:13: warning: underquoted definition of AM_PATH_SMPEG/usr/share/aclocal/smpeg.m4:13:   run info '(automake)Extending aclocal'
/usr/share/aclocal/smpeg.m4:13:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
Running autoheader
Running autoconf
Running automake
Makefile.am:1099: `%'-style pattern rules are a GNU make extension
Bootstrap is complete. Run ./configure to configure the build system.
Compared to the automake1.9 output:

Code: Select all

Running aclocal
/usr/share/aclocal/smpeg.m4:13: warning: underquoted definition of AM_PATH_SMPEG  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
Running autoheader
Running autoconf
Running automake
Bootstrap is complete. Run ./configure to configure the build system.
Which appears identical to the unpatched output.

This is certainly a step in the right direction... although I think I should try a complete build too. Let's see what ace wants to do to the script as well.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

I just committed your fix. Sorry for taking so long.

I don't see any reason that it would not work... it now treats them like numbers. I tested it with versions below the ver_needed, and it failed in the appropriate places.
Post Reply