Files
ncmpcpp/configure.in
2009-03-25 17:47:10 +01:00

92 lines
3.3 KiB
Plaintext

AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ncmpcpp, 0.3.3_pre)
AC_PREREQ(2.59)
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_ARG_ENABLE(clock, AS_HELP_STRING([--enable-clock], [Enable clock screen]), [clock=$enableval], [clock=no])
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])
AC_ARG_WITH(pdcurses, AS_HELP_STRING([--with-pdcurses], [Link against pdcurses instead of ncurses]), [pdcurses=$withval], [pdcurses=no])
if test "$clock" = "yes"; then
AC_DEFINE([ENABLE_CLOCK], [1], [enables clock screen])
fi
dnl ======================
dnl = checking for iconv =
dnl ======================
if test "$prefix" = "NONE"; then
encodings_file="${ac_default_prefix}"
else
encodings_file="${prefix}"
fi
AC_DEFINE_UNQUOTED([ENCODINGS], ["${encodings_file}/share/ncmpcpp/encodings"], [defines path for encodings file])
AC_CHECK_HEADERS([iconv.h], , AC_MSG_NOTICE(cannot find iconv.h header, iconv support will be disabled))
dnl ========================
dnl = checking for ncurses =
dnl ========================
if test "$pdcurses" = "no" ; then
if test "$unicode" = "yes" ; then
curses_config_bin=ncursesw5-config
curses_lib=ncursesw
AC_DEFINE([_UTF8], [1], [enables unicode support])
else
curses_config_bin=ncurses5-config
curses_lib=ncurses
fi
else
curses_config_bin=xcurses-config
curses_lib=XCurses
AC_DEFINE([USE_PDCURSES], [1], [enables pdcurses support])
fi
AC_PATH_PROG(CURSES_CONFIG, $curses_config_bin)
if test "$CURSES_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`"
LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`"
AC_CHECK_LIB($curses_lib, initscr, , AC_MSG_ERROR([$curses_lib library is required]))
else
AC_CHECK_LIB($curses_lib, initscr, LDFLAGS="$LDFLAGS -l$curses_lib", AC_MSG_ERROR([$ncurses_lib library is required]))
fi
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing ncurses.h header]))
dnl =================================
dnl = checking for curl and pthread =
dnl =================================
if test "$curl" = "yes" ; then
AC_CHECK_LIB(pthread, pthread_create, LDFLAGS="$LDFLAGS -lpthread", AC_MSG_ERROR([pthread library is required]))
AC_CHECK_HEADERS([pthread.h], , AC_MSG_ERROR([missing pthread.h header]))
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 data/Makefile doc/Makefile])
AC_OUTPUT