aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Kahrs <Juergen.Kahrs@googlemail.com>2013-02-09 23:23:41 +0100
committerJuergen Kahrs <Juergen.Kahrs@googlemail.com>2013-02-09 23:23:41 +0100
commit478c3f9f2f8f0d3a3e3e8ac4ea412a6ee7e54b86 (patch)
tree9f314dd16577aa442b59666e6aa71d490e9225a2
parent251fa761931520336e19fb09af583954a6f481ce (diff)
downloadegawk-478c3f9f2f8f0d3a3e3e8ac4ea412a6ee7e54b86.tar.gz
egawk-478c3f9f2f8f0d3a3e3e8ac4ea412a6ee7e54b86.tar.bz2
egawk-478c3f9f2f8f0d3a3e3e8ac4ea412a6ee7e54b86.zip
All extensions can be built as shared libraries now. It was necessary to remove -DGAWK when building the extensions. The test cases involving extensions still fail.
-rw-r--r--CMakeLists.txt5
-rwxr-xr-xcmake/basictest1
-rw-r--r--extension/CMakeLists.txt67
3 files changed, 72 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07edfca3..410c0204 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,7 +89,7 @@ STRING( REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" GAWK_MAJOR_VERSION
STRING( REGEX REPLACE ".*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" GAWK_MINOR_VERSION "${GAWK_AUTOMAKE_LINE_VERSION}")
STRING( REGEX REPLACE ".*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" GAWK_BUGFIX_VERSION "${GAWK_AUTOMAKE_LINE_VERSION}")
-add_definitions(-D GAWK)
+add_definitions(-DGAWK)
set(GAWK_VERSION "${GAWK_MAJOR_VERSION}.${GAWK_MINOR_VERSION}.${GAWK_BUGFIX_VERSION}")
add_definitions(-D VERSION=\\"${GAWK_VERSION}\\")
add_definitions(-D PACKAGE=\\"gawk\\")
@@ -270,6 +270,9 @@ set (GAWK_SOURCES ${GAWK_SOURCES}
add_executable (gawk ${GAWK_SOURCES})
target_link_libraries (gawk m ${EXTRA_LIBS})
+# Beware: before building the extension, -DGAWK gets undefined.
+add_subdirectory(extension)
+
if(NOT ${CMAKE_CROSSCOMPILING} STREQUAL "TRUE")
enable_testing()
add_subdirectory(test)
diff --git a/cmake/basictest b/cmake/basictest
index 958c778b..6fe5db5a 100755
--- a/cmake/basictest
+++ b/cmake/basictest
@@ -2,6 +2,7 @@
TESTHOME=$(dirname ${0})/../test
export AWKPATH=${TESTHOME}
+export LANG=C
if test -r ${TESTHOME}/${2}.in
then
$1 -f ${2}.awk < ${TESTHOME}/${2}.in > ${TESTHOME}/_${2} 2>&1 || echo EXIT CODE: $? >> ${TESTHOME}/_${2}
diff --git a/extension/CMakeLists.txt b/extension/CMakeLists.txt
new file mode 100644
index 00000000..a730d8b6
--- /dev/null
+++ b/extension/CMakeLists.txt
@@ -0,0 +1,67 @@
+#
+# extension/CMakeLists.txt --- CMake input file for gawk
+#
+# Copyright (C) 2013
+# 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
+#
+
+## process this file with CMake to produce Makefile
+
+remove_definitions(-DGAWK)
+
+add_library (filefuncs SHARED filefuncs.c stack.c gawkfts.c)
+target_link_libraries (filefuncs)
+
+DefineFunctionIfAvailable(fnmatch HAVE_FNMATCH_H)
+add_library (fnmatch SHARED fnmatch.c)
+target_link_libraries (fnmatch)
+
+add_library (fork SHARED fork.c)
+target_link_libraries (fork)
+
+add_library (inplace SHARED inplace.c)
+target_link_libraries (inplace)
+
+add_library (ordchr SHARED ordchr.c)
+target_link_libraries (ordchr)
+
+DefineHFileIfAvailable(dirent.h HAVE_DIRENT_H)
+add_library (readdir SHARED readdir.c)
+target_link_libraries (readdir)
+
+add_library (readfile SHARED readfile.c)
+target_link_libraries (readfile)
+
+add_library (revoutput SHARED revoutput.c)
+target_link_libraries (revoutput)
+
+DefineFunctionIfAvailable(getdtablesize HAVE_GETDTABLESIZE)
+add_library (revtwoway SHARED revtwoway.c)
+target_link_libraries (revtwoway)
+
+add_library (rwarray SHARED rwarray.c)
+target_link_libraries (rwarray)
+
+add_library (time SHARED time.c)
+target_link_libraries (time)
+
+add_library (testext SHARED testext.c)
+target_link_libraries (testext)
+