Alien-flex

 view release on metacpan or  search on metacpan

patch/flex-2.6.4.diff  view on Meta::CPAN

+
 
 for ac_prog in gtexi2dvi texi2dvi
 do
@@ -19753,6 +19821,13 @@ $as_echo "$as_me: WARNING: texi2dvi: program not found: building pdf version of
 
 fi
 
+if test "$cross_compiling" = yes; then
+FLEXexe='flex$(EXEEXT)'
+else
+FLEXexe='$(top_builddir)/src/flex$(EXEEXT)'
+fi
+
+
 # Check for a m4 that supports -P
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for m4 that supports -P" >&5
@@ -20755,7 +20830,7 @@ done
 
 
 # Optional library functions
-for ac_func in pow setlocale reallocarray
+for ac_func in pow setlocale reallocarr reallocarray
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -20768,7 +20843,31 @@ fi
 done
 
 
-ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile examples/fastwc/Makefile examples/manual/Makefile po/Makefile.in src/Makefile tools/Makefile tests/Makefile"
+ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile examples/fastwc/Makefile examples/manual/Makefile po/Makefile.in src/libfl.pc src/Makefile tools/Makefile tests/Makefile"
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=yes
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
 
 
 cat >confcache <<\_ACEOF
@@ -20924,6 +21023,10 @@ if test -z "${CROSS_TRUE}" && test -z "${CROSS_FALSE}"; then
   as_fn_error $? "conditional \"CROSS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
@@ -21887,7 +21990,7 @@ fi
 
 
 
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
     # from automake < 1.5.
@@ -21914,6 +22017,7 @@ do
     "examples/fastwc/Makefile") CONFIG_FILES="$CONFIG_FILES examples/fastwc/Makefile" ;;
     "examples/manual/Makefile") CONFIG_FILES="$CONFIG_FILES examples/manual/Makefile" ;;
     "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+    "src/libfl.pc") CONFIG_FILES="$CONFIG_FILES src/libfl.pc" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
@@ -23226,29 +23330,35 @@ _LT_EOF
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`

patch/flex-2.6.4.diff  view on Meta::CPAN

-			printf (_("%s %s\n"), program_name, flex_version);
+			printf ("%s %s\n", (C_plus_plus ? "flex++" : "flex"), flex_version);
 			FLEX_EXIT (0);
 
 		case OPT_WARN:
@@ -1394,6 +1401,14 @@ void flexinit (int argc, char **argv)
 			//buf_strdefine (&userdef_buf, "YY_NO_SET_LINENO", "1");
             buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LINENO",0);
 			break;
+		case OPT_NO_YYGET_COLUMN:
+			//buf_strdefine (&userdef_buf, "YY_NO_GET_COLUMN", "1");
+            buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_COLUMN",0);
+			break;
+		case OPT_NO_YYSET_COLUMN:
+			//buf_strdefine (&userdef_buf, "YY_NO_SET_COLUMN", "1");
+            buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_COLUMN",0);
+			break;
 		case OPT_NO_YYGET_IN:
 			//buf_strdefine (&userdef_buf, "YY_NO_GET_IN", "1");
             buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_IN",0);
@@ -1817,7 +1832,8 @@ void usage (void)
 		  "  -t, --stdout            write scanner on stdout instead of %s\n"
 		  "      --yyclass=NAME      name of C++ class\n"
 		  "      --header-file=FILE   create a C header file in addition to the scanner\n"
-		  "      --tables-file[=FILE] write tables to FILE\n" "\n"
+		  "      --tables-file[=FILE] write tables to FILE\n"
+		  "      --backup-file=FILE  write backing-up information to FILE\n" "\n"
 		  "Scanner behavior:\n"
 		  "  -7, --7bit              generate 7-bit scanner\n"
 		  "  -8, --8bit              generate 8-bit scanner\n"
@@ -1844,6 +1860,6 @@ void usage (void)
 		  "  -?\n"
 		  "  -h, --help              produce this help message\n"
 		  "  -V, --version           report %s version\n"),
-		 backing_name, program_name, outfile_path, program_name);
+		 backing_name, "flex", outfile_path, "flex");
 
 }
diff --git a/src/misc.c b/src/misc.c
index ef27833..745e6a8 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -116,15 +116,14 @@ void add_action (const char *new_text)
 	int     len = (int) strlen (new_text);
 
 	while (len + action_index >= action_size - 10 /* slop */ ) {
-		int     new_size = action_size * 2;
 
-		if (new_size <= 0)
+		if (action_size > INT_MAX / 2)
 			/* Increase just a little, to try to avoid overflow
 			 * on 16-bit machines.
 			 */
 			action_size += action_size / 8;
 		else
-			action_size = new_size;
+			action_size = action_size * 2;
 
 		action_array =
 			reallocate_character_array (action_array,
@@ -141,20 +140,24 @@ void add_action (const char *new_text)
 
 void   *allocate_array (int size, size_t element_size)
 {
-	void *mem;
-#if HAVE_REALLOCARRAY
-	/* reallocarray has built-in overflow detection */
-	mem = reallocarray(NULL, (size_t) size, element_size);
+	void *new_array;
+#if HAVE_REALLOCARR
+	new_array = NULL;
+	if (reallocarr(&new_array, (size_t) size, element_size))
+		flexfatal (_("memory allocation failed in allocate_array()"));
 #else
+# if HAVE_REALLOCARRAY
+	new_array = reallocarray(NULL, (size_t) size, element_size);
+# else
+	/* Do manual overflow detection */
 	size_t num_bytes = (size_t) size * element_size;
-	mem = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
+	new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
 		malloc(num_bytes);
+# endif
+	if (!new_array)
+		flexfatal (_("memory allocation failed in allocate_array()"));
 #endif
-	if (!mem)
-		flexfatal (_
-			   ("memory allocation failed in allocate_array()"));
-
-	return mem;
+	return new_array;
 }
 
 
@@ -659,17 +662,22 @@ char   *readable_form (int c)
 void   *reallocate_array (void *array, int size, size_t element_size)
 {
 	void *new_array;
-#if HAVE_REALLOCARRAY
-	/* reallocarray has built-in overflow detection */
-	new_array = reallocarray(array, (size_t) size, element_size);
+#if HAVE_REALLOCARR
+	new_array = array;
+	if (reallocarr(&new_array, (size_t) size, element_size))
+		flexfatal (_("attempt to increase array size failed"));
 #else
+# if HAVE_REALLOCARRAY
+	new_array = reallocarray(array, (size_t) size, element_size);
+# else
+	/* Do manual overflow detection */
 	size_t num_bytes = (size_t) size * element_size;
 	new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
 		realloc(array, num_bytes);
-#endif
+# endif
 	if (!new_array)
 		flexfatal (_("attempt to increase array size failed"));
-
+#endif
 	return new_array;



( run in 0.682 second using v1.01-cache-2.11-cpan-4991d5b9bd9 )