diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Makefile.am.inc | 8 | ||||
-rw-r--r-- | Makefile.nmake.inc | 8 | ||||
-rw-r--r-- | cmake/modules/FindLEX.cmake | 2 | ||||
-rw-r--r-- | config.nmake | 3 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rwxr-xr-x | tools/runlex.sh | 16 |
7 files changed, 32 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eed6201f1b..61013f0087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,7 +338,7 @@ endif() # - set HAVE_XXX #The minimum package list -set(PACKAGELIST Gettext GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SH PythonInterp) +set(PACKAGELIST Gettext GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SED SH PythonInterp) set(GLIB2_FIND_REQUIRED) set(GLIB2_MIN_VERSION 2.14.0) set(GTHREAD2_REQUIRED) diff --git a/Makefile.am.inc b/Makefile.am.inc index 8cad089665..54606b2c16 100644 --- a/Makefile.am.inc +++ b/Makefile.am.inc @@ -6,17 +6,17 @@ # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyright 1998 Gerald Combs -# +# # This program 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 2 # of the License, or (at your option) any later version. -# +# # This program 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. @@ -40,7 +40,7 @@ am__v_SED_ = $(am__v_SED_@AM_DEFAULT_V@) am__v_SED_0 = @echo " SED " $@; .l.c: - $(AM_V_RUNLEX)$(RUNLEX) "$(LEX)" -o$@ $< + $(AM_V_RUNLEX)$(RUNLEX) "$(LEX)" "$(SED)" -o$@ $< .def.sym: $(AM_V_AWK)$(AWK) '/^EXPORTS$$/ {next;}; ${def_sym_filter_symbols} /^[^;]/ { print $$1;}' < $< > $@ diff --git a/Makefile.nmake.inc b/Makefile.nmake.inc index 2fba495077..5bc868e992 100644 --- a/Makefile.nmake.inc +++ b/Makefile.nmake.inc @@ -6,17 +6,17 @@ # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyright 2007 Gerald Combs -# +# # This program 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 2 # of the License, or (at your option) any later version. -# +# # This program 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. @@ -24,4 +24,4 @@ .SUFFIXES: .l .l.c: - $(SH) $(RUNLEX) "$(LEX)" -o$@ $< + $(SH) $(RUNLEX) "$(LEX)" "$(SED)" -o$@ $< diff --git a/cmake/modules/FindLEX.cmake b/cmake/modules/FindLEX.cmake index 3e13271b00..955ae3849a 100644 --- a/cmake/modules/FindLEX.cmake +++ b/cmake/modules/FindLEX.cmake @@ -35,7 +35,7 @@ MACRO(ADD_LEX_FILES _sources ) ADD_CUSTOM_COMMAND( OUTPUT ${_outc} - COMMAND ${SH_EXECUTABLE} ${SH_FLAGS1} ${SH_FLAGS2} ${CMAKE_SOURCE_DIR}/tools/runlex.sh ${LEX_EXECUTABLE} + COMMAND ${SH_EXECUTABLE} ${SH_FLAGS1} ${SH_FLAGS2} ${CMAKE_SOURCE_DIR}/tools/runlex.sh ${LEX_EXECUTABLE} ${SED_EXECUTABLE} -o${_outc} --header-file=${_outh} ${_in} diff --git a/config.nmake b/config.nmake index 0017c95903..4670cc71f3 100644 --- a/config.nmake +++ b/config.nmake @@ -776,6 +776,9 @@ PERL=perl POD2MAN=$(SH) pod2man POD2HTML=$(SH) pod2html +# command for sed (cygwin's sed recommended) +SED=sed + # command for lex/flexx (cygwin's flex recommended) LEX=flex diff --git a/configure.ac b/configure.ac index 13f376aaa1..9fb66d90fd 100644 --- a/configure.ac +++ b/configure.ac @@ -1212,6 +1212,12 @@ esac # # Add any checks here that are necessary for other OSes. # +AM_PROG_SED +AC_PATH_PROG(SED, sed) +if test "x$SED" = x +then + AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path) +fi AC_WIRESHARK_GNU_SED_CHECK if test "$HAVE_GNU_SED" = no ; then case "$host_os" in diff --git a/tools/runlex.sh b/tools/runlex.sh index 266b07fd7e..1e58c50f8b 100755 --- a/tools/runlex.sh +++ b/tools/runlex.sh @@ -38,7 +38,6 @@ then fi LEX="$1" shift - # # Check whether we have it. # @@ -48,6 +47,17 @@ then exit 1 fi +SED="$1" +shift +# +# Check whether we have it. +# +if [ -z "${SED}" ] +then + echo "Sed was not found" 1>&2 + exit 1 +fi + # # Process the flags. We don't use getopt because we don't want to # embed complete knowledge of what options are supported by Lex/Flex. @@ -62,7 +72,7 @@ do # # Set the output file name. # - outfile=`echo "$1" | sed 's/-o\(.*\)/\1/'` + outfile=`echo "$1" | ${SED} 's/-o\(.*\)/\1/'` ;; -*) @@ -141,7 +151,7 @@ echo "Wrote $outfile" # line. We use the last one. # echo "Getting prefix" -prefix=`sed -n 's/%option[ ][ ]*prefix="\(.*\)".*/\1/p' "$@" | tail -1` +prefix=`${SED} -n 's/%option[ ][ ]*prefix="\(.*\)".*/\1/p' "$@" | tail -1` if [ ! -z "$prefix" ] then prefixline="#define yylex ${prefix}lex" |