]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add parse-date.y
authorKarel Zak <kzak@redhat.com>
Sat, 4 Mar 2017 16:01:56 +0000 (11:01 -0500)
committerJ William Piggott <elseifthen@gmx.com>
Sat, 4 Mar 2017 16:01:56 +0000 (11:01 -0500)
* add lib/parse-date.y to build system
* add necessary autotools stuff to generate .c on the fly
  (autotools are smart enough to add generated file to tarball)
* check for bison version by ./autogen.sh
* add non-wanted junk to .gitignore

With some modification by J William Piggott with regard to
moving the parse-date API into timeutils.h

Signed-off-by: J William Piggott <elseifthen@gmx.com>
.gitignore
autogen.sh
configure.ac
lib/.gitignore [new file with mode: 0644]
lib/Makemodule.am

index 8630feacf4c8749007b052350dfad21917d451ca..6c87c6be42fa37b9508591a399efa63818e59272 100644 (file)
@@ -55,6 +55,7 @@ test-suite.log
 tests/run.sh.log
 tests/run.sh.trs
 update.log
+ylwrap
 
 #
 # binaries
index 116885bc77144d322019a8ed47d1ba0299ecb024..04b6cb45938eb9298f33cb11d4faf67bd5915875 100755 (executable)
@@ -67,6 +67,25 @@ test -f sys-utils/mount.c || {
        DIE=1
 }
 
+if ! (bison --version) < /dev/null > /dev/null 2>&1; then
+       echo
+       echo "You must have bison installed to build the util-linux."
+       echo
+       DIE=1
+else
+       lexver=$(bison --version | awk '/bison \(GNU Bison\)/ { print $4 }')
+       case "$lexver" in
+               [2-9].*)
+                       ;;
+               *)
+                       echo
+                       echo "You must have bison version >= 2.x, but you have $lexver."
+                       echo
+                       DIE=1
+                       ;;
+       esac
+fi
+
 LIBTOOLIZE=libtoolize
 case `uname` in Darwin*) LIBTOOLIZE=glibtoolize ;; esac
 if ! ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
@@ -104,6 +123,7 @@ echo "   autoconf:   $(autoconf --version | head -1)"
 echo "   autoheader: $(autoheader --version | head -1)"
 echo "   automake:   $(automake --version | head -1)"
 echo "   libtoolize: $($LIBTOOLIZE --version | head -1)"
+echo "   bison:      $(bison --version | head -1)"
 
 rm -rf autom4te.cache
 
index 8933afa6f411393a9d68c3374ed4731942fe6626..17c3b23e7f920a130d7a220f442e28fe15c02180 100644 (file)
@@ -99,6 +99,7 @@ AC_SUBST([usrlib_execdir])
 AM_PROG_CC_C_O
 AC_PROG_MKDIR_P
 AC_PROG_CC_STDC
+AC_PROG_YACC
 AC_CANONICAL_HOST
 AC_C_CONST
 AC_C_VOLATILE
@@ -153,7 +154,6 @@ PKG_PROG_PKG_CONFIG
 GTK_DOC_CHECK([1.10])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
-
 linux_os=no
 bsd_os=no
 AS_CASE([${host_os}],
diff --git a/lib/.gitignore b/lib/.gitignore
new file mode 100644 (file)
index 0000000..070c244
--- /dev/null
@@ -0,0 +1 @@
+parse-date.c
index d20a9aca260fd5e6b712a2fc4c05fea9704fd258..358b85aee060dd9b451bfea750a3156fcc053bc2 100644 (file)
@@ -16,6 +16,7 @@ libcommon_la_SOURCES = \
        lib/mbsedit.c\
        lib/md5.c \
        lib/pager.c \
+       lib/parse-date.y \
        lib/path.c \
        lib/randutils.c \
        lib/setproctitle.c \