some fixes, code cleanups and corrected configure.in

This commit is contained in:
unknown
2008-08-06 14:51:12 +02:00
parent e2d4e5c8d8
commit c7672f1779
8 changed files with 187 additions and 204 deletions

View File

@@ -7,25 +7,56 @@ AC_LANG_CPLUSPLUS
AC_PROG_CXX
AM_PROG_LIBTOOL
CPPFLAGS="$CPPFLAGS `taglib-config --cflags`"
AC_ARG_ENABLE(unicode,[ --enable-unicode Enable utf8 support ], [unicode=$enableval], [unicode=yes])
if test "$unicode" = "yes" ; then
AC_CHECK_LIB(ncursesw, initscr, , AC_MSG_ERROR([ncursesw library is required]))
AC_CHECK_HEADERS([ncursesw/ncurses.h], , AC_MSG_ERROR([missing ncursesw.h header]))
CPPFLAGS="$CPPFLAGS -DUTF8_ENABLED"
LDFLAGS="$LDFLAGS -lncursesw"
else
AC_CHECK_LIB(ncurses, initscr, , AC_MSG_ERROR([ncurses library is required]))
AC_CHECK_HEADERS([ncurses.h], , AC_MSG_ERROR([missing ncurses.h header]))
LDFLAGS="$LDFLAGS -lncurses"
fi
PKG_CHECK_MODULES([libmpd], libmpd, LDFLAGS="$LDFLAGS -lmpd", AC_MSG_ERROR([mpd library is required]))
dnl ========================
dnl = checking for ncurses =
dnl ========================
if test "$unicode" = "yes" ; then
AC_PATH_PROG(NCURSESW5_CONFIG, ncursesw5-config)
if test "$NCURSESW5_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS -DUTF8_ENABLED `$NCURSESW5_CONFIG --cflags`"
LDFLAGS="$LDFLAGS `$NCURSESW5_CONFIG --libs`"
AC_CHECK_LIB(ncursesw, initscr, , AC_MSG_ERROR([ncursesw library is required]))
else
AC_MSG_ERROR([ncursesw5-config executable is missing])
fi
else
AC_PATH_PROG(NCURSES5_CONFIG, ncurses5-config)
if test "$NCURSES5_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$NCURSES5_CONFIG --cflags`"
LDFLAGS="$LDFLAGS `$NCURSES5_CONFIG --libs`"
AC_CHECK_LIB(ncurses, initscr, , AC_MSG_ERROR([ncurses library is required]))
else
AC_MSG_ERROR([ncurses5-config executable is missing])
fi
fi
AC_CHECK_HEADERS([ncurses.h], , AC_MSG_ERROR([missing ncurses.h header]))
dnl =======================
dnl = checking for libmpd =
dnl =======================
PKG_CHECK_MODULES([libmpd], libmpd >= 0.15.3, , AC_MSG_ERROR([libmpd-0.15.3 or higher is required]))
AC_SUBST(libmpd_CFLAGS)
AC_SUBST(libmpd_LIBS)
CPPFLAGS="$CPPFLAGS $libmpd_CFLAGS"
LDFLAGS="$LDFLAGS $libmpd_LIBS"
AC_CHECK_HEADERS([libmpd/libmpd.h], , AC_MSG_ERROR([missing libmpd.h header]))
PKG_CHECK_MODULES([taglib], taglib, LDFLAGS="$LDFLAGS `taglib-config --libs`", AC_MSG_ERROR([taglib library is required]))
AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header]))
dnl =======================
dnl = checking for taglib =
dnl =======================
AC_PATH_PROG(TAGLIB_CONFIG, taglib-config)
if test "$TAGLIB_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$TAGLIB_CONFIG --cflags`"
PKG_CHECK_MODULES([taglib], taglib, LDFLAGS="$LDFLAGS `$TAGLIB_CONFIG --libs`", AC_MSG_ERROR([taglib library is required]))
AC_CHECK_HEADERS([taglib.h], , AC_MSG_ERROR([missing taglib.h header]))
else
AC_MSG_ERROR([taglib-config executable is missing])
fi
AC_OUTPUT(Makefile src/Makefile)