Initial commit
[openspeak.git] / configure.in
blobfc263ba11d8654bb76a8655f4758d2487f2623d2
1 dnl configure.ac file for the openspeak project
3 AC_PREREQ(2.61)
4 AC_INIT([openspeak], [0.1], [bugs@openspeak-project.org])
6 AC_CANONICAL_TARGET
8 AC_CONFIG_SRCDIR([client/src/ClientApplication.cpp])
9 AC_CONFIG_HEADER([config.h])
11 AM_INIT_AUTOMAKE([openspeak], [0.1])
13 dnl Check what we need to build
14 OS_BUILD_WHAT
16 dnl Find and check the C and C++ compiler
17 AC_PROG_CC
18 AC_PROG_CXX
19 AC_LANG_C
20 AC_LANG_CPLUSPLUS
21 AC_PROG_RANLIB
22 AC_PROG_INSTALL
24 AC_PROG_MAKE_SET
26 dnl check some std/stl stuff
27 AC_CHECK_LIB(stdc++, main,, AC_MSG_ERROR(openSpeak requires libstdc++))
28 AC_CHECK_HEADERS(string vector map queue,,AC_MSG_ERROR(STL classes might be missing))
30 dnl Checks for header files.
31 AC_HEADER_STDC
32 AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h])
34 dnl Checks for typedefs, structures, and compiler characteristics.
35 AC_HEADER_STDBOOL
36 AC_C_CONST
37 AC_C_INLINE
38 AC_TYPE_SIZE_T
39 AC_HEADER_TIME
40 AC_STRUCT_TM
41 AC_CHECK_TYPES([ptrdiff_t])
43 dnl Checks for library functions.
44 AC_FUNC_FORK
45 AC_FUNC_MALLOC
46 AC_FUNC_SELECT_ARGTYPES
47 AC_CHECK_FUNCS([gethostbyname gettimeofday memset mkdir select socket strchr strtoul])
49 dnl Include third party libraries
50 if test "$OS_WITH_CLIENT" = "yes"; then
52 dnl Check for the alsa library
53      AC_CHECK_LIB([asound], [snd_pcm_open],, AC_MSG_ERROR([
54                 Alsa couldn't be found.
55                 Please install it before trying it again.]))
57 dnl Check for the portaudio header and the lib
58     AC_CHECK_HEADERS([portaudio.h],, AC_MSG_ERROR([
59                 Portaudio couldn't be found.
60                 Please install it before trying it again.
61                 You can find Portaudio at http://www.portaudio.com]))
62     AC_CHECK_LIB([portaudio], [Pa_Initialize],,AC_MSG_ERROR([
63                 Portaudio couldn't be found.
64                 Please install it before trying it again.
65                 You can find Portaudio at http://www.portaudio.com]))
67 dnl Check for Speex
68         XIPH_PATH_SPEEX
70 dnl Check for wxWidgets
71     AM_OPTIONS_WXCONFIG
72     AM_PATH_WXCONFIG([2.8.0], [wx=1], [wx=0], [])
73     if test "$wx" != 1; then
74         AC_MSG_ERROR([
75                         wxWidgets must be installed on your system
76                         but wx-config script couldn't be found.
78                         Please check that wx-config is in path, the directory
79                         where wxWidgets libraries are installed (returned by
80                         'wx-config --libs' command) is in LD_LIBRARY_PATH or
81                         equivalent variable and wxWidgets version is 2.8.0 or above
82         ])
83     fi
86 if test "$OS_WITH_DEBUG" = "yes"; then
87         CPPFLAGS="$CPPFLAGS -DOS_DEBUG -ggdb3 -Wall"
90 AC_CONFIG_FILES([Makefile
91                  lib/Makefile
92                  server/Makefile
93                  client/Makefile
94                  ])
96 AC_OUTPUT
98 echo ""
99 echo "-----| Configuration finished |-----"
100 echo ""
101 echo "  You're building:"
102 echo "  Client:         $OS_WITH_CLIENT"
103 echo "  Server:         $OS_WITH_SERVER"
104 echo ""
105 echo "  Debug logging:  $OS_WITH_DEBUG"
106 echo ""
107 echo "  Type 'make' to build openSpeak."
108 echo ""