Skip to content

configure fails to find Tcl version correctly. #4

@colinhowell

Description

@colinhowell

When trying to configure cicb on a recent system (MacOS 10.12.6 Sierra) running gcc 9.2.0 and with Tcl 8.6.10 installed (both gcc and Tcl installed from Macports), and configure invoked as:

./configure --prefix=/Users/colinhowell --with-readlineinclude=/opt/local/include --with-readlinelib=/opt/local/lib --with-tclinclude=/opt/local/include --with-tcllib=/opt/local/lib

the configure fails as follows:

[preceding configure output omitted]

checking for Tcl headers... found in /opt/local/include
checking Tcl version... fatal error: could not find major or minor version number of Tcl

The problem is caused by lines 454-475 of aclocal.m4, which preprocesses the conftest.c file:

#include "tcl.h"
MaJor = TCL_MAJOR_VERSION
MiNor = TCL_MINOR_VERSION

and greps for the major and minor version numbers in the preprocessed output. This doesn't work with recent versions of gcc, because when the preprocessor is invoked with gcc -E, it includes linemarkers in its output before each expanded macro. The output looks like:

# 2 "conftest.c"
MaJor =
# 2 "conftest.c" 3
8

# 3 "conftest.c"
MiNor =
# 3 "conftest.c" 3
6

Thus the grepping only finds empty lines, without version numbers.

The problem can be worked around by invoking the preprocessor with gcc -E -P, either by setting CPP accordingly or setting CPPFLAGS to -P. This will turn off preprocessor linemarkers, resulting in preprocessor output:

MaJor = 8
MiNor = 6

as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions