Navigation Menu

Skip to content

Commit

Permalink
Add first prototype for abstracting Gluster FS API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 25, 2014
1 parent c05f55d commit 5b0a367
Show file tree
Hide file tree
Showing 7 changed files with 715 additions and 3 deletions.
62 changes: 62 additions & 0 deletions autoconf/configure.in
Expand Up @@ -3385,6 +3385,67 @@ if test x$support_scsi_crypto = xyes; then
fi
AC_SUBST(CAM_LIBS)

dnl
dnl Check for GlusterFS via gfapi.
dnl
GLUSTER_LIBS="-lgfapi"
GLUSTER_INC=""
have_glusterfs=no
AC_ARG_WITH(glusterfs,
AC_HELP_STRING([--with-glusterfs@<:@=DIR@:>@], [Directory holding GLUSTERFS includes/libs]),
with_glusterfs_directory=$withval
)

if test "x${with_glusterfs_directory}" != "xyes" && test x"${with_glusterfs_directory}" != "x"; then
#
# Make sure the $with_glusterfs_directory also makes sense
#
if test -d "${with_glusterfs_directory}/lib" -a -d "${with_glusterfs_directory}/include"; then
GLUSTER_LIBS="-L${with_glusterfs_directory}/lib ${GLUSTER_LIBS}"
GLUSTER_INC="-I${with_glusterfs_directory}/include ${GLUSTER_INC}"
fi
else
GLUSTER_INC="-I/usr/include/glusterfs"
fi

saved_LIBS="${LIBS}"
saved_CFLAGS="${CFLAGS}"
saved_CPPFLAGS="${CPPFLAGS}"
LIBS="${saved_LIBS} ${GLUSTER_LIBS}"
CFLAGS="${saved_CFLAGS} ${GLUSTER_INC}"
CPPFLAGS="${saved_CPPFLAGS} ${GLUSTER_INC}"

AC_CHECK_HEADER(api/glfs.h)

AC_MSG_CHECKING(for glfs_init in gfapi library)
AC_TRY_LINK(
[
#include <api/glfs.h>
], [
glfs_new("volumename");
], [
AC_MSG_RESULT(yes)
have_glusterfs="yes"
], [
AC_MSG_RESULT(no)
have_glusterfs="no"
]
)

LIBS="${saved_LIBS}"
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"

if test "x${have_glusterfs}" = "xyes"; then
AC_DEFINE(HAVE_GFAPI, 1, [Define to 1 if you have gfapi lib])
else
GLUSTER_LIBS=""
GLUSTER_INC=""
fi

AC_SUBST(GLUSTER_INC)
AC_SUBST(GLUSTER_LIBS)

dnl
dnl Check for pthread libraries
dnl
Expand Down Expand Up @@ -3980,6 +4041,7 @@ Configuration on `date`:
ACL support: ${have_acl}
XATTR support: ${have_xattr}
SCSI Crypto support: ${have_scsi_crypto}
GLUSTERFS support: ${have_glusterfs}
Python support: ${support_python} ${PYTHON_LIBS}
systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
Batch insert enabled: ${batch_insert_db_backends}
Expand Down
13 changes: 12 additions & 1 deletion src/stored/Makefile.in
Expand Up @@ -27,7 +27,8 @@ GNUTLS_LIBS_NONSHARED = @GNUTLS_LIBS_NONSHARED@
first_rule: all
dummy:

DEVICE_API_SRCS = unix_file_device.c \
DEVICE_API_SRCS = gfapi_device.c \
unix_file_device.c \
unix_tape_device.c \
vtape.c

Expand Down Expand Up @@ -80,6 +81,8 @@ BEXTRACT_LIBS += @ZLIB_LIBS_NONSHARED@
BEXTRACT_LIBS += @LZO_LIBS_NONSHARED@
BEXTRACT_LIBS += @FASTLZ_LIBS_NONSHARED@

GLUSTER_INC = @GLUSTER_INC@
LIBS += @GLUSTER_LIBS@
INCLUDES += -I$(srcdir) -I$(basedir) -I$(basedir)/include

DEBUG = @DEBUG@
Expand All @@ -99,6 +102,14 @@ NDMP_LIBS = @NDMP_LIBS@
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<
#-------------------------------------------------------------------------

dev.o: dev.c
@echo "Compiling $<"
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(GLUSTER_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

gfapi_device.o: gfapi_device.c
@echo "Compiling $<"
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(GLUSTER_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

all: Makefile bareos-sd @STATIC_SD@ bls bextract bscan btape bcopy
@echo "===== Make of stored is good ===="
@echo " "
Expand Down

0 comments on commit 5b0a367

Please sign in to comment.