configure: add gettid() test
[fio.git] / configure
index c7a7c0ae3fd07b09c765cda2b83fa04e79c489ea..ee421663f396acfe7b6fa473354baf5103ab2a78 100755 (executable)
--- a/configure
+++ b/configure
@@ -307,6 +307,10 @@ AIX|OpenBSD|NetBSD)
     force_no_lex_o="yes"
   fi
   ;;
+FreeBSD)
+  CFLAGS="$CFLAGS -I/usr/local/include"
+  LDFLAGS="$LDFLAGS -L/usr/local/lib"
+  ;;
 Darwin)
   # on Leopard most of the system is 32-bit, so we have to ask the kernel if
   # we can run 64-bit userspace code.
@@ -2370,6 +2374,21 @@ EOF
 fi
 print_config "MADV_HUGEPAGE" "$thp"
 
+##########################################
+# check for gettid()
+gettid="no"
+cat > $TMPC << EOF
+#include <unistd.h>
+int main(int argc, char **argv)
+{
+  return gettid();
+}
+EOF
+if compile_prog "" "" "gettid"; then
+  gettid="yes"
+fi
+print_config "gettid" "$gettid"
+
 #############################################################################
 
 if test "$wordsize" = "64" ; then
@@ -2641,6 +2660,9 @@ fi
 if test "$__kernel_rwf_t" = "yes"; then
   output_sym "CONFIG_HAVE_KERNEL_RWF_T"
 fi
+if test "$gettid" = "yes"; then
+  output_sym "CONFIG_HAVE_GETTID"
+fi
 if test "$fallthrough" = "yes"; then
   CFLAGS="$CFLAGS -Wimplicit-fallthrough"
 fi