summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-05 20:23:20 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-07 13:29:05 +0530
commit23b12455796ec453ca35e94ab49e7629d7f9aced (patch)
tree0d69ce51ad68b56a753fa8e4a021bec2a3cc5f4a /configure.ac
parentbbcbaf494ad406ceea4f0175b91cf67966d32a27 (diff)
gluster-block: migrate build to libtoolz and create rpm
Till now we had simple makefile for checking dependencies and building. Using libtoolz will give more control on dependency checks and flexibility. This patch also introduce rpm build feature. Compiling: $ ./autogen.sh $ ./configure $ make -j $ make install Building RPMS: $ make rpms Running: $ systemctl start gluster-blockd.service Using CLI: $ gluster-block help Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac75
1 files changed, 75 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e18b3e2
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,75 @@
+dnl Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
+dnl This file is part of gluster-block.
+dnl
+dnl This file is licensed to you under your choice of the GNU Lesser
+dnl General Public License, version 3 or any later version (LGPLv3 or
+dnl later), or the GNU General Public License, version 2 (GPLv2), in all
+dnl cases as published by the Free Software Foundation.
+
+
+AC_PREREQ([2.69])
+AC_INIT([glusterfs-block],
+ m4_esyscmd(echo -n `git describe --always --tags`),
+ [pkalever@redhat.com],,
+ [https://github.com/pkalever/gluster-block.git])
+
+AC_SUBST([PACKAGE_RELEASE], 1)
+
+AC_ARG_WITH(systemddir,
+ [ --with-systemddir=DIR systemd service files in DIR @<:@PREFIX/lib/systemd/system@:>@],
+ [systemddir=$withval],
+ [systemddir='${prefix}/lib/systemd/system'])
+AC_SUBST(systemddir)
+AM_CONDITIONAL([USE_SYSTEMD], test [ -d '/usr/lib/systemd/system' ])
+
+AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([gluster-block.spec
+ Makefile
+ rpc/Makefile
+ cli/Makefile
+ daemon/Makefile
+ utils/Makefile
+ systemd/Makefile
+ systemd/gluster-blockd.service])
+AC_CONFIG_MACRO_DIR([m4])
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
+AM_MAINTAINER_MODE
+
+# Configure libtool
+LT_INIT
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for header files.
+AC_CHECK_HEADERS([memory.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])
+
+# Checks for libraries.
+AC_CHECK_LIB([gfapi], [glfs_init])
+PKG_CHECK_MODULES([GLFS], [glusterfs-api >= 3])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([bzero gethostbyname memset socket strchr strdup strerror])
+AC_OUTPUT
+
+cat <<EOF
+
+------------------ Summary ------------------
+ $PACKAGE_NAME version $PACKAGE_VERSION
+ Prefix.........: $prefix
+ C Compiler.....: $CC $CFLAGS $CPPFLAGS
+ Linker.........: $LD $MORE_LDFLAGS $LDFLAGS $LIBS
+---------------------------------------------
+
+Check the above options and compile with:
+ ${MAKE-make}
+
+EOF