-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
134 lines (113 loc) · 3.49 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
#adjust for the name and version of your
AC_PREREQ([2.69])
AC_INIT([mod_MP],[0.0.1])
#adjust for your main source file name
AC_CONFIG_SRCDIR([src/libmod_mp.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
AM_MAINTAINER_MODE
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE()
#adjust here (should be obvious what to change)
AM_CONFIG_HEADER([src/mod_mp_config.h:config.in])
AC_PROG_CC
AC_PROG_CXX
LT_PATH_LD
AC_PROG_INSTALL
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h stdlib.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memchr memset strchr strerror strstr])
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
PKG_CHECK_MODULES([APR], [apr-2])
#Check for MusicBrainz
AC_ARG_WITH([musicbrainz], AS_HELP_STRING([--with-musicbrainz], ["Build with musicbrainz support"]))
AS_IF(test "x$with_musicbrainz" = "xyes"],[
PKG_CHECK_MODULES([MUSICBRAINZ],
[musicbrainz],
WITH_MUSICBRAINZ = true \
AC_DEFINE([WITH_MUSICBRAINZ],1,["Compile with MusicBrainz support"])
PLUGINS_LDFLAGS = MUSICBRAINZ_LDFLAGS
)
]
)
AM_CONDITIONAL([WITH_MUSICBRAINZ], $WITH_MUSICBRAINZ)
#Check for FLAC
AC_ARG_WITH([flac], AS_HELP_STRING([--with-flac], ["Build with the FLAC support"]))
AS_IF(test "x$with_flac" = "xyes"],[
PKG_CHECK_MODULES([FLAC],
[flac],
WITH_FLAC = true \
AC_DEFINE([WITH_FLAC],1,["Compile with FLAC support"])
CODECS_LDFLAGS = FLAC_LDFLAGS
)
]
)
AM_CONDITIONAL([WITH_FLAC], [test "xwith_flac" = "xyes"])
#Check for OGG/Vorbis
AC_ARG_WITH([ogg], AS_HELP_STRING([--with-ogg], ["Build with the OGG/Vorbis support"]))
AS_IF(test "x$with_ogg" = "xyes"],[
PKG_CHECK_MODULES([OGG],
[ogg vorbis],
WITH_OGG = true \
AC_DEFINE([WITH_OGG],1,["Compile with OGG/Vorbis support"])
CODECS_LDFLAGS = OGG_LDFLAGS
)
]
)
AM_CONDITIONAL([WITH_OGG], [test "xwith_ogg" = "xyes"])
#Check for MP3 (mpg123)
AC_ARG_WITH([mp3], AS_HELP_STRING([--with-mp3], ["Build with the MP3 support"]))
AS_IF(test "x$with_mp3" = "xyes"],[
PKG_CHECK_MODULES([MP3],
[mpg123],
WITH_MP3 = true \
AC_DEFINE([WITH_MP3],1,["Compile with MP3 support"])
CODECS_LDFLAGS = MP3_LDFLAGS
)
]
)
AM_CONDITIONAL([WITH_MP3], [test "xwith_mp3" = "xyes"])
#if you are using a different version of apache, or don't want to require
#the latest, set this to something else.
AP_VERSION="2.2.4"
CHECK_APACHE(,[$AP_VERSION],
:,:,
AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
)
prefix=/usr
libdir=/usr/lib64
LIBTOOL="`${APR_CONFIG} --apr-libtool`"
AC_SUBST(LIBTOOL)
AP_MODULE_CFLAGS="${APXS_CFLAGS} ${AP_INCLUDES} -Werror -fno-inline"
AC_SUBST(AP_MODULE_CFLAGS)
AP_MODULE_LDFLAGS=" `${APR_CONFIG} --link-libtool` $APU_LDFLAGS"
AC_SUBST(AP_MODULE_LDFLAGS)
AP_BIN_LDFLAGS=" `${APR_CONFIG} --link-libtool` `${APR_CONFIG} --ldflags --libs` $APU_LDFLAGS"
AC_SUBST(AP_BIN_LDFLAGS)
#this should be a list to all of the makefiles you expect to be generated
AC_CONFIG_FILES([Makefile
tests/Makefile
src/Makefile
src/indexers/file/Makefile
src/indexers/music/Makefile
src/indexers/music/codecs/flac/Makefile
src/web_server/apache_httpd/Makefile
])
AC_OUTPUT
#whatever you want here, or nothing
echo "---"
echo "Configuration summary for mod_MP"
echo ""
echo " * Apache Modules Directory: $AP_LIBEXECDIR"
echo ""
echo "---"