20cc143af3f5a4f0bca615e251b2655a775228c2
1 dnl
2 dnl $Id$
3 dnl
5 AC_INIT
6 AC_CONFIG_SRCDIR([src/main.c])
7 AM_INIT_AUTOMAKE(ncmpc, 0.11.0-svn)
8 AM_CONFIG_HEADER([config.h])
10 dnl Check for programs
11 AC_PROG_CC
12 AC_PROG_INSTALL
13 dnl AC_PROG_LIBTOOL
15 dnl =======================================================
16 dnl initialize variables
17 dnl =======================================================
19 set -- $CFLAGS
21 keydef_screen=yes
23 dnl
24 dnl Check for types
25 dnl
27 AC_SOCKLEN_T
30 dnl
31 dnl Check for headers
32 dnl
34 AC_CHECK_HEADER(libgen.h,
35 AC_DEFINE(HAVE_LIBGEN_H, 1, glibc - libgen.h),
36 ,)
38 AC_CHECK_HEADER(locale.h,
39 AC_DEFINE(HAVE_LOCALE_H, 1, locale.h),
40 ,)
43 dnl
44 dnl Check for functions
45 dnl
46 AC_CHECK_FUNCS(basename strcasestr)
49 dnl
50 dnl Check for libraries
51 dnl
53 dnl ncurses
54 AC_CHECK_LIB(ncurses, initscr,, [AC_MSG_ERROR(ncurses library is required)])
55 LIBS="$LIBS -lncurses"
57 dnl Check for glib-2
58 #AM_PATH_GLIB_2_0(, , [AC_MSG_ERROR(glib-2.x is required)], glib)
59 PKG_CHECK_MODULES(GLIB,
60 glib-2.0 >= 2.2,
61 ,
62 AC_MSG_ERROR(glib-2.2 is required))
64 dnl i18n
65 ALL_LINGUAS=""
66 AC_MSG_CHECKING([whether to include NLS support])
67 AC_ARG_ENABLE([nls],
68 AC_HELP_STRING([--enable-nls],
69 [include natural language support @<:@default=yes@:>@]),
70 [nls="$enableval"],
71 [nls=yes])
72 AC_MSG_RESULT([$nls])
73 if test "x$nls" = "xyes"; then
74 ALL_LINGUAS="sv"
75 AM_GLIB_GNU_GETTEXT
76 GETTEXT_PACKAGE=$PACKAGE
77 AC_SUBST(GETTEXT_PACKAGE)
78 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
79 ["${GETTEXT_PACKAGE}"],
80 [gettext domain])
81 nls=$gt_cv_have_gettext
82 fi
85 dnl popt
86 AC_CHECK_LIB(popt,
87 poptGetArg,
88 LIBS="$LIBS -lpopt",
89 AC_MSG_ERROR(Missing popt command line parsing library))
94 dnl Debugging
95 AC_ARG_ENABLE(debug,
96 AC_HELP_STRING(--enable-debug,Enable debugging (default=no)),
97 ,
98 enable_debug=no)
100 if test "$enable_debug" = yes; then
101 CFLAGS="$CFLAGS -Wall -g -DDEBUG"
102 fi
104 dnl Key editor
105 AC_ARG_ENABLE(key-editor,
106 AC_HELP_STRING(--enable-key-editor,
107 Enable key editor (default=yes)),
108 keydef_screen=no,
109 keydef_screen=yes)
110 if test "$keydef_screen" = yes; then
111 AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable builtin key editor])
112 fi
116 dnl Default host
117 AC_ARG_WITH(default-host,
118 AC_HELP_STRING(--with-default-host=ARG,Default MPD host (localhost)),
119 DEFAULT_HOST="$withval",
120 DEFAULT_HOST="localhost")
122 dnl Default port
123 AC_ARG_WITH(default-port,
124 AC_HELP_STRING(--with-default-port=ARG,Default port (6600)),
125 DEFAULT_PORT="$withval",
126 DEFAULT_PORT="6600")
129 dnl Autoheader
130 AC_DEFINE_UNQUOTED(DEFAULT_PORT, $DEFAULT_PORT, Default MPD port)
131 AC_DEFINE_UNQUOTED(DEFAULT_PORT_STR, "$DEFAULT_PORT", Default MPD port)
132 AC_DEFINE_UNQUOTED(DEFAULT_HOST, "$DEFAULT_HOST", Default MPD host)
134 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
135 AC_OUTPUT
137 echo "
138 Configuration:
139 prefix: ${prefix}
140 nls: ${nls}
141 sysconfdir: ${sysconfdir}
142 Default MPD host: ${DEFAULT_HOST}
143 Default MPD port: ${DEFAULT_PORT}
144 Enable debugging: ${enable_debug}
145 Key edit screen: ${keydef_screen}
146 "
147 echo