summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac17
-rw-r--r--contrib/uuid/uuid_types.h.in (renamed from contrib/uuid/uuid_types.h)16
-rw-r--r--libglusterfs/src/Makefile.am5
3 files changed, 29 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index ac73858c0..d2b034dcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,6 +136,7 @@ AC_CONFIG_FILES([Makefile
extras/init.d/glusterd-SuSE
extras/benchmarking/Makefile
contrib/fuse-util/Makefile
+ contrib/uuid/uuid_types.h
xlators/nfs/Makefile
xlators/nfs/server/Makefile
xlators/nfs/server/src/Makefile
@@ -173,6 +174,22 @@ if test "x${LEX}" != "xflex" -a "x${FLEX}" != "xlex"; then
AC_MSG_ERROR([Flex or lex required to build glusterfs.])
fi
+dnl
+dnl Word sizes...
+dnl
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+SIZEOF_SHORT=$ac_cv_sizeof_short
+SIZEOF_INT=$ac_cv_sizeof_int
+SIZEOF_LONG=$ac_cv_sizeof_long
+SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
+AC_SUBST(SIZEOF_SHORT)
+AC_SUBST(SIZEOF_INT)
+AC_SUBST(SIZEOF_LONG)
+AC_SUBST(SIZEOF_LONG_LONG)
+
# YACC needs a check
AC_PROG_YACC
if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
diff --git a/contrib/uuid/uuid_types.h b/contrib/uuid/uuid_types.h.in
index 3e2290b46..f21ff4ee1 100644
--- a/contrib/uuid/uuid_types.h
+++ b/contrib/uuid/uuid_types.h.in
@@ -9,13 +9,13 @@
typedef unsigned char uint8_t;
typedef signed char int8_t;
-#if (4 == 8)
+#if (@SIZEOF_INT@ == 8)
typedef int int64_t;
typedef unsigned int uint64_t;
-#elif (8 == 8)
+#elif (@SIZEOF_LONG@ == 8)
typedef long int64_t;
typedef unsigned long uint64_t;
-#elif (8 == 8)
+#elif (@SIZEOF_LONG_LONG@ == 8)
#if defined(__GNUC__)
typedef __signed__ long long int64_t;
#else
@@ -24,23 +24,23 @@ typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#endif
-#if (4 == 2)
+#if (@SIZEOF_INT@ == 2)
typedef int int16_t;
typedef unsigned int uint16_t;
-#elif (2 == 2)
+#elif (@SIZEOF_SHORT@ == 2)
typedef short int16_t;
typedef unsigned short uint16_t;
#else
?==error: undefined 16 bit type
#endif
-#if (4 == 4)
+#if (@SIZEOF_INT@ == 4)
typedef int int32_t;
typedef unsigned int uint32_t;
-#elif (8 == 4)
+#elif (@SIZEOF_LONG@ == 4)
typedef long int32_t;
typedef unsigned long uint32_t;
-#elif (2 == 4)
+#elif (@SIZEOF_SHORT@ == 4)
typedef short int32_t;
typedef unsigned short uint32_t;
#else
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am
index 98be5b2d9..0af977433 100644
--- a/libglusterfs/src/Makefile.am
+++ b/libglusterfs/src/Makefile.am
@@ -11,6 +11,8 @@ libglusterfs_la_LIBADD = @LEXLIB@
lib_LTLIBRARIES = libglusterfs.la
+CONTRIB_BUILDDIR = $(top_builddir)/contrib
+
libglusterfs_la_SOURCES = dict.c graph.lex.c y.tab.c xlator.c logging.c \
hashfn.c defaults.c common-utils.c timer.c inode.c call-stub.c \
compat.c fd.c compat-errno.c event.c mem-pool.c gf-dirent.c syscall.c \
@@ -30,7 +32,7 @@ noinst_HEADERS = common-utils.h defaults.h dict.h glusterfs.h hashfn.h \
checksum.h daemon.h $(CONTRIBDIR)/md5/md5.h $(CONTRIBDIR)/rbtree/rb.h \
rbthash.h iatt.h latency.h mem-types.h $(CONTRIBDIR)/uuid/uuidd.h \
$(CONTRIBDIR)/uuid/uuid.h $(CONTRIBDIR)/uuid/uuidP.h \
- $(CONTRIBDIR)/uuid/uuid_types.h syncop.h graph-utils.h trie.h run.h \
+ $(CONTRIB_BUILDDIR)/uuid/uuid_types.h syncop.h graph-utils.h trie.h run.h \
options.h
EXTRA_DIST = graph.l graph.y
@@ -45,3 +47,4 @@ y.tab.c y.tab.h: graph.y
$(YACC) -d $(srcdir)/graph.y
CLEANFILES = graph.lex.c y.tab.c y.tab.h yacc.stamp
+CONFIG_CLEAN_FILES = $(CONTRIB_BUILDDIR)/uuid/uuid_types.h