AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(ncmpcpp, 0.2.3_pre) AC_PREREQ(2.59) AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode], [Enable utf8 support]), [unicode=$enableval], [unicode=yes]) AC_ARG_WITH(taglib, AS_HELP_STRING([--with-taglib], [Enable tag editor]), [taglib=$withval], [taglib=no]) AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl], [Enable fetching lyrics from the Internet]), [curl=$withval], [curl=no]) dnl ======================== dnl = checking for ncurses = dnl ======================== if test "$unicode" = "yes" ; then ncurses_config_bin=ncursesw5-config ncurses_lib=ncursesw CPPFLAGS="$CPPFLAGS -DUTF8_ENABLED" else ncurses_config_bin=ncurses5-config ncurses_lib=ncurses fi AC_PATH_PROG(NCURSES_CONFIG, $ncurses_config_bin) if test "$NCURSES_CONFIG" != "" ; then CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" LDFLAGS="$LDFLAGS `$NCURSES_CONFIG --libs`" AC_CHECK_LIB($ncurses_lib, initscr, , AC_MSG_ERROR([$ncurses_lib library is required])) else AC_MSG_ERROR([$ncurses_config_bin executable is missing]) fi AC_CHECK_HEADERS([ncurses.h], , AC_MSG_ERROR([missing ncurses.h header])) dnl ===================== dnl = checking for curl = dnl ===================== if test "$curl" = "yes" ; then AC_PATH_PROG(CURL_CONFIG, curl-config) if test "$CURL_CONFIG" != "" ; then CPPFLAGS="$CPPFLAGS `$CURL_CONFIG --cflags`" AC_CHECK_LIB(curl, curl_easy_init, LDFLAGS="$LDFLAGS `$CURL_CONFIG --libs`", AC_MSG_ERROR([curl library is required])) AC_CHECK_HEADERS([curl/curl.h], , AC_MSG_ERROR([missing curl.h header])) else AC_MSG_ERROR([curl-config executable is missing]) fi fi dnl ======================= dnl = checking for taglib = dnl ======================= if test "$taglib" = "yes" ; then AC_PATH_PROG(TAGLIB_CONFIG, taglib-config) if test "$TAGLIB_CONFIG" != "" ; then CPPFLAGS="$CPPFLAGS `$TAGLIB_CONFIG --cflags`" LDFLAGS="$LDFLAGS `$TAGLIB_CONFIG --libs`" AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header])) else AC_MSG_ERROR([taglib-config executable is missing]) fi fi AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) AC_OUTPUT