* Makefile.am (EXTRA_DIST_M4): add prog_{lex,yacc}.m4 to distro.
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 11 Sep 2005 19:06:40 +0000 (19:06 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 11 Sep 2005 19:06:40 +0000 (19:06 +0000)
* configure.in: use new macros AMU_PROG_YACC and AMU_PROG_LEX.

* m4/macros/prog_yacc.m4: new macro to check if bison/yacc/byacc
exist, but exist with an error if none found.

* m4/macros/prog_lex.m4: new macro to check if f/lex exist, but
exit with an error if not found (am-utils requires f/lex).

ChangeLog
Makefile.am
NEWS
configure.in
m4/macros/prog_lex.m4 [new file with mode: 0644]
m4/macros/prog_yacc.m4 [new file with mode: 0644]

index 7702cdecc5824cf6b1f481b04b97b10f699b4d56..ea77a805872af3f48ff0b9601743fd6e2416194d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-09-11  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * Makefile.am (EXTRA_DIST_M4): add prog_{lex,yacc}.m4 to distro.
+
+       * configure.in: use new macros AMU_PROG_YACC and AMU_PROG_LEX.
+
+       * m4/macros/prog_yacc.m4: new macro to check if bison/yacc/byacc
+       exist, but exist with an error if none found.
+
+       * m4/macros/prog_lex.m4: new macro to check if f/lex exist, but
+       exit with an error if not found (am-utils requires f/lex).
+
 2005-09-07  Erez Zadok  <ezk@cs.sunysb.edu>
 
        * minor new port: powerpc-apple-darwin8.2.0.
index 9fbee098f39e72f99e4884c49896aa223fd3bf7d..1e9513921c940b8717cea961403106f0829248bc 100644 (file)
@@ -108,6 +108,8 @@ EXTRA_DIST_M4 =                             \
        m4/macros/package_bugreport.m4                  \
        m4/macros/package_name.m4                       \
        m4/macros/package_version.m4                    \
+       m4/macros/prog_lex.m4                           \
+       m4/macros/prog_yacc.m4                          \
        m4/macros/save_state.m4                         \
        m4/macros/struct_field_nfs_fh.m4                \
        m4/macros/struct_mntent.m4                      \
diff --git a/NEWS b/NEWS
index b01ca15bbaa32ff438229acb0dde2b3f64c4a9a1..6f7581f07ff7d1b5d650753029fe673295f88f8a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@
 XXX: Dan, document sun_map_syntax flag in more detail in am-utils.texi and
 (more briefly) in amd.conf.5.  And in this NEWS file, also briefly.
 
+- Bugs fixed:
+       * abort with an error if yacc/lex programs not found
+
 Amd now understands a new log_option called "defaults" which is synonymous
 with "fatal,error,user,warning,info" (and is also what logging happens by
 default).
index effcf08b0db8785e2c2cf623e3c77fbc00a39874..7068a7c50392dfad0290f2520ca3e5e3d9c79509 100644 (file)
@@ -55,7 +55,7 @@ AH_BOTTOM([
 dnl
 dnl AC_CONFIG_AUX_DIR(m4)
 AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.112 $)
+AC_REVISION($Revision: 1.113 $)
 AC_COPYRIGHT([Copyright (c) 1997-2005 Erez Zadok])
 dnl find out system type
 AC_MSG_NOTICE(*** SYSTEM TYPES ***)
@@ -189,8 +189,10 @@ AC_PROG_INSTALL
 dnl the next two are run or supported natively by libtool
 dnl AC_PROG_LN_S
 dnl AC_PROG_RANLIB
-AC_PROG_YACC
-AM_PROG_LEX
+dnl AC_PROG_YACC
+AMU_PROG_YACC
+dnl AM_PROG_LEX
+AMU_PROG_LEX
 
 dnl ======================================================================
 dnl Generic Program Checks
diff --git a/m4/macros/prog_lex.m4 b/m4/macros/prog_lex.m4
new file mode 100644 (file)
index 0000000..43da78a
--- /dev/null
@@ -0,0 +1,14 @@
+dnl find f/lex, but error if none found
+AC_DEFUN_ONCE([AMU_PROG_LEX],
+[AC_CHECK_PROGS(LEX, flex lex, :)
+if test -z "$LEXLIB"
+then
+  AC_CHECK_LIB(fl, yywrap, LEXLIB="-lfl",
+    [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")])
+fi
+AC_SUBST(LEXLIB)
+if test "x$LEX" != "x:"; then
+  _AC_PROG_LEX_YYTEXT_DECL
+else
+  AC_MSG_ERROR([cannot find flex/lex -- needed for am-utils])
+fi])
diff --git a/m4/macros/prog_yacc.m4 b/m4/macros/prog_yacc.m4
new file mode 100644 (file)
index 0000000..666cdef
--- /dev/null
@@ -0,0 +1,6 @@
+dnl find bison/yacc, but error if none found
+AC_DEFUN([AMU_PROG_YACC],
+[AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
+if test "x$YACC" = "x:"; then
+  AC_MSG_ERROR([cannot find bison/yacc/byacc -- needed for am-utils])
+fi])