targetos=""
cpu=""
-cross_prefix=${cross_prefix-${CROSS_COMPILE}}
-cc="${CC-${cross_prefix}gcc}"
-
# default options
show_help="no"
exit_val=0
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
output_sym "CONFIG_SCHED_IDLE"
output_sym "CONFIG_TCP_NODELAY"
output_sym "CONFIG_TLS_THREAD"
+ output_sym "CONFIG_IPV6"
echo "CC=$CC" >> $config_host_mak
echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
exit 0
echo "sched_setaffinity(3 arg) $linux_3arg_affinity"
echo "sched_setaffinity(2 arg) $linux_2arg_affinity"
+##########################################
+# CPU_COUNT test
+cpu_count="no"
+cat > $TMPC << EOF
+#include <sched.h>
+int main(int argc, char **argv)
+{
+ cpu_set_t mask;
+ return CPU_COUNT(&mask);
+}
+EOF
+if compile_prog "" "" "cpu_count"; then
+ cpu_count="yes"
+fi
+echo "CPU_COUNT $cpu_count"
+
##########################################
# clock_gettime probe
clock_gettime="no"
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 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 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 "$ipv6" = "yes" ; then
output_sym "CONFIG_IPV6"
fi
+if test "$rbd" = "yes" ; then
+ output_sym "CONFIG_RBD"
+fi
+if test "$cpu_count" = "yes" ; then
+ output_sym "CONFIG_CPU_COUNT"
+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
echo "LIBS+=$LIBS" >> $config_host_mak
echo "CFLAGS+=$CFLAGS" >> $config_host_mak