configure.in
changeset 347 56ce50a62241
parent 331 822f78a88aba
child 351 bc4fa7896225
--- a/configure.in	Wed Jul 17 16:05:52 2002 +0000
+++ b/configure.in	Wed Jul 17 23:25:18 2002 +0000
@@ -226,6 +226,17 @@
   AC_MSG_RESULT([$this_is_macosx])
 fi
 
+this_is_freebsd=no
+if test x$we_have_sed = xyes; then
+  AC_MSG_CHECKING([if this is FreeBSD])
+  x=`echo $build_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
+  if test x$x = xfreebsd; then
+    this_is_freebsd=yes
+  fi
+
+  AC_MSG_RESULT([$this_is_freebsd])
+fi
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdlib.h string.h])
@@ -242,6 +253,13 @@
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS([memset strrchr])
 
+CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
+LDFLAGS="$LDFLAGS -no-undefined"
+
+if test x$this_is_freebsd = x$yes; then
+  LDFLAGS="$LDFLAGS -pthread"
+fi
+
 dnl Add Makefile conditionals
 AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
 AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
@@ -249,8 +267,6 @@
 AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
 AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)
 
-LDFLAGS="$LDFLAGS -no-undefined"
-
 AC_OUTPUT([
 Makefile
 archivers/Makefile