Code

main.c: Don't try to compile signal support on win32
[ncmpc.git] / configure.ac
index e6c8ee99bbb4fdafc6e814a7b75321ca7905aa11..efb6e22bc2944a7627f5cb237a5fdaa0adb142d2 100644 (file)
@@ -3,7 +3,7 @@ AC_INIT(ncmpc, 0.20~git, max@duempel.org)
 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
@@ -43,24 +43,25 @@ else
     ncurses=auto
 fi
 
+AC_CANONICAL_HOST
 
-dnl
-dnl Check for libraries
-dnl
-
-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)])
-              ])
+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 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
@@ -230,17 +231,6 @@ fi
 
 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], 
@@ -351,6 +341,8 @@ if test "x$enable_outputs_screen" = "xyes" ; then
 fi
 
 AM_CONDITIONAL(ENABLE_OUTPUTS_SCREEN, test x$enable_outputs_screen = xyes)
+AC_MSG_RESULT([$enable_outputs_screen])
+
 
 
 dnl
@@ -363,7 +355,7 @@ AC_ARG_ENABLE(werror,
        enable_werror=no)
 
 if test "x$enable_werror" = xyes; then
-       AM_CFLAGS="$AM_CFLAGS -Werror"
+       CHECK_CFLAG([-Werror])
 fi
 
 AC_ARG_ENABLE(debug,