Menu

#375 Use pkg-config to detect libpng and libxml2

v1.2.2
closed-accepted
nobody
None
5
2016-08-21
2016-07-31
No

pkg-config is the preferred way to detect these libraries for several years now. The old libpng-config and libxml2-config scripts are deprecated and don't work in some environments.

We could keep them as a fallback in case pkg-config fails, but I don't think this is really necessary at this point.

1 Attachments

Related

Wiki: Fuse 1.2.2 Release Plan

Discussion

  • Alberto Garcia

    Alberto Garcia - 2016-07-31

    Here's a related patch to remove the unused (since r5349) glib-2.0.m4 file.

     
    • Fredrick Meunier

      Thanks, committed in [r5706].

       

      Related

      Commit: [r5706]

  • Fredrick Meunier

    Hmm, looks like I'm going to need to start putting in detailed build instructions like the Windows one for the Mac in the INSTALL file as it is getting to be a beast, I can't say pkg-config has made my life any easier!

    libxml2-config works on the Mac while pkg-config doesn't for libxml2 (pkg-config points to a non-existent includes directory but needs an OS fix to sort out - maybe in the next revision in September).

    I can use your patch if I do:

    CFLAGS=`xml2-config --cflags` ./configure PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig
    

    Any better ideas for specifying the xml2 cflags when using a broken pkg-config install or am I stuck updating INSTALL? I don't want to have Fuse stuck in the past for this build infrastructure despite my struggles (on the bright side, using your patch makes Fuse find and use libpng from the X install which didn't work before and made me have to explicitly use the --without-png flag to get a functioning build).

     

    Last edit: Fredrick Meunier 2016-07-31
    • Alberto Garcia

      Alberto Garcia - 2016-07-31

      Well, if there are systems where pkg-config does not work we can still keep the old system. Here's a simple patch to do that.

       
    • Alberto Garcia

      Alberto Garcia - 2016-07-31

      Ah, wait, you mean that in OSX pkg-config exists but returns incorrect values??

       
      • Fredrick Meunier

        Exactly - its Apple's fault but I still need to use it. Just looking for any obvious option I've missed through only being in passing familiarity with pkg-config.

         
    • Sergio Baldoví

      Sergio Baldoví - 2016-07-31

      Any better ideas for specifying the xml2 cflags when using a broken pkg-config install or am I stuck updating INSTALL?

      You could use XML_CFLAGS, but that is not likely to fix the problem.

       
  • Fredrick Meunier

    To be clear - I am planning on committing this patch by next weekend barring feedback to the contrary as it seems to be the right way to go.

     
  • Fredrick Meunier

    • Group: future --> NextRelease
     
  • Sergio Baldoví

    Sergio Baldoví - 2016-07-31

    Looks good to me. Just a suggestion: use AC_SUBST outside a conditional or use AS_IF instead of 'if' [1]. But I think we are not using AC_SUBST in other places because the macro distributed in pkg.m4 is already calling AC_SUBST [2].

    [1] http://lists.gnu.org/archive/html/autoconf/2010-01/msg00091.html
    [2] https://autotools.io/pkgconfig/pkg_check_modules.html

     
    • Alberto Garcia

      Alberto Garcia - 2016-08-01

      Here's AC_SUBST outside the conditional. AC_SUBST is not necessary in recent versions of pkg-config, but it doesn't hurt and it keeps compatibility with older versions.

       
  • Fredrick Meunier

    • status: open --> pending-accepted
     
  • Fredrick Meunier

    Thanks Alberto, I've tried to combine the patches and I've committed in [r5731]. Please have a look and let me know if I've made any errors.

     

    Related

    Commit: [r5731]

    • Alberto Garcia

      Alberto Garcia - 2016-08-12

      It looks good, thanks!

       
  • Sergio Baldoví

    Sergio Baldoví - 2016-08-21
    • status: pending-accepted --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.