Add DLL building support to autotools scripts
[deb_shairplay.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.61)
5 AC_INIT([shairplay], [0.9.0], [juhovh@iki.fi])
6 AC_CONFIG_MACRO_DIR([m4])
7 AC_CONFIG_SRCDIR([src/shairplay.c])
8 AC_CONFIG_HEADER([config.h])
9 AM_INIT_AUTOMAKE([foreign])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_LIBTOOL_WIN32_DLL
14 AC_PROG_LIBTOOL
15
16 # Checks for libraries.
17 LT_LIB_DLLOAD
18 LT_LIB_M
19
20 # Checks for header files.
21 AC_HEADER_STDC
22
23 # Checks for typedefs, structures, and compiler characteristics.
24
25 # Checks for library functions.
26 AC_CHECK_LIB([socket],[connect])
27 AC_CHECK_LIB([pthread],[pthread_create])
28
29
30 # Custom check for os, similar to webkit
31 AC_MSG_CHECKING([for native Win32])
32 case "$host" in
33 *-*-mingw*)
34 os_win32=yes
35 ;;
36 *)
37 os_win32=no
38 ;;
39 esac
40 AC_MSG_RESULT([$os_win32])
41
42 case "$host" in
43 *-*-linux*)
44 os_linux=yes
45 ;;
46 *-*-freebsd*)
47 os_freebsd=yes
48 ;;
49 *-*-darwin*)
50 os_darwin=yes
51 ;;
52 esac
53
54 case "$host_os" in
55 gnu* | linux* | k*bsd*-gnu)
56 os_gnu=yes
57 ;;
58 *)
59 os_gnu=no
60 ;;
61 esac
62
63 # OS conditionals
64 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
65 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
66 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
67 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
68 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
69
70 # Custom check for libao
71 PKG_CHECK_MODULES([libao], [ao >= 1.1.0], [have_libao=1], [have_libao=0])
72 AM_CONDITIONAL([HAVE_LIBAO], [test "$have_libao" -eq 1])
73
74
75
76 AC_CONFIG_FILES(
77 [Makefile]
78 [include/Makefile]
79 [src/Makefile]
80 [src/lib/Makefile]
81 [src/lib/alac/Makefile]
82 [src/lib/crypto/Makefile]
83 )
84 AC_OUTPUT