Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1233 values not loaded from pcre-config correctly

open-fixed
Vadim Zeitlin
5
2012-04-12
2012-04-08
Radim Kolar
No

On FreeBSD 8.2 compilation fails:
pcre-config is detectged correctly but values from it are not parssed to variables.

fbsd8:work/swig-2.0.4> make
make all-am
depbase=`echo Swig/misc.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse -I../Source/Include -I../Source/DOH -I../Source/CParse -I../Source/Preprocessor -I../Source/Swig -I../Source/Modules -g -O2 -Wall -W -ansi -pedantic -MT Swig/misc.o -MD -MP -MF $depbase.Tpo -c -o Swig/misc.o Swig/misc.c && mv -f $depbase.Tpo $depbase.Po
Swig/misc.c:1119:18: error: pcre.h: No such file or directory
Swig/misc.c: In function 'Swig_string_regex':
Swig/misc.c:1191: error: 'pcre' undeclared (first use in this function)
Swig/misc.c:1191: error: (Each undeclared identifier is reported only once
Swig/misc.c:1191: error: for each function it appears in.)
Swig/misc.c:1191: error: 'compiled_pat' undeclared (first use in this function)
Swig/misc.c:1192: warning: ISO C90 forbids mixed declarations and code
Swig/misc.c:1200: warning: implicit declaration of function 'pcre_compile'
Swig/misc.c:1207: warning: implicit declaration of function 'pcre_exec'
Swig/misc.c:1211: error: 'PCRE_ERROR_NOMATCH' undeclared (first use in this function)
Swig/misc.c:1220: warning: implicit declaration of function 'pcre_free'
Swig/misc.c: In function 'Swig_pcre_version':
Swig/misc.c:1225: warning: implicit declaration of function 'pcre_version'
*** Error code 1

config.log

configure:5305: checking for pcre-config
configure:5323: found /usr/local/bin/pcre-config
configure:5335: result: /usr/local/bin/pcre-config
PCRE_CFLAGS=''
PCRE_CONFIG='/usr/local/bin/pcre-config'
PCRE_LIBS=''

Discussion

  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-08

    What does "/usr/local/bin/pcre-config --cflags" actually return? It would very surprising if configure really didn't pick up its output, my hypothesis is rather that the script doesn't return anything in the first place.

     
  • Radim Kolar
    Radim Kolar
    2012-04-09

    fbsd8:~/ports> /usr/local/bin/pcre-config --cflags
    -I/usr/local/include

     
  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-09

    Really mysterious, I don't see at all what's going on here and I don't have a FreeBSD 8.2 system to test this on. Perhaps you could try sticking "set -x"/"set +x" lines around the parts of configure where PCRE_CFLAGS is set and check if you see something wrong?

     
  • Radim Kolar
    Radim Kolar
    2012-04-09

    boost lib detection works fine, pcre is using different code?

    configure:5844: checking for boostlib >= 1.20.0
    configure:5913: c++ -c -O2 -pipe -march=prescott -fPIC -DPIC -fno-strict-aliasing -Wall -W -ansi -pedantic -I/usr/local/include -I/usr/local/include conftest.cpp >&5
    configure:5913: $? = 0
    configure:5915: result: yes

    BOOST_CPPFLAGS='-I/usr/local/include'
    BOOST_LDFLAGS='-L/usr/local/lib'

     
  • Radim Kolar
    Radim Kolar
    2012-04-09

    + printf '%s\n' 'configure:5324: found /usr/local/bin/pcre-config'
    + break 2
    + IFS='
    '
    + PCRE_CONFIG=/usr/local/bin/pcre-config
    + test -n /usr/local/bin/pcre-config
    + printf '%s\n' 'configure:5336: result: /usr/local/bin/pcre-config'
    + printf '%s\n' /usr/local/bin/pcre-config
    /usr/local/bin/pcre-config
    + test -n /usr/local/bin/pcre-config
    + break
    + test -n /usr/local/bin/pcre-config
    + test /usr/local/bin/pcre-config == no
    test: /usr/local/bin/pcre-config: unexpected operator
    + test x == x
    test: x: unexpected operator
    + /usr/local/bin/pcre-config
    Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--libs16] [--libs-cpp] [--cflags] [--cflags-posix]
    + PCRE_CFLAGS=''
    + test x == x
    test: x: unexpected operator
    + /usr/local/bin/pcre-config
    Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--libs16] [--libs-cpp] [--cflags] [--cflags-posix]
    + PCRE_LIBS=''
    + test x != x
    + :
    + printf '%s\n' '#define HAVE_PCRE 1'
    + LIBS=' '
    + CPPFLAGS=' '
    + test '' = set
    + enable_ccache=yes
    + printf '%s\n' 'configure:5506: checking whether to enable ccache-swig'
    + printf %s 'checking whether to enable ccache-swig... '
    checking whether to enable ccache-swig... + printf '%s\n' 'configure:5508: result: yes'
    + printf '%s\n' yes

     
  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-09

    OK, it looks like FreeBSD shell doesn't support "==" in test. It's true that it's non-POSIX, even though it's a common extension. I'll fix this, thanks for testing.

     
  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-09

    • assigned_to: nobody --> vadz
    • status: open --> closed-fixed
     
  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-09

    Should be fixed in svn r12971, please reopen if it still fails.

     
  • William Fulton
    William Fulton
    2012-04-12

    The fix modifies files in Tools/config. The files under Tools/config are meant to be taken from the official Autoconf Archive - http://www.gnu.org/software/autoconf-archive/. Any changes should be either pushed upstream or grabbed from upstream. I've re-opened until the possibility of this has been investigated.

     
  • William Fulton
    William Fulton
    2012-04-12

    • status: closed-fixed --> open-fixed
     
  • Vadim Zeitlin
    Vadim Zeitlin
    2012-04-12

    I actually did think about this and will get the fixes to ax_path_generic.m4 into the official version (no reply so far from the maintainer...). But ac_compare_version.m4 is not from there, it is, quoting from a comment in this file, "implemented from scratch just for SWIG by arty.". I'm not sure if it's a good idea to use this "just for SWIG" version when the archive does have ax_compare_version.m4 but maybe there was some reason for this... In any case, this probably merits a separate bug.

     
  • William Fulton
    William Fulton
    2012-04-13

    svn log -v Tools/config/ac_compare_version.m4

    has from the initial commit
    ...
    - ac_compare_version.m4: arty's own more liberally licensed version compare
    autoconf macro.

    I suspect that we could be using the autoconf ax_compare_version.m4