Bug 921817 - autogen should warn if pkg-config missing
Summary: autogen should warn if pkg-config missing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: pre-release
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Amar Tumballi
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-15 02:12 UTC by Justin Clift
Modified: 2015-07-13 04:35 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 17:54:25 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Justin Clift 2013-03-15 02:12:57 UTC
Description of problem:

  If pkg-config isn't available when gluster autogen.sh is
  run, the autoconf step displays an error message that's
  misleading and doesn't really address the problem:

    configure.ac:242: error: possibly undefined macro: AC_DEFINE
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.

  autogen.sh should probably detect when pkg-config is
  missing, and direct the user to install it.


Version-Release number of selected component (if applicable):

  upstream git repo, master branch, as of Fri 15th March 2013


How reproducible:

  Every time.


Steps to Reproduce:
1. Ensure pkg-config isn't installed. (ie sudo yum remove pkgconfig)
2. git clone upstream gluster repo
3. ./autogen.sh
  
Actual results:

  $ ./autogen.sh 

  ... GlusterFS autogen ...

  Running aclocal...
  Running autoheader...
  Running glibtoolize...
  Running autoconf...
  configure.ac:242: error: possibly undefined macro: AC_DEFINE
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.
  Running automake...
  configure.ac:151: installing `./config.sub'
  configure.ac:11: installing `./missing'
  configure.ac:11: installing `./install-sh'
  configure.ac:151: installing `./config.guess'
  api/src/Makefile.am: installing `./depcomp'
  xlators/features/marker/utils/syncdaemon/Makefile.am:3: installing `./py-compile'
  configure.ac:10: installing `./missing'
  configure.ac:10: installing `./install-sh'
  Makefile.am: installing `./depcomp'

  Please proceed with configuring, compiling, and installing.
  $


Expected results:

  Completely successful autogen, with no configure.ac error.


Additional info:

  This error occurs on both RHEL 6.4 x64 and OSX 10.7. (tested on both)

Comment 1 Justin Clift 2013-03-15 02:27:18 UTC
Potential fix for review:

  http://review.gluster.org/4672

Comment 2 Vijay Bellur 2013-03-15 22:20:38 UTC
CHANGE: http://review.gluster.org/4672 (Warn on missing pkg-config, plus trivial comparator typo fix.) merged in master by Anand Avati (avati)

Comment 3 Vijay Bellur 2013-03-25 19:49:45 UTC
REVIEW: http://review.gluster.org/4720 (config: better (i.e. more portable) test for libxml2) posted (#6) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 4 Vijay Bellur 2013-03-25 21:50:48 UTC
COMMIT: http://review.gluster.org/4720 committed in master by Anand Avati (avati) 
------
commit 544945a128b4de9c6b767939fb4c4c216b095d23
Author: Kaleb S. KEITHLEY <kkeithle>
Date:   Mon Mar 25 08:22:16 2013 -0400

    config: better (i.e. more portable) test for libxml2
    
    Over the weekend I tried to build on MacOS X¹ and ran into the following
    issues:
    1) The recent change to autogen.sh to test for pkg-config falls down.
    2) After removing the pkg-config test in autogen.sh, w/o pkg-config the
       PKG_CHECK_MODULES macro invocation in configure[.ac] falls down. N.B.
       Solaris users run into this too, even through there's a (broken)
       pkg-config package that can be installed.
    3) There are other problems in the code related to fuse that are beyond the
       scope of this.
    
    It seems that pkg-config is only a requirement for the definition of the
    PKG_CHECK_MODULES macro used to detect libxml2. Since this seems to be
    inherently unportable — at least to MacOS X and Solaris — I'd like to:
    A) Change the use of the PKG_CHECK_MODULES macro to the more portable
       AM_PATH_XML2 macro provided by the libxml2 package in
       /usr/.../share/aclocal/libxml.m4
    2) Revisit the decision to add the check for pkg-config in autogen.sh in
       BZ 921817.
    
    For now this is just an rfc. If people are agreeable I'll reenter this
    change against BZ 921817.
    
    ¹Mountain Lion 10.8.3, XCode 4.6.1
    
    Change-Id: I237b1ed8919088345b8fd943423b2a6ad289981b
    BUG: 921817
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle>
    Reviewed-on: http://review.gluster.org/4720
    Reviewed-by: Justin Clift <jclift>
    Tested-by: Justin Clift <jclift>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Anand Avati <avati>

Comment 5 Justin Clift 2014-05-04 17:16:27 UTC
Interestingly, this now happens again when pkg-config isn't present:

  $ ./autogen.sh 

  ... GlusterFS autogen ...

  Generate gf-error-codes.h ...
  gf-error-codes.h -> libglusterfs/src/gf-error-codes.h
  Running aclocal...
  Running autoheader...
  Running glibtoolize...
  Running autoconf...
  configure.ac:316: error: possibly undefined macro: AC_DEFINE
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.
  Running automake...
  configure.ac:203: installing `./config.sub'
  configure.ac:16: installing `./missing'
  configure.ac:16: installing `./install-sh'
  configure.ac:203: installing `./config.guess'
  api/examples/Makefile.am: installing `./depcomp'
  api/examples/Makefile.am:10: installing `./py-compile'
  Running autogen.sh in argp-standalone ...
  configure.ac:10: installing `./missing'
  configure.ac:10: installing `./install-sh'
  Makefile.am: installing `./depcomp'

  Please proceed with configuring, compiling, and installing.
  $

Looks like we've started using PKG_CHECK_MODULES again:

  $ grep -ri "PKG_CHECK_MODULES" *
  api/examples/configure.ac:PKG_CHECK_MODULES([GLFS], [glusterfs-api >= 3])
  configure.ac:  PKG_CHECK_MODULES([GLIB], [glib-2.0],
  configure.ac:PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0],

Any thoughts on the right way to proceed?

Comment 6 Anand Avati 2014-05-05 13:18:03 UTC
REVIEW: http://review.gluster.org/7674 (configure.ac: prefer autoconf over pkg-config) posted (#1) for review on master by Kaleb KEITHLEY (kkeithle)


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