File: configure.ac

package info (click to toggle)
libmpdclient 2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,784 kB
  • ctags: 772
  • sloc: sh: 10,142; ansic: 6,238; makefile: 201
file content (143 lines) | stat: -rw-r--r-- 3,024 bytes parent folder | download
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
AC_PREREQ(2.60)
AC_INIT(libmpdclient, 2.3, musicpd-dev-team@lists.sourceforge.net)
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,3)
AC_SUBST(PATCH_VERSION,0)

LIBMPDCLIENT_LIBTOOL_VERSION=2:1: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

AC_PATH_PROG(DOXYGEN, doxygen)
AM_CONDITIONAL(DOXYGEN, test x$DOXYGEN != x)
AC_SUBST(DOXYGEN)


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_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",)
AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl",)


dnl
dnl build options
dnl

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])