summaryrefslogtreecommitdiffstats
path: root/tools/getiversion
diff options
context:
space:
mode:
Diffstat (limited to 'tools/getiversion')
-rw-r--r--tools/getiversion/Makefile.am12
-rw-r--r--tools/getiversion/getiversion.c13
2 files changed, 24 insertions, 1 deletions
diff --git a/tools/getiversion/Makefile.am b/tools/getiversion/Makefile.am
new file mode 100644
index 0000000..7d7172e
--- /dev/null
+++ b/tools/getiversion/Makefile.am
@@ -0,0 +1,12 @@
+## Process this file with automake to produce Makefile.in
+
+CC=$(CC_FOR_BUILD)
+LIBTOOL = @LIBTOOL@ --tag=CC
+
+noinst_PROGRAMS = getiversion
+getiversion_SOURCES = getiversion.c
+getiversion_CFLAGS=$(CFLAGS_FOR_BUILD)
+getiversion_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -I$(top_srcdir)/support/include
+getiversion_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/tools/getiversion/getiversion.c b/tools/getiversion/getiversion.c
index e9cb391..fdaf102 100644
--- a/tools/getiversion/getiversion.c
+++ b/tools/getiversion/getiversion.c
@@ -4,11 +4,22 @@
* Get version number for an inode on an ext2 file system.
*/
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+
#include <stdio.h>
#include <sys/fs/ext2fs.h>