Opened 8 years ago
Closed 5 years ago
#786 closed defect (fixed)
configure is incorrectly test C compiler flags and not C++ flags (configure.in needs fixing)
Reported by: | awatkins1966 | Owned by: | strk |
---|---|---|---|
Priority: | major | Milestone: | 3.5.3 |
Component: | Build/Install | Version: | 3.5.0 |
Severity: | Unassigned | Keywords: | configure |
Cc: |
Description
While testing geos 3.5.0 with Oracle Developer Studio 12.5 (formally Sun Studio12) I got an error with -ansi flag (-ansi is not supported with CC). Further testing showed that configure was not testing the CC compiler but cc.
# ./configure CC='cc' CXX='CC' configure:17560: checking if CC supports -ansi configure:17578: cc -c -g -ansi conftest.c >&5 configure:17582: $? = 0 configure:17594: result: yes
doubling check with g++
# ./configure configure:17575: checking if g++ supports -ansi configure:17593: gcc -c -g -O2 -ansi conftest.c >&5 configure:17597: $? = 0 configure:17610: result: yes
As you can see it is not testing the C++ compiler.
Need a way to tell AC_LIBTOOL_COMPILER_OPTION to use CXX in configure.in
# Set default AM_CXXFLAGS and AM_CFLAGS # -pedantic: ISO does not support long long # we add -Wno-long-long to avoid those messages WARNFLAGS="" AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy_cv_pedantic], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], []) AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy_cv_wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], []) AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dummy_cv_ansi], [-ansi], [], [WARNFLAGS="$WARNFLAGS -ansi"], []) AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy_cv_no_long_long], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
Change History (6)
comment:1 by , 8 years ago
comment:3 by , 6 years ago
Milestone: | 3.5.2 → 3.5.3 |
---|
comment:4 by , 5 years ago
I see that in 3.8 we've simply removed the test for -ansi and don't use it.
For 3.5 it looks like strk's guess about wrapping the test in a push/pop seems to work? (at least on my platform) (the first test isn't in the push/pop, the second is)
configure:17575: checking if g++ supports -Wno-long-long configure:17593: gcc -c -g -O2 -Wno-long-long conftest.c >&5 configure:17597: $? = 0 configure:17610: result: yes configure:17626: checking if g++ supports -ansi configure:17644: g++ -c -g -O2 -ansi conftest.cpp >&5 configure:17648: $? = 0 configure:17661: result: yes
comment:6 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Something like: