targetos=""
cpu=""
-cross_prefix=${cross_prefix-${CROSS_COMPILE}}
-cc="${CC-${cross_prefix}gcc}"
-
# default options
show_help="no"
exit_val=0
case "$opt" in
--cpu=*) cpu="$optarg"
;;
+ # esx is cross compiled and cannot be detect through simple uname calls
+ --esx)
+ esx="yes"
+ ;;
--cc=*) CC="$optarg"
;;
--extra-cflags=*) CFLAGS="$CFLAGS $optarg"
;;
--disable-numa) disable_numa="yes"
;;
+ --disable-rbd) disable_rbd="yes"
+ ;;
+ --disable-gfapi) disable_gfapi="yes"
+ ;;
--help)
show_help="yes"
;;
echo "--cc= Specify compiler to use"
echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
echo "--build-32bit-win Enable 32-bit build on Windows"
+ echo "--esx Configure build options for esx"
echo "--enable-gfio Enable building of gtk gfio"
echo "--disable-numa Disable libnuma even if found"
exit $exit_val
fi
+cross_prefix=${cross_prefix-${CROSS_COMPILE}}
+cc="${CC-${cross_prefix}gcc}"
+
if check_define __ANDROID__ ; then
targetos="Android"
elif check_define __linux__ ; then
elif check_define __sun__ ; then
targetos='SunOS'
CFLAGS="$CFLAGS -D_REENTRANT"
+elif check_define _WIN32 ; then
+ targetos='CYGWIN'
else
targetos=`uname -s`
fi
# zlib probe
zlib="no"
cat > $TMPC <<EOF
-#include <zlib.h>
+#include <zlib2.h>
int main(void)
{
z_stream stream;
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
+#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
int main(int argc, char **argv)
fi
echo "IPv6 helpers $ipv6"
+##########################################
+# check for rbd
+rbd="no"
+cat > $TMPC << EOF
+#include <rbd/librbd.h>
+
+int main(int argc, char **argv)
+{
+
+ rados_t cluster;
+ rados_ioctx_t io_ctx;
+ const char pool[] = "rbd";
+
+ int major, minor, extra;
+ rbd_version(&major, &minor, &extra);
+
+ rados_ioctx_create(cluster, pool, &io_ctx);
+ return 0;
+}
+EOF
+if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
+ LIBS="-lrbd -lrados $LIBS"
+ rbd="yes"
+fi
+echo "Rados Block Device engine $rbd"
+
+##########################################
+# Check whether we have setvbuf
+setvbuf="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+ FILE *f = NULL;
+ char buf[80];
+ setvbuf(f, buf, _IOFBF, sizeof(buf));
+ return 0;
+}
+EOF
+if compile_prog "" "" "setvbuf"; then
+ setvbuf="yes"
+fi
+echo "setvbuf $setvbuf"
+
+# check for gfapi
+gfapi="no"
+cat > $TMPC << EOF
+#include <glusterfs/api/glfs.h>
+
+int main(int argc, char **argv)
+{
+
+ glfs_t *g = glfs_new("foo");
+
+ return 0;
+}
+EOF
+if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
+ LIBS="-lgfapi -lglusterfs $LIBS"
+ gfapi="yes"
+fi
+ echo "Gluster API engine $gfapi"
+
+##########################################
+# check for gfapi fadvise support
+gf_fadvise="no"
+cat > $TMPC << EOF
+#include <glusterfs/api/glfs.h>
+
+int main(int argc, char **argv)
+{
+ struct glfs_fd *fd;
+ int ret = glfs_fadvise(fd, 0, 0, 1);
+
+ return 0;
+}
+EOF
+
+if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
+ gf_fadvise="yes"
+fi
+echo "Gluster API use fadvise $gf_fadvise"
+
+##########################################
+# Check if we support stckf on s390
+s390_z196_facilities="no"
+cat > $TMPC << EOF
+#define STFLE_BITS_Z196 45 /* various z196 facilities ... */
+int main(int argc, char **argv)
+{
+ /* We want just 1 double word to be returned. */
+ register unsigned long reg0 asm("0") = 0;
+ unsigned long stfle_bits;
+ asm volatile(".machine push" "\n\t"
+ ".machine \"z9-109\"" "\n\t"
+ "stfle %0" "\n\t"
+ ".machine pop" "\n"
+ : "=QS" (stfle_bits), "+d" (reg0)
+ : : "cc");
+
+ if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
+ return 0;
+ else
+ return -1;
+}
+EOF
+if compile_prog "" "" "s390_z196_facilities"; then
+ $TMPE
+ if [[ $? -eq 0 ]]; then
+ s390_z196_facilities="yes"
+ fi
+fi
+echo "s390_z196_facilities $s390_z196_facilities"
#############################################################################
if test "$wordsize" = "64" ; then
if test "$gfio" = "yes" ; then
echo "CONFIG_GFIO=y" >> $config_host_mak
fi
+if test "$esx" = "yes" ; then
+ output_sym "CONFIG_ESX"
+ output_sym "CONFIG_NO_SHM"
+fi
if test "$sched_idle" = "yes" ; then
output_sym "CONFIG_SCHED_IDLE"
fi
if test "$ipv6" = "yes" ; then
output_sym "CONFIG_IPV6"
fi
+if test "$rbd" = "yes" ; then
+ output_sym "CONFIG_RBD"
+fi
+if test "$setvbuf" = "yes" ; then
+ output_sym "CONFIG_SETVBUF"
+fi
+if test "$s390_z196_facilities" = "yes" ; then
+ output_sym "CONFIG_S390_Z196_FACILITIES"
+ CFLAGS="$CFLAGS -march=z9-109"
+fi
+if test "$gfapi" = "yes" ; then
+ output_sym "CONFIG_GFAPI"
+fi
+if test "$gf_fadvise" = "yes" ; then
+ output_sym "CONFIG_GF_FADVISE"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "CFLAGS+=$CFLAGS" >> $config_host_mak