# - 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)
# 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.
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;}' < $< > $@
# 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.
.SUFFIXES: .l
.l.c:
- $(SH) $(RUNLEX) "$(LEX)" -o$@ $<
+ $(SH) $(RUNLEX) "$(LEX)" "$(SED)" -o$@ $<
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}
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
#
# 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
fi
LEX="$1"
shift
-
#
# Check whether we have it.
#
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.
#
# Set the output file name.
#
- outfile=`echo "$1" | sed 's/-o\(.*\)/\1/'`
+ outfile=`echo "$1" | ${SED} 's/-o\(.*\)/\1/'`
;;
-*)
# 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"