diff --git a/configure.ac b/configure.ac
index 9cda7754691fceaf55ff51fd3fff25e277f2257e..83a47a7d11311d22917fa71630afb61bbd66df11 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl $Id$
dnl
-AC_INIT
+AC_INIT(ncurses MPD client, 0.12~git, max@duempel.org, ncmpc)
AC_CONFIG_SRCDIR([src/main.c])
-AM_INIT_AUTOMAKE([ncmpc], [0.11.2-svn])
+AM_INIT_AUTOMAKE([gnu 1.6 dist-bzip2])
AM_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([m4])
dnl Check for programs
-AC_PROG_CC
+AC_PROG_CC_C99
AC_PROG_INSTALL
-dnl AC_PROG_LIBTOOL
+AC_PROG_LIBTOOL
dnl =======================================================
dnl initialize variables
dnl =======================================================
dnl i18n
-ALL_LINGUAS="es de fr gl no ru sv"
+ALL_LINGUAS="es da de fr gl no ru sv"
set -- $CFLAGS
dnl Check for types
dnl
-AC_SOCKLEN_T
-
+AC_MSG_RESULT([$ac_have_socklen_t])
dnl
dnl Check for headers
dnl
dnl Check for functions
dnl
-AC_CHECK_FUNCS([basename strcasestr])
+AC_CHECK_FUNCS([strcasestr])
dnl
dnl ncurses
-ncurses=ncursesw
+ncurses=auto
AC_ARG_WITH([ncurses],
AC_HELP_STRING([--with-ncurses], [compile/link with ncurses library] ),
[ncurses=ncurses])
AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]),
[ncurses=ncursesw])
+if test "x$ncurses" = "xauto"; then
+ AC_CHECK_LIB([ncursesw],
+ [initscr],
+ [ncurses=ncursesw],
+ [ncurses=ncurses])
+fi
+
AC_CHECK_LIB([$ncurses],
[initscr],
- [LIBS="$LIBS -l$ncurses"],
- [AC_MSG_ERROR($ncurses library is required)])
+ [LIBS="$LIBS -l$ncurses"],
+ [AC_MSG_ERROR($ncurses library is required)])
-if test "x$ncurses" = "xncursesw" ; then
- AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [wide-char wget_ch()])
- AC_DEFINE(USE_NCURSESW, 1, [use wide-char ncurses library])
-fi
dnl Check for glib-2.4
AM_PO_SUBDIRS
fi
-
dnl disbale raw mode
AC_MSG_CHECKING([Place the terminal into raw mode])
AC_ARG_ENABLE([raw-mode],
AC_DEFINE([ENABLE_RAW_MODE], [1], [Place the terminal into raw mode])
fi
+dnl enable colors
+AC_MSG_CHECKING([color support])
+AC_ARG_ENABLE([colors],
+ AC_HELP_STRING([--enable-colors],
+ [Enable color support]),
+ [use_colors=$enableval],
+ [use_colors=no])
+AC_MSG_RESULT([$use_colors])
+if test "x$use_colors" = "xyes" ; then
+ AC_DEFINE([ENABLE_COLORS], [1], [Enable color support])
+fi
+
dnl Debugging
AC_MSG_CHECKING([whether to build with debug support])
AC_ARG_ENABLE([debug],
[enable_debug=no])
AC_MSG_RESULT([$enable_debug])
if test "x$enable_debug" = "xyes" ; then
- CFLAGS="$CFLAGS -Wall -g -DDEBUG"
+ CFLAGS="$CFLAGS -g"
+else
+ CFLAGS="$CFLAGS -DNDEBUG"
fi
+dnl CFLAGS
+
+AC_SUBST(AM_CFLAGS)
+
+CHECK_CFLAG([-Wall])
+CHECK_CFLAG([-Wextra])
+CHECK_CFLAG([-Wno-deprecated-declarations])
+CHECK_CFLAG([-Wmissing-prototypes])
+CHECK_CFLAG([-Wdeclaration-after-statement])
+CHECK_CFLAG([-Wshadow])
+CHECK_CFLAG([-Wpointer-arith])
+CHECK_CFLAG([-Wstrict-prototypes])
+CHECK_CFLAG([-Wcast-qual])
+CHECK_CFLAG([-Wwrite-strings])
+
dnl Optional screen - help screen
#AC_MSG_CHECKING([whether to include the help screen])
#AC_ARG_ENABLE([help-screen],
#fi
dnl Optional screen - browse screen
-#AC_MSG_CHECKING([whether to include the browse screen])
+#AC_MSG_CHECKING([whether to include the browse screen])r
#AC_ARG_ENABLE([browse-screen],
# AC_HELP_STRING([--enable-browse-screen],
# [Enable the browse screen @<:@default=yes@:>@]),
[artist_screen="$enableval"],
[artist_screen=no])
AC_MSG_RESULT([$artist_screen])
-if test "x$artist_screen" != "xyes" ; then
- AC_DEFINE(DISABLE_ARTIST_SCREEN, 1, [Disable artist screen])
+if test "x$artist_screen" = "xyes" ; then
+ AC_DEFINE(ENABLE_ARTIST_SCREEN, 1, [Enable artist screen])
fi
+AM_CONDITIONAL(ENABLE_ARTIST_SCREEN, test x$artist_screen = xyes)
+
dnl Optional screen - search
AC_MSG_CHECKING([whether to include the search screen])
AC_ARG_ENABLE([search-screen],
[search_screen="$enableval"],
[search_screen=yes])
AC_MSG_RESULT([$search_screen])
-if test "x$search_screen" != "xyes" ; then
- AC_DEFINE(DISABLE_SEARCH_SCREEN, 1, [Disable search screen])
+if test "x$search_screen" = "xyes" ; then
+ AC_DEFINE(ENABLE_SEARCH_SCREEN, 1, [Enable search screen])
fi
+AM_CONDITIONAL(ENABLE_SEARCH_SCREEN, test x$search_screen = xyes)
+
dnl Optional screen - key editor
AC_MSG_CHECKING([whether to include the key editor screen])
AC_ARG_ENABLE([key-screen],
[keydef_screen="$enableval"],
[keydef_screen=yes])
AC_MSG_RESULT([$keydef_screen])
-if test "x$keydef_screen" != "xyes" ; then
- AC_DEFINE(DISABLE_KEYDEF_SCREEN, 1, [Disable key editor screen])
+if test "x$keydef_screen" = "xyes" ; then
+ AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable key editor screen])
fi
-dnl Optional screen - clock
-AC_MSG_CHECKING([whether to include the clock screen])
-AC_ARG_ENABLE([clock-screen],
- AC_HELP_STRING([--enable-clock-screen],
- [Enable clock screen @<:@default=yes@:>@]),
- [clock_screen="$enableval"],
- [clock_screen=yes])
-AC_MSG_RESULT([$clock_screen])
-if test "x$clock_screen" != "xyes" ; then
- AC_DEFINE(DISABLE_CLOCK_SCREEN, 1, [Disable clock screen])
+AM_CONDITIONAL(ENABLE_KEYDEF_SCREEN, test x$keydef_screen = xyes)
+
+dnl Optional screen - lyrics
+AC_MSG_CHECKING([whether to include the lyrics screen])
+AC_ARG_ENABLE([lyrics-screen],
+ AC_HELP_STRING([--enable-lyrics-screen],
+ [Enable lyrics screen @<:@default=no@:>@]),
+ [lyrics_screen="$enableval"],
+ [lyrics_screen=no])
+if test "x$lyrics_screen" = "xyes" ; then
+ AC_DEFINE(ENABLE_LYRICS_SCREEN, 1, [Enable lyrics screen])
fi
+AM_CONDITIONAL(ENABLE_LYRICS_SCREEN, test x$lyrics_screen = xyes)
+
+AC_MSG_RESULT([$lyrics_screen])
+
+AC_ARG_WITH([lyrics-plugin-dir],
+ AC_HELP_STRING([[--with-lyrics-plugin-dir[=DIRECTORY]]],
+ [Directory where lyrics plugins are stored @<:@default=PREFIX/lib/ncmpc/lyrics@:>@]),
+ [lyrics_plugin_dir=$withval],
+ [lyrics_plugin_dir=""])
+if test "x${lyrics_plugin_dir}" = "x"; then
+ if test "x${prefix}" = "xNONE"; then
+ lyrics_plugin_dir="${ac_default_prefix}/lib/ncmpc/lyrics"
+ else
+ lyrics_plugin_dir="${prefix}/lib/ncmpc/lyrics"
+ fi
+fi
+AC_DEFINE_UNQUOTED([LYRICS_PLUGIN_DIR], ["$lyrics_plugin_dir"],
+ [Directory to search for lyrics plugins])
+AC_SUBST(lyrics_plugin_dir)
+
dnl Default host
AC_MSG_CHECKING([for default MPD host])
AC_ARG_WITH([default-host],
[DEFAULT_TIMEDISPLAY_TYPE="elapsed"])
AC_MSG_RESULT([$DEFAULT_TIMEDISPLAY_TYPE])
AC_DEFINE_UNQUOTED([DEFAULT_TIMEDISPLAY_TYPE], ["$DEFAULT_TIMEDISPLAY_TYPE"], [Default way to display time, either 'elapsed' or 'remaining'])
-
-AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
+AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in po/Makefile])
AC_OUTPUT
-