2005-06-13 Martin Baulig <martin@ximian.com>
[mono.git] / configure.in
index 8531d428198f1fd907093cc312863f8199e045ad..0617fe8721324fd5d38ba5bf3c4e3d672582b1f6 100644 (file)
@@ -223,6 +223,7 @@ AC_CHECK_TOOL(CC, gcc, gcc)
 AC_PROG_CC
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
+AC_PROG_AWK
 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
 : ${CCAS='$(CC)'}
 # Set ASFLAGS if not already set.
@@ -603,7 +604,7 @@ if test x$platform_win32 = xno; then
        # potential compiler bugs.  Defines LARGE_FILE_SUPPORT, adds $1 to
        # CPPFLAGS and sets $large_offt to yes if the test succeeds
        large_offt=no
-       AC_DEFUN(LARGE_FILES, [
+       AC_DEFUN([LARGE_FILES], [
                large_CPPFLAGS=$CPPFLAGS
                CPPFLAGS="$CPPFLAGS $1"
                AC_TRY_RUN([
@@ -1126,6 +1127,28 @@ if test x$platform_win32 = xno; then
                AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
        fi
 
+       dnl ******************************
+       dnl *** Checks for SIOCGIFCONF ***
+       dnl ******************************
+       AC_CHECK_HEADERS(sys/ioctl.h)
+       AC_CHECK_HEADERS(net/if.h)
+       AC_MSG_CHECKING(for ifreq)
+       AC_TRY_COMPILE([
+               #include <sys/ioctl.h>
+               #include <net/if.h>
+               ], [
+               struct ifconf ifc;
+               struct ifreq *ifr;
+               void *x;
+               ifc.ifc_len = 0;
+               ifc.ifc_buf = NULL;
+               x = (void *) &ifr->ifr_addr;
+               ],[
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Can get interface list])
+               ], [
+                       AC_MSG_RESULT(no)
+               ])
        dnl **********************************
        dnl *** Checks for MonoPosixHelper ***
        dnl **********************************
@@ -1141,6 +1164,8 @@ if test x$platform_win32 = xno; then
        AC_CHECK_FUNCS(fgetpwent)
        AC_CHECK_FUNCS(fgetpwent)
        AC_CHECK_FUNCS(getfsstat)
+       AC_CHECK_FUNCS(mremap)
+       AC_CHECK_FUNCS(remap_file_pages)
        AC_CHECK_FUNCS(posix_fadvise)
        AC_CHECK_FUNCS(posix_fallocate)
        AC_CHECK_FUNCS(posix_madvise)
@@ -1333,7 +1358,7 @@ LIBC="libc.so.6"
 INTL="libc.so.6"
 SQLITE="libsqlite.so.0"
 SQLITE3="libsqlite3.so.0"
-X11="libX11.so.6.2"
+X11="libX11.so"
 
 jit_wanted=false
 interp_wanted=false
@@ -1511,6 +1536,24 @@ case "$host" in
        INTL="libintl.so"
        ;;
 esac
+
+if test "x$X11" = "xlibX11.so"; then
+       AC_PATH_X
+       AC_PATH_PROG(OBJDUMP, objdump, no)
+       if test "x$no_x" != "xyes"; then
+               if test "x$OBJDUMP" != xno; then
+                       AC_MSG_CHECKING(for the soname of libX11.so)
+                       X11=$($OBJDUMP -p  $x_libraries/libX11.so | $AWK '/SONAME/ {print $2}')
+                       AC_MSG_RESULT($X11)
+               else
+                       AC_MSG_WARN([Could not find objdump. WinForms will not work if you install this mono on a box without the X -devel package.]);
+               fi
+       
+       else
+               AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
+       fi
+fi
+
 AC_SUBST(libsuffix)
 
 if test "x$TARGET" != "xAMD64"; then
@@ -1673,6 +1716,8 @@ Makefile
 mint.pc
 mono.pc
 scripts/mono-nunit.pc
+scripts/mono-find-provides
+scripts/mono-find-requires
 mono/Makefile
 mono/utils/Makefile
 mono/metadata/Makefile
@@ -1713,7 +1758,6 @@ data/net_2_0/Makefile
 samples/Makefile
 support/Makefile
 data/config
-mono.spec
 tools/Makefile
 tools/locale-builder/Makefile
 runtime/Makefile