summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2017-03-04 17:01:56 +0100
committerJ William Piggott2017-03-04 17:01:56 +0100
commit30d7f61f4fc1967190a734e2d62696d546fb6378 (patch)
tree8ad79444b545699900730b2da267e8a587fb2d4d
parentlib: add parse-date.y (diff)
downloadkernel-qcow2-util-linux-30d7f61f4fc1967190a734e2d62696d546fb6378.tar.gz
kernel-qcow2-util-linux-30d7f61f4fc1967190a734e2d62696d546fb6378.tar.xz
kernel-qcow2-util-linux-30d7f61f4fc1967190a734e2d62696d546fb6378.zip
build-sys: add parse-date.y
* 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>
-rw-r--r--.gitignore1
-rwxr-xr-xautogen.sh20
-rw-r--r--configure.ac2
-rw-r--r--lib/.gitignore1
-rw-r--r--lib/Makemodule.am1
5 files changed, 24 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 8630feacf..6c87c6be4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,7 @@ test-suite.log
tests/run.sh.log
tests/run.sh.trs
update.log
+ylwrap
#
# binaries
diff --git a/autogen.sh b/autogen.sh
index 116885bc7..04b6cb459 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -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
diff --git a/configure.ac b/configure.ac
index 8933afa6f..17c3b23e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
index 000000000..070c244be
--- /dev/null
+++ b/lib/.gitignore
@@ -0,0 +1 @@
+parse-date.c
diff --git a/lib/Makemodule.am b/lib/Makemodule.am
index d20a9aca2..358b85aee 100644
--- a/lib/Makemodule.am
+++ b/lib/Makemodule.am
@@ -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 \