/
configure.ac
155 lines (130 loc) · 4.04 KB
/
configure.ac
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(sighttpd, 1.1.0, [conrad@metadecks.org])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
dnl Check for pkgconfig first
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
dnl Give error and exit if we don't have pkgconfig
if test "x$HAVE_PKGCONFIG" = "xno"; then
AC_MSG_ERROR(you need to have pkgconfig installed !)
fi
# Checks for libraries.
dnl
dnl Detect pthreads libraries
dnl
PTHREAD_LIBS=error
AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread")
if test "x$PTHREAD_LIBS" = xerror; then
AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads")
fi
if test "x$PTHREAD_LIBS" = xerror; then
AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r")
fi
if test "x$PTHREAD_LIBS" = xerror; then
AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
fi
AC_SUBST(PTHREAD_LIBS)
dnl
dnl Detect librt
dnl
RT_LIBS=error
AC_CHECK_LIB(rt, clock_gettime, RT_LIBS="-lrt")
AC_SUBST(RT_LIBS)
dnl
dnl Detect oggz
dnl
if test "x$HAVE_PKGCONFIG" = "xyes" ; then
PKG_CHECK_MODULES(OGGZ, oggz >= 0.5.40,
HAVE_OGGZ="yes", HAVE_OGGZ="no")
fi
if test "$HAVE_OGGZ" = "yes" ; then
AC_DEFINE(HAVE_OGGZ, [], [Define if have liboggz])
AC_SUBST(OGGZ_LIBS)
else
AC_CHECK_LIB(oggz, oggz_open, OGGZ_LIBS="maybe")
if test "$OGGZ_LIBS" = "maybe" ; then
AC_MSG_ERROR([
***
*** liboggz-0.5.20 or greater seems to exist on your system, however
*** the pkg-config tool cannot find its build information.
***
*** Please set your PKG_CONFIG_PATH environment variable to include the
*** directory in which oggz.pc was installed. For example, oggz.pc
*** is installed in /usr/local/lib/pkgconfig by default; if that is the
*** case do:
***
*** export PKG_CONFIG_PATH="\$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
***
*** then run this ./configure again. If you configured liboggz with a
*** different --prefix option, replace /usr/local above with that prefix.
***
])
fi
fi
AM_CONDITIONAL(HAVE_OGGZ, [test "x$HAVE_OGGZ" = "xyes"])
#dnl
#dnl Check for libuiomux
#dnl
#PKG_CHECK_MODULES(UIOMUX, uiomux >= 1.1.0, HAVE_UIOMUX="yes", HAVE_UIOMUX="no")
#if test "x$HAVE_UIOMUX" = "xyes" ; then
# AC_DEFINE(HAVE_UIOMUX, [], [Define if have libuiomux])
# AC_SUBST(UIOMUX_CFLAGS)
# AC_SUBST(UIOMUX_LIBS)
#fi
#AM_CONDITIONAL(HAVE_UIOMUX, [test "x$HAVE_UIOMUX" = "xyes"])
#dnl
#dnl Check for libshveu
#dnl
#PKG_CHECK_MODULES(SHVEU, shveu >= 1.2.0, HAVE_SHVEU="yes", HAVE_SHVEU="no")
#if test "x$HAVE_SHVEU" = "xyes" ; then
# AC_DEFINE(HAVE_SHVEU, [], [Define if have libshveu])
# AC_SUBST(SHVEU_CFLAGS)
# AC_SUBST(SHVEU_LIBS)
#fi
#AM_CONDITIONAL(HAVE_SHVEU, [test "x$HAVE_SHVEU" = "xyes"])
#dnl
#dnl Check for libshcodecs
#dnl
#PKG_CHECK_MODULES(SHCODECS, shcodecs >= 1.1.0, HAVE_SHCODECS="yes", HAVE_SHCODECS="no")
#if test "x$HAVE_SHCODECS" = "xyes" ; then
# AC_DEFINE(HAVE_SHCODECS, [], [Define if have libshcodecs])
# AC_SUBST(SHCODECS_CFLAGS)
# AC_SUBST(SHCODECS_LIBS)
#fi
#AM_CONDITIONAL(HAVE_SHCODECS, [test "x$HAVE_SHCODECS" = "xyes"])
# Checks for header files.
AC_HEADER_RESOLV
AC_HEADER_STDC
AC_CHECK_HEADERS([netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_STRTOD
AC_CHECK_FUNCS([bzero clock_gettime memset socket strcasecmp strcspn strdup strspn])
AC_CONFIG_FILES([
Makefile
src/Makefile
doc/Makefile
examples/Makefile
])
AC_OUTPUT
AC_MSG_RESULT([
------------------------------------------------------------------------
$PACKAGE $VERSION: Automatic configuration OK.
Module configuration:
Ogg Vorbis support: .......... $HAVE_OGGZ
UIOMux support: .............. $HAVE_UIOMUX
SHVEU support: ............... $HAVE_SHVEU
SHCodecs support: ............ $HAVE_SHCODECS
------------------------------------------------------------------------
])