message.h: Add wrapper around protobufs ugly func names
[cmumble:cmumble.git] / configure.ac
1 AC_PREREQ([2.64])
2
3 AC_INIT([cmumble],
4         [0.1],
5         [benjaminfranzke@googlemail.com],
6         [cmumble],
7         [https://gitorious.org/cmumble/])
8
9 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_MACRO_DIR([m4])
11
12 AM_INIT_AUTOMAKE([foreign dist-bzip2])
13
14 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
15
16 # Check for programs
17 AC_PROG_CC
18 AC_PROG_SED
19
20 AC_ARG_WITH([protoc],
21             [AS_HELP_STRING([--with-protoc=COMMAND],
22                             [use the given protoc command])],
23                             [PROTOC_C=$withval],
24                             [AC_PATH_PROG([PROTOC_C], [protoc-c], [false])])
25
26 AS_IF([test "x$PROTOC_C" = "xfalse"],
27       [AC_MSG_ERROR([protoc-c compiler not found])])
28
29 AC_CHECK_LIB([ncurses], [tputs],
30              [], [AC_MSG_ERROR([ncurses needed for libreadline])])
31 AC_CHECK_LIB([readline], [readline],
32              [], [AC_MSG_ERROR([libreadline not found])], [-lncurses])
33
34 PKG_PROG_PKG_CONFIG()
35 PKG_CHECK_MODULES(PROTOBUF, [libprotobuf-c],[], [
36         AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack_to_buffer], [],
37                      [AC_MSG_ERROR([libprotobuf-c not found])])
38 ])
39 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28])
40 PKG_CHECK_MODULES(GIO,  [gio-2.0])
41 PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10 gstreamer-app-0.10])
42 PKG_CHECK_MODULES(CELT, [celt])
43
44 GST_ELEMENTS="appsrc appsink celtdec celtenc capsfilter
45               audioconvert audioresample autoaudiosrc autoaudiosink"
46
47 for element in $GST_ELEMENTS
48 do
49         AM_GST_ELEMENT_CHECK([$element], [],
50                              AC_MSG_ERROR([gstreamer element $element not found]))
51 done
52
53 if test "x$GCC" = "xyes"; then
54         GCC_CFLAGS="-Wall -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
55 fi
56 AC_SUBST([GCC_CFLAGS])
57
58 AC_CONFIG_FILES([Makefile
59                  src/Makefile])
60 AC_CONFIG_FILES([src/protoc-c.sh], [chmod +x src/protoc-c.sh])
61 AC_OUTPUT