diff --git a/configure.ac b/configure.ac
index fbcdf7f45d10a85c03c083c6b4be07d07d4aa9ce..efb6e22bc2944a7627f5cb237a5fdaa0adb142d2 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
dnl Check for programs
ncurses=auto
fi
+AC_CANONICAL_HOST
-dnl
-dnl Check for libraries
-dnl
+case "$host_os" in
+mingw32* | windows*)
+ LIBS="$LIBS -lws2_32"
+ ;;
+*)
+ AC_CHECK_FUNC([socket],
+ [],
+ [AC_CHECK_LIB([socket],[socket],[LIBS="$LIBS -lsocket"],
+ [AC_MSG_ERROR(No UNIX socket API found)])
+ ])
-dnl Try to find the socket functions
-AC_CHECK_FUNC([socket],
- [],
- [AC_CHECK_LIB([socket],[socket],[LIBS="$LIBS -lsocket"],
- [AC_MSG_ERROR(No UNIX socket API found)])
- ])
-
-dnl Try to find the gethostbyname functions
-AC_CHECK_FUNC([gethostbyname],
- [],
- [AC_CHECK_LIB([nsl],[gethostbyname],[LIBS="$LIBS -lnsl"],
- [AC_MSG_ERROR(No UNIX gethostbyname API found)])
- ])
+ AC_CHECK_FUNC([gethostbyname],
+ [],
+ [AC_CHECK_LIB([nsl],[gethostbyname],[LIBS="$LIBS -lnsl"],
+ [AC_MSG_ERROR(No UNIX gethostbyname API found)])
+ ])
+esac
dnl wide character support
AM_CONDITIONAL(ENABLE_HELP_SCREEN, test x$enable_help_screen = xyes)
-dnl Optional screen - browse screen
-#AC_MSG_CHECKING([whether to include the browse screen])r
-#AC_ARG_ENABLE([browse-screen],
-# AS_HELP_STRING([--enable-browse-screen],
-# [Enable the browse screen @<:@default=yes@:>@]),,
-# [enable_browse_screen=yes])
-#AC_MSG_RESULT([$enable_browse_screen])
-#if test "x$enable_browse_screen" = "xyes" ; then
-# AC_DEFINE(ENABLE_BROWSE_SCREEN, 1, [Enable the browse screen])
-#fi
-
dnl Optional - curses getmouse support
AC_MSG_CHECKING([whether to include mouse support])
AC_ARG_ENABLE([mouse],