Chris Hillery has proposed merging 
lp:~zorba-coders/zorba/bug-1034582-flexlexerh into lp:zorba.

Requested reviews:
  Chris Hillery (ceejatec)
  Paul J. Lucas (paul-lucas)
Related bugs:
  Bug #1034582 in Zorba: "flex header incompatibility"
  https://bugs.launchpad.net/zorba/+bug/1034582

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1034582-flexlexerh/+merge/119075
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1034582-flexlexerh/+merge/119075
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'cmake_modules/CMakeUseFlex.cmake'
--- cmake_modules/CMakeUseFlex.cmake	2012-07-24 08:48:48 +0000
+++ cmake_modules/CMakeUseFlex.cmake	2012-08-10 02:18:21 +0000
@@ -29,6 +29,7 @@
 
 IF(NOT FLEX_EXECUTABLE)
   MESSAGE(STATUS "Looking for flex")
+  FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h)
   FIND_PROGRAM(FLEX_EXECUTABLE flex)
   IF(FLEX_EXECUTABLE)
     EXEC_PROGRAM(
@@ -63,15 +64,26 @@
     ELSE(FLEX_PREFIX_OUTPUTS)
       SET(PREFIX "yy")
     ENDIF(FLEX_PREFIX_OUTPUTS)
+    # If we regenerate the scanner, be sure to copy the corresponding
+    # FlexLexer.h as well. Put it in the top-level src/ directory since
+    # that path is on the include-directories list; also, that way
+    # multiple flex'd files will all share the include file.
+    SET(FLEXLEXERH "${CMAKE_CURRENT_BINARY_DIR}/FlexLexer.h")
+    ADD_CUSTOM_COMMAND(
+      OUTPUT "${FLEXLEXERH}"
+      COMMAND "${CMAKE_COMMAND}"
+      ARGS -E copy_if_different
+         "${FLEX_INCLUDE_DIR}/FlexLexer.h"
+	 "${FLEXLEXERH}")
     SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${PREFIX}.cpp")
     ADD_CUSTOM_COMMAND(
       OUTPUT "${OUTFILE}"
       COMMAND "${FLEX_EXECUTABLE}"
-      ARGS -t 
-	  "--debug"
-      "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
-      > ${OUTFILE}
-      DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
+      ARGS -t --debug "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+      # flex's --outfile doesn't seem to work right, so redirect stdout
+          > "${OUTFILE}"
+      DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+         "${FLEXLEXERH}")
     SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE)
   ENDMACRO(FLEX_FILE)
 ENDIF(FLEX_EXECUTABLE)

=== modified file 'src/compiler/parser/copyparser.sh.cmake'
--- src/compiler/parser/copyparser.sh.cmake	2012-07-24 08:48:48 +0000
+++ src/compiler/parser/copyparser.sh.cmake	2012-08-10 02:18:21 +0000
@@ -20,7 +20,7 @@
 
 cp $BINARY_DIR/compiler/parser/xquery_parser.hpp $SOURCE_DIR/compiler/parser
 cp $BINARY_DIR/compiler/parser/xquery_parser.cpp $SOURCE_DIR/compiler/parser
-cp /usr/include/FlexLexer.h $SOURCE_DIR/compiler/parser/FlexLexer.h
+cp $BINARY_DIR/FlexLexer.h $SOURCE_DIR/compiler/parser/FlexLexer.h
 sed -e 's|^#include <FlexLexer.h>|#include "compiler/parser/FlexLexer.h"|g' $BINARY_DIR/compiler/parser/xquery_scanner.cpp > $SOURCE_DIR/compiler/parser/xquery_scanner.cpp
 
 echo "Copying Done!"

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to