You are not logged in.

#1 2013-01-20 11:12:12

taciak
Member
From: Lodz, Poland
Registered: 2012-04-25
Posts: 4
Website

[SOLVED] Fail to compile Asterisk

Hello friends,

Yesterday I tried to install asterisk from AUR (asterisk 11.0.1-1) but compilation (if I event called it compilation) failed during configure script. I tried on two diffrent machines (one of them has Arch x86_64 installed and another Arch x86) but on neither of them it works. Additionally I tried compile source code download from official site, but I got the same error.


Results of compiling from AUR:

...
hecking for /home/discovery/pwlib/include/ptlib.h... no
checking /usr/local/include/ptlib.h usability... no
checking /usr/local/include/ptlib.h presence... no
checking for /usr/local/include/ptlib.h... no
checking /usr/include/ptlib.h usability... yes
checking /usr/include/ptlib.h presence... yes
checking for /usr/include/ptlib.h... yes
checking for ptlib-config... /usr/bin/ptlib-config
./configure: line 25551: 2*10000+10*100+9 ((major<<24)|(minor<<16)|build) >=: syntax error in expression (error token is "((major<<24)|(minor<<16)|build) >=")
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build asterisk.
==> Restart building asterisk ? [y/N]
==> ---------------------------------
==>

Results of compiling the newest version from official site:

...
checking /home/discovery/pwlib/include/ptlib.h presence... no
checking for /home/discovery/pwlib/include/ptlib.h... no
checking /usr/local/include/ptlib.h usability... no
checking /usr/local/include/ptlib.h presence... no
checking for /usr/local/include/ptlib.h... no
checking /usr/include/ptlib.h usability... yes
checking /usr/include/ptlib.h presence... yes
checking for /usr/include/ptlib.h... yes
checking for ptlib-config... /usr/bin/ptlib-config
./configure: line 47559: 2*10000+10*100+9 ((major<<24)|(minor<<16)|build) >=: syntax error in expression (error token is "((major<<24)|(minor<<16)|build) >=")
[discovery@astaroth asterisk-11.2.0]$ 

Do you have any ideas what goes wrong?
I thought that there is something wrong with source code, but today I run configure on another machine where (probably) Debian is install and configure script didn't crash, run successfuly.

Last edited by taciak (2013-01-20 20:11:55)

Offline

#2 2013-01-20 12:46:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Fail to compile Asterisk

It builds fine here.  Look at that line in configure, what is there?  Mine has the first half of what is in your error message, but not the second half - it looks like something got tacked on to the end of some lines in your configure script.

Last edited by Trilby (2013-01-20 12:53:52)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2013-01-20 13:21:44

taciak
Member
From: Lodz, Poland
Registered: 2012-04-25
Posts: 4
Website

Re: [SOLVED] Fail to compile Asterisk

Thanks for reply,

The line 25551 has follow code:

PWLIB_VER=$((${PWLIB_MAJOR_VERSION}*10000+${PWLIB_MINOR_VERSION}*100+${PWLIB_BUILD_NUMBER}))

And some code around:

25532 ac_ext=c
25533 ac_cpp='$CPP $CPPFLAGS'
25534 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
25535 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
25536 ac_compiler_gnu=$ac_cv_c_compiler_gnu
25537 
25538 
25539 
25540         if test "xP[WT]LIB_VERSION" != "x"; then
25541                 VNAME="P[WT]LIB_VERSION"
25542         else
25543                 VNAME="PWLIB_VERSION"
25544         fi
25545 
25546         if test "${HAS_PWLIB:-unset}" != "unset"; then
25547                 PWLIB_VERSION=`grep "$VNAME" ${PWLIB_INCDIR}/ptbuildopts.h | sed -e 's/[[:space:]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
25548                 PWLIB_MAJOR_VERSION=`echo ${PWLIB_VERSION} | cut -f1 -d.`
25549                 PWLIB_MINOR_VERSION=`echo ${PWLIB_VERSION} | cut -f2 -d.`
25550                 PWLIB_BUILD_NUMBER=`echo ${PWLIB_VERSION} | cut -f3 -d.`
25551                 PWLIB_VER=$((${PWLIB_MAJOR_VERSION}*10000+${PWLIB_MINOR_VERSION}*100+${PWLIB_BUILD_NUMBER}))
25552                 PWLIB_REQ=$((1*10000+9*100+2))
25553                 if test "x" = "x"; then
25554                         PWLIB_MAX=9999999
25555                 else
25556                         PWLIB_MAX=$((*10000+*100+))
25557                 fi
25558 
25559                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PWLib version ${PWLIB_VERSION} is compatible with chan_h323" >&5
25560 $as_echo_n "checking if PWLib version ${PWLIB_VERSION} is compatible with chan_h323... " >&6; }
25561                 if test ${PWLIB_VER} -lt ${PWLIB_REQ}; then
25562                         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
25563 $as_echo "no" >&6; }
25564                         unset HAS_PWLIB
25565                 else
25566                         if test ${PWLIB_VER} -gt ${PWLIB_MAX}; then
25567                                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
25568 $as_echo "no" >&6; }
25569                                 unset HAS_PWLIB
25570                         else
25571                                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
25572 $as_echo "yes" >&6; }
25573                         fi
25574                 fi
25575         fi

And here is all of content of my configure script file (which is quite massive) http://www.nopaste.taciak.net/index.php/view/17489073
Unfortunately I cannot feel freely with bash and I have no idea what's wrong with line 25551.

Offline

#4 2013-01-20 18:06:15

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: [SOLVED] Fail to compile Asterisk

This only happens if you have extra/ptlib installed. The version check used by asterisk's configure script doesn't quite filter out enough.

Add this sed line to the PKGBUILD before the configure:

sed -i '/PWLIB_VERSION=/s/VNAME/& \\"/' configure

So build() will look like this:

build() {
  cd "$srcdir/$pkgname-$pkgver"
  sed -i '/PWLIB_VERSION=/s/VNAME/& \\"/' configure
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
  make
}

Last edited by tdy (2013-01-20 21:01:29)

Offline

#5 2013-01-20 20:09:56

taciak
Member
From: Lodz, Poland
Registered: 2012-04-25
Posts: 4
Website

Re: [SOLVED] Fail to compile Asterisk

@tdy your solution works! Thank you both for help!

Offline

#6 2013-01-20 22:00:50

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: [SOLVED] Fail to compile Asterisk

I'll try to report it upstream, but quite frankly I don't have time for (or maybe just don't feel like) checking the various branches and the bug tracker to see if it's already been fixed/reported. If someone else feels like checking and then reporting, this is the gist of it:

If ptlib is installed, line 47555 of the 11.2.0 configure script tries to extract the version number:

PWLIB_VERSION=`grep "$VNAME" ${PWLIB_INCDIR}/ptbuildopts.h | sed -e 's/[[:space:]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`

But it doesn't filter out enough. This is the result:

2.10.9
((major<<24)|(minor<<16)|build)
>=

So then the configure script fails a few lines later:

./configure: line 47559: 2*10000+10*100+9 ((major<<24)|(minor<<16)|build) >=: syntax error in expression (error token is "((major<<24)|(minor<<16)|build) >=")

This patch is just one way of fixing it:
   http://sprunge.us/TFKF

Last edited by tdy (2013-01-20 22:05:09)

Offline

Board footer

Powered by FluxBB