forked from beetlebugorg/mod_dims
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
71 lines (57 loc) · 2.07 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
AC_PREREQ(2.60)
AC_INIT(mod_dims, 3.3.0, [jeremy.collins@beetlebug.org])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/mod_dims.c])
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
# Check for ImageMagic
AC_ARG_WITH(imagemagick, [ --with-imagemagick Specify installation directory for ImageMagick library], [
imagemagick_dir=$with_imagemagick
LDFLAGS+=" -L$imagemagick_dir/lib"
CFLAGS+=" -I$imagemagick_dir/include/ImageMagick"
],[echo nope]
)
AC_SUBST(imagemagick_dir)
AC_CHECK_LIB(MagickWand, MagickWandGenesis,, [
AC_CHECK_LIB(Wand, MagickWandGenesis,, [AC_MSG_ERROR(ImageMagick not found.)])
])
AC_CHECK_HEADER(wand/magick-wand.h)
# Check for libcurl
AC_ARG_WITH(curl, [ --with-curl Specify installation directory for Curl library], [
curl_dir=$with_curl
LDFLAGS+=" -L$curl_dir/lib"
],[])
AC_SUBST(curl_dir)
AC_CHECK_LIB(curl, curl_global_init,, [AC_MSG_ERROR(curl not found.)])
AC_CHECK_HEADER(curl/curl.h)
# Check for Apache
AC_ARG_WITH(apache, [ --with-apache Specify installation directory for Apache 2.2.x], [
LDFLAGS+=" -L$with_apache/lib"
CFLAGS+=" -I$with_apache/include"
AC_PATH_PROG([APXS], apxs, , $with_apache/bin)
AC_CHECK_HEADER(apr.h,, [AC_MSG_ERROR(Apache Portable Runtime headers not found.)])
AC_CHECK_HEADER(httpd.h,, [AC_MSG_ERROR(Apache headers not found.)])
],[
# Look for Apache Portable Runtime
if test -d /usr/include/apr-1
then
CFLAGS+=" -I/usr/include/apr-1"
elif test -d /usr/include/apr-1.0
then
CFLAGS+=" -I/usr/include/apr-1.0"
fi
CFLAGS+=" -D_LARGEFILE64_SOURCE -I/usr/include/apache2"
AC_CHECK_HEADER(apr.h,, [AC_MSG_ERROR(Apache Portable Runtime headers not found.)])
AC_CHECK_HEADER(httpd.h,, [AC_MSG_ERROR(Apache headers not found.)])
AC_PATH_PROG([APXS], apxs)
])
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset sqrt strstr])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT