aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-12-27 21:18:52 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-12-27 21:18:52 +0200
commitb98e22acc203ec6a96777897adf434e7e278ab6d (patch)
tree88f6f7b55ada70ed9cd37ebe25ee4e6d767bb7ee
parent6a92d47d1d95ead34e04c7f84fef729f59790c5d (diff)
downloadegawk-b98e22acc203ec6a96777897adf434e7e278ab6d.tar.gz
egawk-b98e22acc203ec6a96777897adf434e7e278ab6d.tar.bz2
egawk-b98e22acc203ec6a96777897adf434e7e278ab6d.zip
Update CMake support after adding support directory.
-rw-r--r--CMakeLists.txt7
-rw-r--r--ChangeLog4
-rw-r--r--cmake/configure.cmake13
-rw-r--r--support/CMakeLists.txt34
-rw-r--r--support/ChangeLog6
5 files changed, 58 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 154d2afb..0214708c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ if (${DYNAMIC})
endif ()
include_directories(${CMAKE_SOURCE_DIR})
+include_directories(${CMAKE_SOURCE_DIR}/support)
if(WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
# This is enough to build with MinGW in a native Windows environment
@@ -66,13 +67,14 @@ if(WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
include_directories(${CMAKE_SOURCE_DIR}/pc)
endif()
+add_subdirectory(support)
+
set (GAWK_SOURCES ${GAWK_SOURCES}
array.c
builtin.c
cint_array.c
command.c
debug.c
- dfa.c
eval.c
ext.c
field.c
@@ -86,7 +88,6 @@ set (GAWK_SOURCES ${GAWK_SOURCES}
msg.c
node.c
profile.c
- random.c
re.c
replace.c
str_array.c
@@ -95,7 +96,7 @@ set (GAWK_SOURCES ${GAWK_SOURCES}
)
add_executable (gawk ${GAWK_SOURCES} ${BISON_awkgram_OUTPUTS})
-target_link_libraries (gawk m ${EXTRA_LIBS})
+target_link_libraries (gawk m support ${EXTRA_LIBS})
install(PROGRAMS ${CMAKE_BINARY_DIR}/gawk${CMAKE_EXECUTABLE_SUFFIX} DESTINATION bin)
# Beware: before building the extension, -DGAWK gets undefined.
diff --git a/ChangeLog b/ChangeLog
index 3ce0a2cc..9d4bcd64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-12-27 Juergen Kahrs <Juergen.Kahrs@googlemail.com>
+
+ * CMakeLists.txt: Updated after adding support library.
+
2016-12-23 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac (GNUPG_CHECK_MPFR): Don't call on PowerPC
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)
diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt
new file mode 100644
index 00000000..5e7fd3ad
--- /dev/null
+++ b/support/CMakeLists.txt
@@ -0,0 +1,34 @@
+#
+# CMakeLists.txt --- CMake input file for gawk's support library
+#
+# Copyright (C) 2016
+# the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+#
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+add_definitions(-DGAWK)
+add_definitions(-DHAVE_CONFIG_H)
+add_definitions(-D_GNU_SOURCE)
+add_library (support STATIC
+ dfa.c
+ getopt1.c
+ getopt.c
+ localeinfo.c
+ random.c
+ regex.c
+)
diff --git a/support/ChangeLog b/support/ChangeLog
index 80164c39..ec0607f1 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,6 +1,10 @@
+2016-12-27 Juergen Kahrs <Juergen.Kahrs@googlemail.com>
+
+ * CMakeLists.txt: New file.
+
2016-12-22 John E. Malmberg <wb8tyw@qsl.net>
- * dfa.c fixes for OpenVMS
+ * dfa.c fixes for OpenVMS
2016-12-22 Arnold D. Robbins <arnold@skeeve.com>