I'd like to use -Wall
and -Werror
as flags for gcc in an autotools project, but I don't want to put them in my configure.ac.
As such, I tried using ./configure CFLAGS='-Wall -Werror'
, only to get an error from one of my AC_SEARCH_LIBS
macro calls:
AC_SEARCH_LIBS([pow], [m], , AC_MSG_ERROR([Could not find standard math library.]))
Resulting error when running configure with the CFLAGS
added:
configure: error: Could not find standard math library.
What am I doing wrong here? Configuration works fine without the CFLAGS variable set.
error: conflicting types for built-in function 'pow' [-Werror]
, after trying to compile conftest.c. Removing -Werror from the CFLAGS gets rid of the issue, but that's not really any use to me. - heuristicusAM_CFLAGS
(the condition being a configure time check thatCC
accepts the flags). - William Pursell