summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_compile
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-04-30 19:50:05 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-04-30 19:50:05 -0700
commit806d09b1143894ad66cea2c228f467e8c39a8adf (patch)
tree512bfa5d5a8fe92ac4616fd9169e1c458b0e8b87 /indra/lscript/lscript_compile
parentb06ec66a5d11628905da256e084d0036f39ba529 (diff)
Merge 3.5.1 into Materials
Diffstat (limited to 'indra/lscript/lscript_compile')
-rw-r--r--indra/lscript/lscript_compile/CMakeLists.txt9
-rw-r--r--indra/lscript/lscript_compile/bison.bat9
-rw-r--r--indra/lscript/lscript_compile/indra.l29
-rw-r--r--indra/lscript/lscript_compile/indra.y5
4 files changed, 47 insertions, 5 deletions
diff --git a/indra/lscript/lscript_compile/CMakeLists.txt b/indra/lscript/lscript_compile/CMakeLists.txt
index 3ed2892e0e..07662005b9 100644
--- a/indra/lscript/lscript_compile/CMakeLists.txt
+++ b/indra/lscript/lscript_compile/CMakeLists.txt
@@ -45,6 +45,9 @@ include_directories(
${LLPRIMITIVE_INCLUDE_DIRS}
${LSCRIPT_INCLUDE_DIRS}
)
+include_directories(SYSTEM
+ ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
+ )
set(lscript_generated_SOURCE_FILES
indra.l.cpp
@@ -95,6 +98,7 @@ add_custom_command(
${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
COMMAND ${FLEX}
ARGS
+ -P indra_
-o${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.l
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
@@ -112,8 +116,10 @@ if (WINDOWS)
${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
+ ARGS
${BISON} ${M4_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
+ -p indra_
+ -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.y
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
@@ -128,6 +134,7 @@ else (WINDOWS)
COMMAND
${BISON}
ARGS
+ -p indra_
-d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.y
DEPENDS
diff --git a/indra/lscript/lscript_compile/bison.bat b/indra/lscript/lscript_compile/bison.bat
index 0baff4e5ef..d40997225e 100644
--- a/indra/lscript/lscript_compile/bison.bat
+++ b/indra/lscript/lscript_compile/bison.bat
@@ -2,10 +2,11 @@
@REM find m4, even if neither program is present in PATH.
@set bison=%1
-set M4PATH=%2
+shift
+set M4PATH=%1
+shift
set M4=
-@set output=%3
-@set input=%4
set PATH=%M4PATH%;%PATH%
-%bison% -d -o %output% %input%
+@REM %* does not work with shift...
+%bison% %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 96b7e57e97..9132d5d528 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -56,11 +56,40 @@ void parse_string();
#define ECHO do { } while (0)
+#define yyparse indra_parse
+#define yyerror indra_error
+#define yylval indra_lval
+#define yy_create_buffer indra__create_buffer
+#define yy_delete_buffer indra__delete_buffer
+#define yy_flex_debug indra__flex_debug
+#define yy_init_buffer indra__init_buffer
+#define yy_flush_buffer indra__flush_buffer
+#define yy_load_buffer_state indra__load_buffer_state
+#define yy_switch_to_buffer indra__switch_to_buffer
+#define yyin indra_in
+#define yyleng indra_leng
+#define yylex indra_lex
+#define yylineno indra_lineno
+#define yyout indra_out
+#define yyrestart indra_restart
+#define yytext indra_text
+#define yywrap indra_wrap
+#define yyalloc indra_alloc
+#define yyrealloc indra_realloc
+#define yyfree indra_free
+
+
+#if LL_WINDOWS
#if defined(__cplusplus)
extern "C" { int yylex( void ); }
extern "C" { int yyparse( void ); }
extern "C" { int yyerror(const char *fmt, ...); }
#endif
+#else
+int yylex( void );
+int yyparse( void );
+int yyerror(const char *fmt, ...);
+#endif
%}
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y
index e4b10ffdd9..9c2ed02f72 100644
--- a/indra/lscript/lscript_compile/indra.y
+++ b/indra/lscript/lscript_compile/indra.y
@@ -2,9 +2,11 @@
#include "linden_common.h"
#include "lscript_tree.h"
+ #if LL_WINDOWS
#ifdef __cplusplus
extern "C" {
#endif
+ #endif
int yylex(void);
int yyparse( void );
@@ -20,9 +22,12 @@
#pragma warning( disable : 4065 ) // warning: switch statement contains 'default' but no 'case' labels
#endif
+ #if LL_WINDOWS
#ifdef __cplusplus
}
#endif
+ #endif
+
%}
%union