Bug 3835 - autogen.sh fails with invalid test on line 33
Summary: autogen.sh fails with invalid test on line 33
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.15.1
Hardware: Macintosh Mac OS X 10.2
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2017-06-15 21:40 UTC by Michael Vilain
Modified: 2017-06-16 11:07 UTC (History)
0 users

See Also:


Attachments

Description Michael Vilain 2017-06-15 21:40:11 UTC
[12:33:29][7 ~/Downloads/claws]$ ./autogen.sh 
expr: not a decimal number: 'Apple(flex-31)'
./autogen.sh: line 33: [: -lt: unary operator expected
./autogen.sh: line 40: libtoolize: command not found
./autogen.sh: line 45: /Users/vilain/Downloads/claws/configure: No such file or directory
./autogen.sh: line 45: exec: /Users/vilain/Downloads/claws/configure: cannot execute: No such file or directory


This is running on MacOS 10.10.5 using Xcode 7.2.1.
Comment 1 Ricardo Mones 2017-06-16 08:30:52 UTC
What's the output of 'flex --version' on your system?

Anyway you have worse problems than this:
./autogen.sh: line 40: libtoolize: command not found

(no idea how to install libtoolize on your OS, sorry).
Comment 2 Michael Vilain 2017-06-16 09:18:51 UTC
[00:13:52][2 ~]$ flex --version
flex 2.5.35 Apple(flex-31)
Comment 3 Michael Vilain 2017-06-16 09:21:17 UTC
As to the libtoolize issue, there needs to be a patch for MacOS:

https://stackoverflow.com/questions/15448582/installed-libtool-but-libtoolize-not-found

says to add the following to the autogen.sh:

case `uname` in Darwin*) glibtoolize --copy ;;
  *) libtoolize --copy ;; esac
Comment 4 Michael Vilain 2017-06-16 10:37:48 UTC
I figured I'd have to fix the autogen.sh script myself, so I did, but I can't push my change.  So here it is:

------ begin autogen.sh --------
#!/bin/sh
# Copyright 1999-2014 the Claws Mail team.
# This file is part of Claws Mail package, and distributed under the
# terms of the General Public License version 3 (or later).
# See COPYING file for license details.

bisonver=`bison --version`

if [ "$bisonver" = "" ]; then
	echo Bison is needed to compile Claws Mail git
	exit 1
fi

if [ "$LEX" != "" ]; then
	flexver=`$LEX --version|awk '{print $2}'`
else
	flexver=`flex --version|awk '{print $2}'`
fi

if [ "$flexver" = "" ]; then
	echo Flex 2.5.31 or greater is needed to compile Claws Mail git
	exit 1
else
	flex_major=`echo $flexver|sed "s/\..*//"`
	flex_minor=`echo $flexver|sed "s/$flex_major\.\(.*\)\..*/\1/"`
	flex_micro=`echo $flexver|sed "s/$flex_major\.$flex_minor\.\(.*\)/\1/"`

	flex_numversion=$(expr \
		$flex_major \* 10000 + \
		$flex_minor \* 100 + \
		$flex_micro)

	if [ $flex_numversion -lt 20531 ]; then
		echo Flex 2.5.31 or greater is needed to compile Claws Mail git
		exit 1
	fi
fi

case `uname` in 
	Darwin*) 
		if [ "`glibtoolize --version`" = "" ]; then
			echo MacOS requires glibtool from either Macport or brew
			exit 1
		fi
		LIBTOOL="glibtoolize --force --copy" 
		;;
	*) 
		LIBTOOL="libtoolize --force --copy" 
		;; 
esac

aclocal -I m4 \
  && ${LIBTOOL} \
  && autoheader \
  && automake --add-missing --foreign --copy \
  && autoconf 
if test -z "$NOCONFIGURE"; then
exec ./configure --enable-maintainer-mode $@
fi   
------ end autogen.sh   --------
Comment 5 users 2017-06-16 11:06:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2017-06-16 11:06:02.734855140 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=384a0e78af62ff953e8c9d3267a5482703457bf2
Merge: e8d5bc4 c8e4c10
Author: Colin Leroy <colin@colino.net>
Date:   Fri Jun 16 11:06:02 2017 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=c8e4c10674d1abee12764bf67fc0bda2e4a4fea9
Author: Paul <paul@claws-mail.org>
Date:   Fri Jun 16 10:05:15 2017 +0100

    fix building on MAC. fixes bug 3835, 'autogen.sh fails with invalid test on line 33'
    
    fix by Michael Vilain <michael@vilain.com>

Note You need to log in before you can comment on or make changes to this bug.