Bug 8686

Summary: possible configure/autoconf/pkg-config problem on mainline
Product: cairo Reporter: nickg <bulk>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 1.2.5   
Hardware: PowerPC   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:

Description nickg 2006-10-17 07:45:32 UTC
Hi there,

In the process of testing 8550 I had to pull down a fresh copy of mainline.

I installed latest versions of autoconf/automake/libtool/pkg-config

libpng, freetype and font-config are installed, and I can build  the released version of cario without a 
problem.  "*.pc" files exist for everything.


I think I did automake -f -c ??, then libtoolize --force to get the boiler plate. (note: I'm NOT an autotool 
expert)

Then I did ./configure and it failed on libpng and fontconfig saying pkg-config didn't work.  But it does.  
I had to hack the raw configure to get it to work:

Here's why using FONTCONFIG as an example

echo "$as_me:$LINENO: checking for FONTCONFIG" >&5
echo $ECHO_N "checking for FONTCONFIG... $ECHO_C" >&6

if test -n "$PKG_CONFIG"; then
        if test -n "$PKG_CONFIG" && \
    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$ft_REQUIRES\"") >&5
  ($PKG_CONFIG --exists --print-errors "$ft_REQUIRES") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then

  # this next line DOES get executed
  pkg_cv_FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "$ft_REQUIRES" 2>/dev/null`

else
  pkg_failed=yes
fi
        #pkg_failed=untried
fi
if test -n "$PKG_CONFIG"; then
        if test -n "$PKG_CONFIG" && \
    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$ft_REQUIRES\"") >&5
  ($PKG_CONFIG --exists --print-errors "$ft_REQUIRES") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then

  # This next line DOES execute
  pkg_cv_FONTCONFIG_LIBS=`$PKG_CONFIG --libs "$ft_REQUIRES" 2>/dev/null`

else
  pkg_failed=yes
fi
        #pkg_failed=untried  <----- I had to hack this
fi


So, pkg-config is working just fine, but at the end, the check fails saying pkg-config is old or doesn't 
work.  I commed out the 'pkg_failed=untried" and everything worked just fine.  The same problem 
exists for checking libpng12

It appears that pkg_failed either isn't initialized to something other than "yes", "no", "untried"  OR 
somehow the if/if/then/else/else/fi is wrong and pkg_config is set to untried.

So it appears the macro for pkg-config is wrong ????  I'm not an autotool expert so it could be I did 
something odd.

please advise.

thanks,

--nickg
Comment 1 Behdad Esfahbod 2006-10-17 11:30:21 UTC
Did you also update to latest pkg-config?  If not please do.
And then, do not run autotools manually; run ./autogen.sh.
Comment 2 nickg 2006-10-17 21:49:55 UTC
Aha.. autogen.sh .. knowing if that existed would have saved me serious time. Is this a standard thing?

I turns out I was using pkg-config 0.18 and the latest is 21.  I downloading/compied/installed 21 and it 
worked.  So this can be resolved, but, do you want to file bugs on:

doco bug:  autogen needs to be in the INSTALL document
doco bug: pkg-config not listed in README
config bug:  configure checks for pkg-config 0.9, not .21

thanks!

-nickg
Comment 3 Behdad Esfahbod 2006-10-17 22:41:45 UTC
(In reply to comment #2)
> Aha.. autogen.sh .. knowing if that existed would have saved me serious time.
Is this a standard thing?

Yes.  All GNOME software uses that.  KDE used ot use something like
Makefile.cvs.  Some use "bootstrap".  I guess autogen.sh is the most widespread.
Even without knowing that, in a clean checkout of cairo there are not many
executable scripts.

> I turns out I was using pkg-config 0.18 and the latest is 21.  I
downloading/compied/installed 21 and it 
> worked.  So this can be resolved, but, do you want to file bugs on:
> 
> doco bug:  autogen needs to be in the INSTALL document

Not really. INSTALL is targeted for tarball installations, not git checkout.
We can add a note to the wiki describing how to checkout though.  (I don't like
cluttering the codebase with another file like README.GIT or something.

> doco bug: pkg-config not listed in README

It shouldn't.  On all modern systems pkg-config is being used and assumed just
like other base things are.  Think sh, sed, and ls...  Although I agree that
it's one piece of the build system that is required at configure time.  The rest
(libtool, automake, autoconf, ... all copy all necessary files in-tree.)

> config bug:  configure checks for pkg-config 0.9, not .21

I like to.  But I don't know which version to require.  0.21 is from Aug 2006. 
Not that old.  We definitely don't want to require it.  Can you see which of
0.18.1, 0.19, 0.20 work?  The earliest I mean.

> thanks!
> 
> -nickg

Thanks,
behdad
Comment 4 nickg 2006-10-18 06:33:05 UTC
aha... I only use linux as a server so I don't see much for GNOME, et al. 

I suggest http://www.cairographics.org/download be modified to tell you to use autogen.sh (yes I know 
it was the only exe script in the dir :-)  Maybe I'll sign up for the wiki account and add that. 

ANYWAYS...

pkg-config 0.18 is busted
pkg-config 0.19 works
and pkg-config 0.21 works

Didn't test 0.20.

seems like it's safe require 0.19 and up.

thanks all!

--nickg

Comment 5 Behdad Esfahbod 2006-10-18 08:01:43 UTC
Ok, fixed both the wiki and configure.in now.

refs/heads/master: e2a0c57c1fc20f3e2ee641273b5f059ca221d265 ->
157663e1fdf120a71c6cc8222b88d2915a5a73eb
Comment 6 Behdad Esfahbod 2006-11-28 16:43:43 UTC
I reverted the pkg-config >= 0.19 requirement btw, for good reasons:

  https://bugs.freedesktop.org/show_bug.cgi?id=9118

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.