simple is-lex-flex autoconf test
authorDerrick Brashear <shadow@dementia.org>
Tue, 13 Jul 2010 18:31:41 +0000 (14:31 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 14 Jul 2010 02:27:46 +0000 (19:27 -0700)
if we're flex, we may need to be lex-compatible. engage
it if we're flex

Change-Id: If9a39ca0bce3f4a68b742d1e8f0c679d3f79896e
Change-Id: I7f245d579bcc46fdd0aa7202bbd45f3f9f647ebc
Reviewed-on: http://gerrit.openafs.org/2399
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/cf/flex.m4 [new file with mode: 0644]

index 5459b3c..c30d99d 100644 (file)
@@ -271,6 +271,8 @@ AC_PROG_LN_S
 AC_PROG_RANLIB
 AC_PROG_YACC
 AM_PROG_LEX
+dnl if we are flex, be lex-compatible
+OPENAFS_LEX_IS_FLEX([AC_SUBST([LEX], ["$LEX -l"])])
 
 OPENAFS_CHECK_BIGENDIAN
 OPENAFS_PRINTF_TAKES_Z_LEN
diff --git a/src/cf/flex.m4 b/src/cf/flex.m4
new file mode 100644 (file)
index 0000000..d552c18
--- /dev/null
@@ -0,0 +1,8 @@
+# OPENAFS_LEX_IS_FLEX([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
+AC_DEFUN([OPENAFS_LEX_IS_FLEX],
+[AC_MSG_CHECKING([if lex is flex])
+ AS_IF([echo '' | $LEX --version >&AS_MESSAGE_LOG_FD],
+    [AC_MSG_RESULT([yes])
+     $1],
+    [AC_MSG_RESULT([no])
+     $2])])