Pass the name of the sed executable as an explicit argurment to
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 3 Nov 2013 12:22:39 +0000 (12:22 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 3 Nov 2013 12:22:39 +0000 (12:22 +0000)
runlex.sh (like it is done with LEX already). May fix a problem
on Windows with cmake.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@53059 f5534014-38df-0310-8fa8-9805f1628bb7

CMakeLists.txt
Makefile.am.inc
Makefile.nmake.inc
cmake/modules/FindLEX.cmake
config.nmake
configure.ac
tools/runlex.sh

index eed6201f1b7dd1a6d5ed5ad8a970766f0eaf1757..61013f0087332b0c4a16c593d6f5e42e6697b1ba 100644 (file)
@@ -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)
index 8cad089665994d4fa5b4eb9f39c2a93494a8024c..54606b2c16ecb3b3b601962a82312243907ae58b 100644 (file)
@@ -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;}' < $< > $@
index 2fba495077e434e4a9db553388a450961f7a608b..5bc868e99210eb99e1f144ef67224c431a4195db 100644 (file)
@@ -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$@ $<
index 3e13271b003907d0a77f0715dc00ebc8aead2e11..955ae3849a0f6d20141f6f8187c536aa6fad317f 100644 (file)
@@ -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}
index 0017c959034868a0999bf5f1fc7577e5dad600c0..4670cc71f356aa95531e0eccf0d8eb896e1072fe 100644 (file)
@@ -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
 
index 13f376aaa1429471bc18135a20b5be33bb7fd0a6..9fb66d90fd6302f1d4eccda349762ec902b567b4 100644 (file)
@@ -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
index 266b07fd7e746087845c996838cf71c2651ad33e..1e58c50f8bc1f569e2f9c742e028beedd69d3f2d 100755 (executable)
@@ -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"