diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-27 21:19:26 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-27 21:19:26 +0200 |
commit | d306e3eeace6bf3c8eee0f707a81675e20e607ba (patch) | |
tree | 56652b14aa7eeb78bcb2ae95adbfb403648988f7 /cmake/configure.cmake | |
parent | 1cbb3be18d3fe7d21e6f701d1bfbdfef55ff8e15 (diff) | |
parent | b98e22acc203ec6a96777897adf434e7e278ab6d (diff) | |
download | egawk-d306e3eeace6bf3c8eee0f707a81675e20e607ba.tar.gz egawk-d306e3eeace6bf3c8eee0f707a81675e20e607ba.tar.bz2 egawk-d306e3eeace6bf3c8eee0f707a81675e20e607ba.zip |
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'cmake/configure.cmake')
-rw-r--r-- | cmake/configure.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 7dbe841c..9a9e1280 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -98,7 +98,7 @@ MACRO(DefineIfSourceCompiles source feature) DefineConfigH(${feature}) ENDMACRO(DefineIfSourceCompiles) -FILE( READ configure.ac CONFIG_AUTOMAKE ) +FILE( READ ${CMAKE_SOURCE_DIR}/configure.ac CONFIG_AUTOMAKE ) STRING( REGEX MATCH "AC_INIT\\(\\[GNU Awk\\], ([0-9]+\\.[0-9]+\\.[0-9]+)" GAWK_AUTOMAKE_LINE_VERSION "${CONFIG_AUTOMAKE}") STRING( REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" GAWK_MAJOR_VERSION "${GAWK_AUTOMAKE_LINE_VERSION}") STRING( REGEX REPLACE ".*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" GAWK_MINOR_VERSION "${GAWK_AUTOMAKE_LINE_VERSION}") @@ -107,6 +107,15 @@ STRING( REGEX REPLACE ".*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" GAWK_BUGFIX_VERSION # The definition of the symbol GAWK cannot be passed in config.h # because the extensions will fail to build. add_definitions(-DGAWK) +add_definitions(-DSTDC_HEADERS) +# Tell the C compiler to accept C99. +if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}") + endif () +else () + set (CMAKE_C_STANDARD 99) +endif () DefineConfigHValue(_GL_ATTRIBUTE_PURE "__attribute__ ((__pure__))") DefineConfigHValue(GAWK_VERSION "${GAWK_MAJOR_VERSION}.${GAWK_MINOR_VERSION}.${GAWK_BUGFIX_VERSION}") DefineConfigHValue(VERSION \\"${GAWK_VERSION}\\") @@ -160,7 +169,7 @@ DefineTypeIfAvailable("_Bool" HAVE__BOOL) if (${HAVE_GETTEXT} AND ${HAVE_DCGETTEXT} AND ${HAVE_LANGINFO_CODESET} AND ${HAVE_LC_MESSAGES}) add_definitions(-D LOCALEDIR=\\"/usr/share/locale\\") add_definitions(-D ENABLE_NLS) - ADD_SUBDIRECTORY( po ) + #ADD_SUBDIRECTORY( ${CMAKE_SOURCE_DIR}/po ) endif() DefineHFileIfAvailable(stdbool.h HAVE_STDBOOL_H) DefineHFileIfAvailable(sys/wait.h HAVE_SYS_WAIT_H) |