[cairo] autogen.sh errors

Behdad Esfahbod behdad at behdad.org
Sun Oct 29 11:49:51 PST 2006


On Sun, 2006-10-29 at 11:22 -0800, Dave Beckett wrote:
> Behdad Esfahbod wrote:
> > On Sun, 2006-10-29 at 12:37 -0500, Ian Osgood wrote:
> >> I'm getting the following errors when running ./autogen.sh
> >>
> >> awk: calling undefined function AC_PREREQ
> >>   input record number 1, file
> >>   source line number 1
> >> awk: syntax error at source line 1
> >>   context is
> >>          NR==1 { if( $(NF) >= >>>  AM_INIT_AUTOMAKE([ <<<
> >> awk: illegal statement at source line 1
> >>
> >> I'm guessing it has to do with f85aca4c3ff02a38b83da48b618e420b79b29c37
> >>
> ...
> 
> > Sigh...  Did Mac OS X do anything other than harm to Unices?
> > See if you can play with the extract_version() function in autogen.sh to
> > make it work.  It's probably a bad sed on OS X.
> 
> That's some wacked-out grep/sed:
> 	grep "^ *$1" $CONFIGURE_IN | sed 's/.*(\[\?\([^])]\+\)]\?).*/\1/'
> 
> I wouldn't describe OSX sed as 'bad' as it's based on the BSD line which
> is POSIX sed.  From the GNU sed manual:
>   `\+'
>      As `*', but matches one or more.  It is a GNU extension.
> 
>   `\?'
>        As `*', but only matches zero or one.  It is a GNU extension.
> which obviously won't be portable as you have found.
> 
> It is probably is OK to just use * instead for both of these as
> you don't care about repeated [s, ]s or anything but greedy matches
> inside the inner clause:
>         grep "^ *$1" $CONFIGURE_IN | sed 's/.*(\[*\([^])]*\)]*).*/\1/'
> 
> Which I've tested working on Linux and OSX.

Ok, fixed.

> Although I may have just used perl at this point myself :)

I'm actually happy that I don't know perl.


> Dave


Thanks,
-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list