-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
100 lines (69 loc) · 2.29 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
AC_PREREQ(2.59)
AC_INIT([libnzbfetch], [trunk], [[email protected]])
AM_INIT_AUTOMAKE(libnzbfetch, 0.1)
AM_CONFIG_HEADER(config.h)
AC_LANG(C)
AM_INIT_AUTOMAKE
m4_include([aclocal/libtool.m4])
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_LIBTOOL
CFLAGS="${CFLAGS} -std=c99 -Wall -Winline"
##
# Check for expat
save_LIBS="${LIBS}"
LIBS=""
AC_ARG_WITH([expat], [ --with-expat=path specify that expat is installed at path], [
if test -n "$withval"; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
])
AC_CHECK_LIB(expat, XML_Parse,, [
AC_MSG_ERROR([expat not found, please use --with-expat])
])
AC_CHECK_HEADER([expat.h],, [
AC_MSG_ERROR([expat not found, please use --with-expat])
])
EXPAT_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(EXPAT_LIBS)
##
# Check for SSL
save_LIBS="${LIBS}"
LIBS=""
AC_ARG_WITH([ssl], [ --with-ssl=path specify that ssl is installed at path], [
if test -n "$withval"; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
])
AC_CHECK_LIB(ssl, SSL_CTX_new,, [AC_MSG_WARN([ssl not found, please us --with-ssl to enable SSL support])])
AC_CHECK_HEADER([openssl/ssl.h],, [AC_MSG_WARN([openssl/ssl.h not found, please use --with-ssl to enable SSL support])])
SSL_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(SSL_LIBS)
##
# Check for reallocf (FreeBSD api)
AC_CHECK_FUNCS([reallocf])
AC_CHECK_FUNCS([asprintf])
AC_CHECK_FUNCS([vasprintf])
AC_CHECK_FUNCS([strsep])
##
# Other header files
AC_CHECK_HEADER([assert.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([netdb.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([netinet/in.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([pthread.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([stdarg.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([stdio.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([sys/param.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CHECK_HEADER([sys/socket.h],, AC_MSG_ERROR(["Missing include file"]))
AC_CONFIG_FILES([
Makefile
include/Makefile
src/Makefile
src/compat/Makefile
example/Makefile
])
AC_OUTPUT