In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
[mono.git] / configure.in
index a029b39a7704ba2342b5a097d7272bd5caac34d3..4b6567d7dc5a943810e81fd73cb4511e2d1e585d 100644 (file)
@@ -161,7 +161,6 @@ case "$host" in
                fi
                libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
                LDFLAGS="$LDFLAGS -pthread"
-               libmono_ldflags="-pthread"
                need_link_unlink=yes
                AC_DEFINE(PTHREAD_POINTER_ID)
                libdl=
@@ -177,7 +176,6 @@ case "$host" in
                        CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
                fi
                libmono_cflags="-D_REENTRANT"
-               AC_CHECK_LIB(pthread, pthread_self, libmono_ldflags="-lpthread",,)
                libdl="-ldl"
                libgc_threads=pthreads
                AOT_SUPPORTED="yes"
@@ -237,18 +235,6 @@ case "$host" in
                dnl its gcc defaults to 64-bit mode.  They have also deprecated the usage of ucontext
                dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
                case "$host" in
-                       dnl MacPorts config.guess reports as this
-                       x86_64-*-darwin10*)
-                               BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
-                               CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
-                               CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
-                               CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
-                               CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
-                               CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
-                               CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
-                               CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
-                               CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
-                               ;;
                        dnl Snow Leopard config.guess reports as this
                        i*86-*-darwin10*)
                                BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
@@ -364,8 +350,14 @@ fi
 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h)
-AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h)
 
+AC_CHECK_HEADERS(sys/user.h, [], [],
+[
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+])
 
 AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
 if test x$have_zlib = xyes; then
@@ -486,6 +478,16 @@ mcs_topdir=$(cd "$srcdir/$mcsdir" && pwd)
 mcs_topdir_from_srcdir='$(top_builddir)'/$mcsdir
 fi
 
+# Convert mcs_topdir* paths to Windows syntax.
+if test x$cross_compiling$host_win32 = xnoyes; then
+  mcs_topdir=$(cygpath -m $mcs_topdir)
+  case $mcs_topdir_from_srcdir in
+    /cygdrive/*)
+       mcs_topdir_from_srcdir=$(cygpath -m $mcs_topdir_from_srcdir)
+       ;;
+  esac
+fi
+
 ## Maybe should also disable if mcsdir is invalid.  Let's punt the issue for now.
 AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
 
@@ -527,10 +529,7 @@ yes|sibling) libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la ;;
 esac
 AC_SUBST([libgdiplus_loc])
 
-PKG_PROG_PKG_CONFIG()
-if test "x$PKG_CONFIG" = "x"; then
-       AC_MSG_ERROR([You need to install pkg-config])
-fi
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
 pkg_config_path=
 AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Change pkg-config dir to custom dir],
@@ -546,8 +545,8 @@ AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Chan
 )
 
 AC_ARG_WITH([glib],
-       [  --with-glib=embedded|system    Choose glib API: system or embedded (default to system)],
-       [], [with_glib=system])
+       [  --with-glib=embedded|system    Choose glib API: system or embedded (default to embedded)],
+       [], [with_glib=embedded])
 
 eglib_dir=
 
@@ -565,8 +564,11 @@ embedded)
   eglib_dir=eglib
   ;;
 system)
-    echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
-    echo "cross_compiling=$cross_compiling"
+  if test "x$PKG_CONFIG" = "xno"; then
+    AC_MSG_ERROR([You need to install pkg-config])
+  fi
+  echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
+  echo "cross_compiling=$cross_compiling"
   BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
   BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
   
@@ -576,6 +578,9 @@ system)
   dnl
   dnl No, you will not replace this check with a pkg.m4 check
   dnl
+  if test "x$PKG_CONFIG" = "xno"; then
+    AC_MSG_ERROR([You need to install pkg-config])
+  fi
   if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
       GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
       GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
@@ -1533,7 +1538,7 @@ if test x$target_win32 = xno; then
        dnl *********************************
        dnl *** Checks for math functions ***
        dnl *********************************
-        LIBS="$LIBS -lm";
+       AC_SEARCH_LIBS(sqrtf, m)
        if test "x$has_broken_apple_cpp" != "xyes"; then
                AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
                        AC_TRY_LINK([#include <math.h>], 
@@ -1580,7 +1585,15 @@ if test x$target_win32 = xno; then
        dnl *** Checks for SIOCGIFCONF ***
        dnl ******************************
        AC_CHECK_HEADERS(sys/ioctl.h)
-       AC_CHECK_HEADERS(net/if.h)
+       AC_CHECK_HEADERS(net/if.h, [], [],
+          [
+          #ifdef HAVE_SYS_TYPES_H
+          # include <sys/types.h>
+          #endif
+          #ifdef HAVE_SYS_SOCKET_H
+          # include <sys/socket.h>
+          #endif
+          ])
        AC_MSG_CHECKING(for ifreq)
        AC_TRY_COMPILE([
                #include <stdio.h>
@@ -1644,6 +1657,12 @@ if test x$target_win32 = xno; then
        AC_CHECK_HEADERS(sys/xattr.h)
        AC_CHECK_HEADERS(sys/mman.h)
        AC_CHECK_HEADERS(sys/param.h)
+       AC_CHECK_HEADERS(sys/mount.h, [], [],
+               [
+               #ifdef HAVE_SYS_PARAM_H
+               # include <sys/param.h>
+               #endif
+               ])
        AC_CHECK_HEADERS(sys/mount.h)
        AC_CHECK_FUNCS(confstr)
        AC_CHECK_FUNCS(seekdir telldir)
@@ -2014,6 +2033,10 @@ if test "x$enable_llvm" = "xyes"; then
    llvm_version=`$LLVM_CONFIG --version`
    major_version=`echo $llvm_version | cut -c 1`
    minor_version=`echo $llvm_version | cut -c 3`
+   if echo $llvm_version | grep -q 'mono'; then
+         AC_DEFINE(LLVM_MONO_BRANCH, 1, [Whenever we are using the mono branch of LLVM])
+         LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MONO_BRANCH"       
+   fi
 
    AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
    AC_DEFINE_UNQUOTED(LLVM_MINOR_VERSION, $minor_version, [Minor version of LLVM libraries])
@@ -2358,10 +2381,14 @@ case "$host" in
     *-*-*freebsd*)
        LIBC="libc.so"
        INTL="libintl.so"
+       SQLITE="libsqlite.so"
+       SQLITE3="libsqlite3.so"
        ;;
     *-*-*openbsd*)
        LIBC="libc.so"
        INTL="libintl.so"
+        SQLITE="libsqlite.so"
+        SQLITE3="libsqlite3.so"
        ;;
     *-*-*linux*)
        AC_PATH_X