diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | cmake/configure.cmake | 38 |
2 files changed, 19 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cdc12dfa..77fad100 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,14 +41,14 @@ endif () include_directories(${CMAKE_SOURCE_DIR}) if(WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") - # This is enough to build with MinGW cross-compiler on OpenSuSE 12.2. + # This is enough to build with MinGW in a native Windows environment + # and also with a cross-compiler on OpenSuSE 12.2. # On Ubuntu 12.04 patches to gawk's source code are needed: # - insert #include <windows.h> at the top of awk.h # - remove function execvp from pc/gawkmisc.pc - DefineConfigHValue(HAVE_USLEEP 1) - DefineConfigHValue(HAVE_ISWUPPER 1) DefineConfigHValue(HAVE_SETENV 1) DefineConfigHValue(STDC_HEADERS 1) + DefineConfigHValue(HAVE_STRINGIZE 1) # TODO: Eli Zaretskii remined me that the generated # settings in config.h should be the same as those in # pc/config.h. With these settings and DYNAMIC=1 diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 1c74bc5c..ec4c4e52 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -149,15 +149,8 @@ DefineHFileIfAvailable(stdint.h HAVE_STDINT_H) DefineHFileIfAvailable(inttypes.h HAVE_INTTYPES_H) DefineHFileIfAvailable(stdlib.h HAVE_STDLIB_H) DefineHFileIfAvailable(unistd.h HAVE_UNISTD_H) -if (CMAKE_HOST_UNIX) - DefineFunctionIfAvailable(gettext HAVE_GETTEXT) - DefineFunctionIfAvailable(dcgettext HAVE_DCGETTEXT) - FIND_PACKAGE(Gettext REQUIRED) - # FIND_PACKAGE(XGettext REQUIRED) - # FIND_PACKAGE(Iconv REQUIRED) - FIND_PATH(INTL_INCLUDE_DIR libintl.h PATHS /usr/include /usr/local/include) - FIND_LIBRARY(INTL_LIBRARIES intl c PATHS /usr/lib/ /usr/local/lib) -endif() +FIND_PATH(INTL_INCLUDE_DIR libintl.h PATHS /usr/include /usr/local/include) +FIND_LIBRARY(INTL_LIBRARIES intl c PATHS /usr/lib/ /usr/local/lib) DefineSymbolIfAvailable("CODESET" "langinfo.h" HAVE_LANGINFO_CODESET) DefineSymbolIfAvailable("LC_MESSAGES" "locale.h" HAVE_LC_MESSAGES) DefineTypeIfAvailable("_Bool" HAVE__BOOL) @@ -203,6 +196,7 @@ DefineStructHasMemberIfAvailable("struct tm" tm_zone time.h HAVE_STRUCT_TM_TM_ZO DefineHFileIfAvailable(sys/time.h HAVE_SYS_TIME_H) DefineFunctionIfAvailable(alarm HAVE_ALARM) +DefineFunctionIfAvailable(tzname HAVE_DECL_TZNAME) DefineFunctionIfAvailable(mktime HAVE_MKTIME) DefineFunctionIfAvailable(getaddrinfo HAVE_GETADDRINFO) DefineFunctionIfAvailable(atexit HAVE_ATEXIT) @@ -214,11 +208,12 @@ DefineFunctionIfAvailable(getgrent HAVE_GETGRENT) DefineFunctionIfAvailable(getgroups HAVE_GETGROUPS) add_definitions(-D GETGROUPS_T=gid_t) DefineTypeIfAvailable("pid_t" PID_T) +DefineTypeIfAvailable("intmax_t" HAVE_INTMAX_T) DefineFunctionIfAvailable(grantpt HAVE_GRANTPT) DefineFunctionIfAvailable(isascii HAVE_ISASCII) DefineFunctionIfAvailable(iswctype HAVE_ISWCTYPE) DefineFunctionIfAvailable(iswlower HAVE_ISWLOWER) -DefineFunctionIfAvailable(iswupper HAVE_ISUPPER) +DefineFunctionIfAvailable(iswupper HAVE_ISWUPPER) DefineFunctionIfAvailable(mbrlen HAVE_MBRLEN) DefineFunctionIfAvailable(memcmp HAVE_MEMCMP) DefineFunctionIfAvailable(memcpy HAVE_MEMCPY) @@ -260,20 +255,19 @@ else() set(BISON_awkgram_OUTPUTS ${CMAKE_SOURCE_DIR}/awkgram.c) endif() -if (CMAKE_HOST_UNIX) - #http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:FindGettext - find_package(Gettext REQUIRED) - if (GETTEXT_FOUND STREQUAL "TRUE") - include_directories(${GETTEXT_INCLUDE_DIR}) - else () - message( FATAL_ERROR "Gettext not found" ) - endif() - - find_package(LATEX) - include(GNUInstallDirs) - include(GetPrerequisites) +find_package(Gettext REQUIRED) +if (GETTEXT_FOUND STREQUAL "TRUE") + include_directories(${GETTEXT_INCLUDE_DIR}) + DefineFunctionIfAvailable(gettext HAVE_GETTEXT) + DefineFunctionIfAvailable(dcgettext HAVE_DCGETTEXT) +else () + message( FATAL_ERROR "Gettext not found" ) endif() +find_package(LATEX) +include(GNUInstallDirs) +include(GetPrerequisites) + # For some unknown reason the defines for the extensions # are written into config.h only if they are implemented # here and not in extension/CMakeLists.txt. |