aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: fc0fea950c2f2b23bbe20347be2181f7ad3c2b78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([Virtual OSC Controller], [dev])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/controller.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC(gcc cc owcc)
AC_PROG_CC_C_O
AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LIBTOOL

# Checks for libraries.
AC_CHECK_LIB(expat, XML_ParserCreate, , [
	AC_MSG_ERROR([Required libexpat is missing!])
])

# libSDL depends on sdl-config script
AC_CHECK_PROG(SDL_CONFIG, sdl-config, sdl-config)
if test x$SDL_CONFIG = x; then
	AC_MSG_ERROR([Required sdl-config script is missing! libSDL cannot be configured.])
fi

CFLAGS="$CFLAGS `$SDL_CONFIG --cflags`"
LIBS="$LIBS `$SDL_CONFIG --libs`"
AC_DEFINE(HAVE_LIBSDL, , [We've got libSDL])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/select.h unistd.h])

AC_CHECK_HEADERS([expat.h], , [
	AC_MSG_ERROR([Required libexpat headers are missing!])
])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPE(in_addr_t, [
	AC_DEFINE([HAVE_IN_ADDR_T], , [netinet/in.h defines in_addr_t type])
], , [
	#include <netinet/in.h>
])

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([atexit gethostbyname memset socket strcasecmp strchr strdup strrchr strtoul])

# Arbitrary defines
AC_DEFINE([OSC_NOBUNDLES], , [Don't include OSC bundle support in OSC-client.c])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT