-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
157 lines (120 loc) · 3.36 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
155
156
157
AC_PREREQ(2.60)
AC_INIT(libmpdclient, 2.8~git, [email protected])
AC_CONFIG_SRCDIR([src/connection.c])
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(MAJOR_VERSION,2)
AC_SUBST(MINOR_VERSION,8)
AC_SUBST(PATCH_VERSION,0)
LIBMPDCLIENT_LIBTOOL_VERSION=2:8:0
AC_SUBST(LIBMPDCLIENT_LIBTOOL_VERSION)
# Remove the check for c++ and fortran compiler
m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
dnl Check for programs
AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LD
AM_CONDITIONAL(HAVE_GNU_LD, test x$with_gnu_ld = xyes)
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
dnl
dnl initialize variables
dnl
set -- $CFLAGS
dnl
dnl OS specific defaults
dnl
AC_CANONICAL_HOST
case "$host_os" in
mingw32* | windows*)
LIBS="$LIBS -lws2_32"
;;
esac
dnl
dnl Check for libraries
dnl
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
dnl
dnl build options
dnl
AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--disable-documentation],
[Disable API doc generation @<:@default=enabled@:>@]),,
[enable_documentation=yes])
if test "x$enable_documentation" = xyes; then
AC_PATH_PROG(DOXYGEN, doxygen)
AM_CONDITIONAL(DOXYGEN, test x$DOXYGEN != x)
AC_SUBST(DOXYGEN)
fi
AC_ARG_ENABLE(tcp,
AS_HELP_STRING([--disable-tcp],
[Disable TCP support @<:@default=enabled@:>@]),,
[enable_tcp=yes])
if test "x$enable_tcp" = xyes; then
AC_DEFINE([ENABLE_TCP], 1, [Define to enable TCP support])
fi
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror],
[Treat warnings as errors @<:@default=disabled@:>@]),
ENABLE_WERROR=$enableval,
ENABLE_WERROR=no)
if test "x$ENABLE_WERROR" = xyes; then
AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
fi
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[Enable debugging @<:@default=disabled@:>@]),
ENABLE_DEBUG=$enableval,
ENABLE_DEBUG=no)
if test "x$ENABLE_DEBUG" = xno; then
AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
fi
dnl
dnl CFLAGS
dnl
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
WANTED_CFLAGS="-Wall -W -Wextra -Wno-deprecated-declarations -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wwrite-strings"
for flag in $WANTED_CFLAGS ; do
AX_CHECK_COMPILER_FLAGS([$flag], [CFLAGS="$CFLAGS $flag"],)
done
dnl
dnl Compile-time options
dnl
AC_ARG_WITH([default-socket],
AC_HELP_STRING([--with-default-socket=PATH],
[default path of the socket file @<:@/var/run/mpd/socket@:>@]),,
[with_default_socket=auto])
if test x$with_default_socket = xauto; then
case "$host_os" in
mingw32* | windows*)
# no UNIX domain sockets on WIN32
with_default_socket=no
;;
*)
with_default_socket=/var/run/mpd/socket
;;
esac
fi
if test x$with_default_socket != xno; then
AC_DEFINE_UNQUOTED([DEFAULT_SOCKET], ["$with_default_socket"],
[Default UNIX socket path])
fi
AC_ARG_WITH([default-host],
AC_HELP_STRING([--with-default-host=ARG],
[default MPD host @<:@localhost@:>@]),,
[with_default_host=localhost])
AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$with_default_host"], [Default MPD host])
AC_ARG_WITH([default-port],
AC_HELP_STRING([--with-default-port=ARG],
[default MPD port @<:@6600@:>@]),,
[with_default_port=6600])
AC_DEFINE_UNQUOTED([DEFAULT_PORT], [$with_default_port], [Default MPD port])
dnl
dnl Done
dnl
AC_OUTPUT([Makefile include/mpd/version.h libmpdclient.pc doc/doxygen.conf])