This file is part of MXE.
See index.html for further information.
Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Nagaev
Date: Tue, 17 May 2016 19:02:54 +0200
Subject: [PATCH] add output of Ragel from build
Workaround not to include Ragel as a dependency.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,6 @@ INCLUDE (CheckLibraryExists)
INCLUDE (CheckSymbolExists)
include (CMakeDependentOption)
include (${CMAKE_MODULE_PATH}/platform.cmake)
-include (${CMAKE_MODULE_PATH}/ragel.cmake)
find_package(PkgConfig QUIET)
@@ -82,7 +81,6 @@ endif()
# -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6)
find_package(PythonInterp)
-find_program(RAGEL ragel)
if(PYTHONINTERP_FOUND)
set(PYTHON ${PYTHON_EXECUTABLE})
@@ -90,10 +88,6 @@ else()
message(FATAL_ERROR "No python interpreter found")
endif()
-if(${RAGEL} STREQUAL "RAGEL-NOTFOUND")
- message(FATAL_ERROR "Ragel state machine compiler not found")
-endif()
-
option(OPTIMISE "Turns off compiler optimizations (on by default unless debug output enabled or coverage testing)" TRUE)
option(DEBUG_OUTPUT "Enable debug output (warning: very verbose)" FALSE)
@@ -375,12 +369,10 @@ set(RAGEL_C_FLAGS "-Wno-unused")
endif()
set_source_files_properties(
- ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp
+ ${CMAKE_SOURCE_DIR}/src/parser/Parser.cpp
PROPERTIES
COMPILE_FLAGS "${RAGEL_C_FLAGS}")
-ragelmaker(src/parser/Parser.rl)
-
SET(hs_HEADERS
src/hs.h
src/hs_common.h
@@ -979,15 +971,12 @@ endif()
# we want the static lib for testing
add_library(hs STATIC ${hs_SRCS} $)
-add_dependencies(hs ragel_Parser)
-
if (NOT BUILD_SHARED_LIBS)
install(TARGETS hs DESTINATION lib)
endif()
if (BUILD_STATIC_AND_SHARED OR BUILD_SHARED_LIBS)
add_library(hs_shared SHARED ${hs_SRCS} $)
- add_dependencies(hs_shared ragel_Parser)
set_target_properties(hs_shared PROPERTIES
OUTPUT_NAME hs
VERSION ${LIB_VERSION}
diff --git a/src/parser/Parser.cpp b/src/parser/Parser.cpp
new file mode 100644
index 1111111..2222222
--- /dev/null
+++ b/src/parser/Parser.cpp
@@ -0,0 +1,5436 @@
+
+#line 1 "hyperscan-4.1.0/src/parser/Parser.rl"
+/*
+ * Copyright (c) 2015, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Intel Corporation nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** \file
+ * \brief Parser code (generated with Ragel from Parser.rl).
+ */
+
+#include "config.h"
+
+/* Parser.cpp is a built source, may not be in same dir as parser files */
+#include "parser/check_refs.h"
+#include "parser/ComponentAlternation.h"
+#include "parser/ComponentAssertion.h"
+#include "parser/ComponentAtomicGroup.h"
+#include "parser/ComponentBackReference.h"
+#include "parser/ComponentBoundary.h"
+#include "parser/ComponentByte.h"
+#include "parser/ComponentClass.h"
+#include "parser/ComponentCondReference.h"
+#include "parser/ComponentEmpty.h"
+#include "parser/ComponentEUS.h"
+#include "parser/Component.h"
+#include "parser/ComponentRepeat.h"
+#include "parser/ComponentSequence.h"
+#include "parser/ComponentWordBoundary.h"
+#include "parser/parse_error.h"
+#include "parser/Parser.h"
+#include "ue2common.h"
+#include "util/compare.h"
+#include "util/make_unique.h"
+#include "util/ue2_containers.h"
+#include "util/unicode_def.h"
+#include "util/verify_types.h"
+
+#include
+#include
+#include
+#include
+#include