3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(ncmpcpp, 0.2.95)
12 AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode], [Enable utf8 support]), [unicode=$enableval], [unicode=yes])
13 AC_ARG_WITH(taglib, AS_HELP_STRING([--with-taglib], [Enable tag editor]), [taglib=$withval], [taglib=no])
14 AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl], [Enable fetching lyrics from the Internet]), [curl=$withval], [curl=no])
16 dnl ========================
17 dnl = checking for ncurses =
18 dnl ========================
19 if test "$unicode" = "yes" ; then
20 ncurses_config_bin=ncursesw5-config
22 CPPFLAGS="$CPPFLAGS -D_UTF8"
24 ncurses_config_bin=ncurses5-config
27 AC_PATH_PROG(NCURSES_CONFIG, $ncurses_config_bin)
28 if test "$NCURSES_CONFIG" != "" ; then
29 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
30 LDFLAGS="$LDFLAGS `$NCURSES_CONFIG --libs`"
31 AC_CHECK_LIB($ncurses_lib, initscr, , AC_MSG_ERROR([$ncurses_lib library is required]))
33 AC_MSG_ERROR([$ncurses_config_bin executable is missing])
35 AC_CHECK_HEADERS([ncurses.h], , AC_MSG_ERROR([missing ncurses.h header]))
37 dnl =================================
38 dnl = checking for curl and pthread =
39 dnl =================================
40 if test "$curl" = "yes" ; then
41 AC_CHECK_LIB(pthread, pthread_create, LDFLAGS="$LDFLAGS -pthread", AC_MSG_ERROR([pthread library is required]))
42 AC_CHECK_HEADERS([pthread.h], , AC_MSG_ERROR([missing pthread.h header]))
43 AC_PATH_PROG(CURL_CONFIG, curl-config)
44 if test "$CURL_CONFIG" != "" ; then
45 CPPFLAGS="$CPPFLAGS `$CURL_CONFIG --cflags`"
46 AC_CHECK_LIB(curl, curl_easy_init, LDFLAGS="$LDFLAGS `$CURL_CONFIG --libs`", AC_MSG_ERROR([curl library is required]))
47 AC_CHECK_HEADERS([curl/curl.h], , AC_MSG_ERROR([missing curl.h header]))
49 AC_MSG_ERROR([curl-config executable is missing])
53 dnl =======================
54 dnl = checking for taglib =
55 dnl =======================
56 if test "$taglib" = "yes" ; then
57 AC_PATH_PROG(TAGLIB_CONFIG, taglib-config)
58 if test "$TAGLIB_CONFIG" != "" ; then
59 CPPFLAGS="$CPPFLAGS `$TAGLIB_CONFIG --cflags`"
60 LDFLAGS="$LDFLAGS `$TAGLIB_CONFIG --libs`"
61 AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header]))
63 AC_MSG_ERROR([taglib-config executable is missing])
67 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])