From: Max Kellermann Date: Wed, 19 Jul 2017 23:37:50 +0000 (+0200) Subject: build with Meson instead of autotools X-Git-Tag: v0.28~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7bcbdaab4f17e0289758dddc268a21eb17c99369;p=ncmpc.git build with Meson instead of autotools --- diff --git a/.gitignore b/.gitignore index 5076739..14d88d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,4 @@ -.deps -.dirstamp -.stgit-* -*.o +.stgit* *~ -*.tar.* -configure -aclocal.m4 -*.cache -*.log -*.status -config.h -config.h.in -Makefile -Makefile.in -po/Makefile.in.in -po/POTFILES -po/*.gmo -po/.pot -mkinstalldirs -stamp-* -src/ncmpc -src/ncmpc-tiny -build -test/run_hscroll - -doc/doxygen.conf -doc/api/ +/output/ diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 04cea2a..0000000 --- a/INSTALL +++ /dev/null @@ -1,31 +0,0 @@ -ncmpc INSTALL -============= - -Requirements ------------- - - * a C99 compliant compiler (e.g. gcc) - * libmpdclient 2.9 - * ncurses (ncursesw for unicode / wide character support) - * GLib 2.30 - - -Configure and compile ---------------------- - -Download and unpack the source code: - - tar xjf ncmpc-x.y.z.tar.bz2 - cd ncmpc-x.y.z - -Run "./configure" (or "./autogen.sh" if you cloned from git): - - ./configure - -The configure option "--help" lists all available compile time -options. - -Compile and install: - - make - sudo make install diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 93b9257..0000000 --- a/Makefile.am +++ /dev/null @@ -1,233 +0,0 @@ -SUBDIRS = \ - po - -ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = foreign 1.11 dist-xz subdir-objects - -AM_CPPFLAGS = \ - $(CURSES_CFLAGS) \ - $(LIBMPDCLIENT_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(LIBLIRCCLIENT_CFLAGS) \ - -DLOCALE_DIR=\""$(datadir)/locale"\"\ - -DSYSCONFDIR=\""$(sysconfdir)"\" - -bin_PROGRAMS = src/ncmpc - -src_ncmpc_LDADD = \ - $(CURSES_LIBS) \ - $(LIBMPDCLIENT_LIBS) \ - $(GLIB_LIBS) \ - $(LIBLIRCCLIENT_LIBS) - -src_ncmpc_SOURCES = \ - src/Compiler.h \ - src/ncmpc.h \ - src/defaults.h \ - src/ncmpc_curses.h \ - src/i18n.h \ - src/main.c \ - src/gidle.c src/gidle.h \ - src/mpdclient.c src/mpdclient.h \ - src/callbacks.c src/callbacks.h \ - src/playlist.c src/playlist.h \ - src/filelist.c src/filelist.h \ - src/options.c src/options.h \ - src/command.c src/command.h \ - src/keyboard.c src/keyboard.h \ - src/ncfix.h \ - src/ncu.c src/ncu.h \ - src/player_command.c src/player_command.h \ - src/title_bar.c src/title_bar.h \ - src/progress_bar.c src/progress_bar.h \ - src/status_bar.c src/status_bar.h \ - src/screen.c src/screen.h \ - src/screen_interface.h \ - src/screen_init.c \ - src/screen_paint.c \ - src/screen_utils.c src/screen_utils.h \ - src/screen_status.c src/screen_status.h \ - src/screen_list.c src/screen_list.h \ - src/screen_find.c src/screen_find.h \ - src/screen_client.c src/screen_client.h \ - src/screen_queue.c src/screen_queue.h \ - src/screen_browser.c src/screen_browser.h \ - src/screen_file.c src/screen_file.h \ - src/list_window.c src/list_window.h \ - src/save_playlist.c src/save_playlist.h \ - src/paint.h \ - src/song_paint.c src/song_paint.h \ - src/colors.c src/colors.h \ - src/charset.c src/charset.h \ - src/window.h \ - src/wreadln.c src/wreadln.h \ - src/strfsong.c src/strfsong.h \ - src/time_format.c src/time_format.h \ - src/utils.c src/utils.h - -if ENABLE_ASYNC_CONNECT -src_ncmpc_SOURCES += \ - src/net/types.h \ - src/net/socket.c src/net/socket.h \ - src/net/resolver.c src/net/resolver.h \ - src/net/async_connect.c src/net/async_connect.h \ - src/net/async_rconnect.c src/net/async_rconnect.h \ - src/aconnect.c src/aconnect.h -endif - -# -# Windows resource file -# - -src/win/ncmpc_win32_rc.$(OBJEXT): src/win/ncmpc_win32_rc.rc - $(WINDRES) -i $< -o $@ - -if HAVE_WINDOWS -noinst_DATA = src/win/ncmpc_win32_rc.rc - -src_ncmpc_DEPENDENCIES = src/win/ncmpc_win32_rc.$(OBJEXT) -src_ncmpc_LDFLAGS = -Wl,src/win/ncmpc_win32_rc.$(OBJEXT) -else -src_ncmpc_SOURCES += src/signals.c src/signals.h -endif - -if NCMPC_MINI -else -src_ncmpc_SOURCES += \ - src/db_completion.c src/db_completion.h \ - src/xterm_title.c src/xterm_title.h \ - src/hscroll.c src/hscroll.h \ - src/match.c src/match.h \ - src/conf.c src/conf.h -endif - -if ENABLE_HELP_SCREEN -src_ncmpc_SOURCES += src/screen_help.c src/screen_help.h -endif - -if ENABLE_ARTIST_SCREEN -src_ncmpc_SOURCES += src/screen_artist.c src/screen_artist.h -endif - -if ENABLE_SEARCH_SCREEN -src_ncmpc_SOURCES += src/screen_search.c src/screen_search.h -endif - -if ENABLE_SONG_SCREEN -src_ncmpc_SOURCES += src/screen_song.c src/screen_song.h -endif - -if ENABLE_KEYDEF_SCREEN -src_ncmpc_SOURCES += src/screen_keydef.c src/screen_keydef.h -endif - -if ENABLE_PLUGIN_LIBRARY -src_ncmpc_SOURCES += src/plugin.c src/plugin.h -endif - -if ENABLE_SCREEN_TEXT -src_ncmpc_SOURCES += src/screen_text.c src/screen_text.h -endif - -if ENABLE_LYRICS_SCREEN -src_ncmpc_SOURCES += \ - src/screen_lyrics.c src/screen_lyrics.h \ - src/lyrics.c src/lyrics.h -endif - -if ENABLE_OUTPUTS_SCREEN -src_ncmpc_SOURCES += src/screen_outputs.c src/screen_outputs.h -endif - -if ENABLE_CHAT_SCREEN -src_ncmpc_SOURCES += src/screen_chat.c src/screen_chat.h -endif - -if ENABLE_LIRC -src_ncmpc_SOURCES += src/lirc.c src/lirc.h -endif - - -# build the smallest possible ncmpc binary -src/ncmpc-tiny: $(filter-out %.h,$(src_ncmpc_SOURCES)) - $(COMPILE) --combine -fwhole-program $(src_ncmpc_LDFLAGS) $(src_ncmpc_LDADD) $(LIBS) $^ -o $@ - strip --strip-all $@ - -CLEANFILES = src/ncmpc-tiny - -# -# test suite -# - -check_PROGRAMS = \ - test/run_hscroll - -test_run_hscroll_SOURCES = test/run_hscroll.c src/hscroll.c src/charset.c -test_run_hscroll_CPPFLAGS = -I$(srcdir)/src $(AM_CPPFLAGS) -test_run_hscroll_LDADD = $(CURSES_LIBS) $(GLIB_LIBS) - -# -# sparse -# - -SPARSE = sparse -SPARSE_FLAGS = -Wdecl -Wdefault-bitfield-sign -Wdo-while -Wenum-mismatch \ - -Wnon-pointer-null -Wptr-subtraction-blows -Wreturn-void \ - -Wshadow -Wtypesign \ - -D__transparent_union__=unused - -sparse-check: - $(SPARSE) -I. -I/usr/lib/gcc/$(shell gcc -dumpmachine)/4.3/include -I/usr/lib/gcc/$(shell gcc -dumpmachine)/4.3/include-fixed $(AM_CPPFLAGS) $(SPARSE_FLAGS) $(src_ncmpc_SOURCES) - -# -# lyrics plugins -# - -lyrics_plugins = lyrics/10-hd.sh lyrics/20-lyricwiki.rb - -if ENABLE_LYRICS_SCREEN - -lyricsdir = $(lyrics_plugin_dir) -lyrics_SCRIPTS = $(lyrics_plugins) - -endif - -# -# Documentation -# - -doc_DATA = \ - doc/config.sample doc/keys.sample doc/ncmpc.lirc \ - AUTHORS NEWS README.rst -man_MANS = doc/ncmpc.1 - -if ENABLE_DOCUMENTATION -doc/api/html/index.html: doc/doxygen.conf - @mkdir -p $(@D) - $(DOXYGEN) $< - -all-local: doc/api/html/index.html - -clean-local: - rm -rf doc/api - -# copied from MPD, disabled --jn -#--------------------------------------- -#install-data-local: doc/api/html/index.html -# $(mkinstalldirs) $(DESTDIR)$(docdir)/api/html -# $(INSTALL_DATA) -c -m 644 doc/api/html/*.* \ -# $(DESTDIR)$(docdir)/api/html -# -#uninstall-local: -# rm -f $(DESTDIR)$(docdir)/api/html/*.* -#--------------------------------------- -endif - -# -# Distribution -# - -EXTRA_DIST = autogen.sh \ - $(lyrics_plugins) \ - $(man_MANS) $(doc_DATA) doc/doxygen.conf \ - src/win/ncmpc_win32_rc.rc.in diff --git a/NEWS b/NEWS index 59ca615..89bb4a4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ncmpc 0.28 - not yet released * fix crash on lyrics screen * fix memory leak +* build with Meson instead of autotools ncmpc 0.27 - (2017-03-25) * work around connect failure if /var/run/mpd/socket does not exist diff --git a/README.rst b/README.rst index 12f57d1..4cc7da3 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,22 @@ ncmpc is a curses client for the `Music Player Daemon How to compile and install ncmpc -------------------------------- -See the `INSTALL `__ file. +You need: + +- a C99 compliant compiler (e.g. gcc) +- libmpdclient 2.9 +- `GLib 2.30 `__ +- `ncurses `__ +- `Meson 0.37 `__ and `Ninja `__ + +Run ``meson``: + + meson . output + +Compile and install:: + + ninja -C output + ninja -C output install Usage diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index a639131..0000000 --- a/autogen.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -e - -rm -rf config.cache build -mkdir build - -# create po/Makefile.in.in -glib-gettextize --force --copy - -# add aclocal.m4 to current dir -echo "aclocal..." -aclocal -I m4 - -# This generates the configure script from configure.in -echo "autoconf..." -autoconf - -echo "autoheader..." -autoheader - -# Generate Makefile.in from Makefile.am -echo "automake..." -automake --add-missing $AUTOMAKE_FLAGS - - -# configure -if test x$NOCONFIGURE = x; then - echo "./configure $*" - ./configure $* -fi diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 0000000..ffec70f --- /dev/null +++ b/build/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +cd `dirname $0`/.. +for i in output/*/build.ninja; do + ninja -C `dirname "$i"` "$@" +done diff --git a/build/configure.py b/build/configure.py new file mode 100755 index 0000000..a120e42 --- /dev/null +++ b/build/configure.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 + +import os, sys, shutil, subprocess + +global_options = ['--werror'] + +flavors = { + 'debug': { + 'options': [ + '-Ddocumentation=true', + '-Dcurses=ncursesw', + '-Dmouse=true', + '-Dlirc=true', + '-Dlyrics_screen=true', + '-Dchat_screen=true', + ], + }, + + 'release': { + 'options': [ + '--buildtype', 'release', + '-Db_ndebug=true', + '-Db_lto=true', + '-Dcurses=ncursesw', + '-Dmouse=true', + ], + }, + + 'mini': { + 'options': [ + '--buildtype', 'minsize', + '-Db_ndebug=true', + '-Db_lto=true', + '-Dlirc=false', + '-Dcurses=ncurses', + '-Dcolor=false', + '-Dmouse=false', + '-Dmultibyte=false', + '-Dlocale=false', + '-Dnls=false', + '-Dtcp=false', + '-Dasync_connect=false', + '-Dmini=true', + ], + }, +} + +project_name = 'ncmpc' +source_root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]) or '.', '..')) +output_path = os.path.join(source_root, 'output') +prefix_root = '/usr/local/stow' + +for name, data in flavors.items(): + print(name) + build_root = os.path.join(output_path, name) + + env = os.environ.copy() + if 'env' in data: + env.update(data['env']) + + cmdline = [ + 'meson', source_root, build_root, + ] + global_options + + if 'options' in data: + cmdline.extend(data['options']) + + prefix = os.path.join(prefix_root, project_name + '-' + name) + + if 'arch' in data: + prefix = os.path.join(prefix, data['arch']) + cmdline += ('--cross-file', os.path.join(source_root, 'build', name, 'cross-file.txt')) + + cmdline += ('--prefix', prefix) + + try: + shutil.rmtree(build_root) + except: + pass + + subprocess.check_call(cmdline, env=env) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index c82397c..0000000 --- a/configure.ac +++ /dev/null @@ -1,470 +0,0 @@ -AC_PREREQ(2.60) -AC_INIT(ncmpc, 0.28, max@duempel.org) - -VERSION_MAJOR=0 -VERSION_MINOR=28 -VERSION_REVISION=0 -VERSION_EXTRA=0 - -AC_CONFIG_SRCDIR([src/main.c]) -AC_CONFIG_AUX_DIR(build) -AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects]) -AM_SILENT_RULES -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - - -dnl Check for programs -AC_PROG_CC_C99 -AC_PROG_INSTALL -AX_WITH_CURSES - -AS_IF([ test "x$ax_cv_curses" = xno ], - [AC_MSG_ERROR([No curses support detected.]) - ]) - -dnl ======================================================= -dnl initialize variables -dnl ======================================================= - -dnl i18n -ALL_LINGUAS=`grep -v '^\#' $srcdir/po/LINGUAS` - -set -- $CFLAGS - - -dnl -dnl ncmpc-mini -dnl - -AC_ARG_ENABLE(mini, - AS_HELP_STRING([--enable-mini], - [Build ncmpc-mini, i.e. without all optional features @<:@default=no@:>@]),, - [enable_mini=no]) - -AM_CONDITIONAL(NCMPC_MINI, test x$enable_mini = xyes) -if test "x$enable_mini" = xyes; then - AC_DEFINE([NCMPC_MINI], [1], [Build ncmpc-mini, which disables lots of features]) - auto=no - disable_mini=no - auto_mini=no -else - auto=auto - disable_mini=yes - auto_mini=auto -fi - -AC_CANONICAL_HOST - -case "$host_os" in -mingw32* | windows*) - LIBS="$LIBS -lws2_32" - - AC_CONFIG_FILES([ - src/win/ncmpc_win32_rc.rc - ]) - AC_CHECK_TOOL(WINDRES, windres) - HAVE_WINDOWS=1 - ;; -*) - AC_CHECK_FUNC([socket], - [], - [AC_CHECK_LIB([socket],[socket],[LIBS="$LIBS -lsocket"], - [AC_MSG_ERROR(No UNIX socket API found)]) - ]) - - AC_CHECK_FUNC([gethostbyname], - [], - [AC_CHECK_LIB([nsl],[gethostbyname],[LIBS="$LIBS -lnsl"], - [AC_MSG_ERROR(No UNIX gethostbyname API found)]) - ]) - - HAVE_WINDOWS=0 -esac -AM_CONDITIONAL([HAVE_WINDOWS], [test $HAVE_WINDOWS -eq 1]) - -dnl multi-byte character support - -AC_ARG_ENABLE([multibyte], - AS_HELP_STRING([--disable-multibyte], - [Disable multibyte character support @<:@default=yes@:>@]),, - [enable_multibyte=$disable_mini]) - -if test x$enable_multibyte = xyes; then - AC_DEFINE([ENABLE_MULTIBYTE], [1], [Enable multibyte character support]) -else - if test "x$ax_cv_curses_enhanced" = xyes; then - AC_MSG_WARN(wide characters without multibyte characters makes little sense) - fi -fi - -dnl Check for GLib -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30],, - [AC_MSG_ERROR([glib 2.30 is required])]) - -dnl Check for libmpdclient 2.9 -PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.9],, - [AC_MSG_ERROR([libmpdclient2 is required])]) - -dnl i18n - -AC_ARG_ENABLE([locale], - AS_HELP_STRING([--disable-locale], - [Disable locale support @<:@default=auto@:>@]),, - [enable_locale=$auto_mini]) - -if test x$enable_locale = xyes; then - AC_CHECK_HEADER([locale.h],, - [AC_MSG_ERROR(locale.h is unavailable)]) -fi - -if test x$enable_locale = xauto; then - AC_CHECK_HEADER([locale.h], - [enable_locale=yes], - [enable_locale=no]) -fi - -if test x$enable_locale = xyes; then - AC_DEFINE([ENABLE_LOCALE], [1], [Locale support is enabled]) -fi - -if test x$enable_mini != xyes; then - AM_NLS -else - USE_NLS=no -fi - -if test x$USE_NLS = xyes; then - AM_GLIB_GNU_GETTEXT - GETTEXT_PACKAGE=$PACKAGE - AC_SUBST(GETTEXT_PACKAGE) - AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], - ["${GETTEXT_PACKAGE}"], - [gettext domain]) - USE_NLS=$gt_cv_have_gettext - if test x$USE_NLS != xyes; then - AC_MSG_WARN([NLS support disabled!]) - fi -else - AM_PO_SUBDIRS -fi - -dnl Networking - -AC_ARG_ENABLE(tcp, - AS_HELP_STRING([--disable-tcp], - [Disable TCP support @<:@default=enabled@:>@]),, - [enable_tcp=$disable_mini]) -if test "x$enable_tcp" = xyes; then - AC_DEFINE([ENABLE_TCP], 1, [Define to enable TCP support]) - AC_SEARCH_LIBS([gethostbyname], [nsl]) - AC_CHECK_FUNCS([getaddrinfo]) -fi - -AC_ARG_ENABLE([async-connect], - AS_HELP_STRING([--enable-async-connect], - [Disable asynchronous connect @<:@default=yes@:>@]),, - [enable_async_connect=$disable_mini]) -AM_CONDITIONAL(ENABLE_ASYNC_CONNECT, test x$enable_async_connect = xyes) -if test "x$enable_async_connect" = xyes; then - AC_DEFINE([ENABLE_ASYNC_CONNECT], [1], [Enable asynchronous connect?]) -fi - -dnl enable colors -AC_ARG_ENABLE([colors], - AS_HELP_STRING([--enable-colors], - [Enable color support]),, - [enable_colors=auto]) -AC_MSG_CHECKING([whether to include color support]) -AS_IF([ test "x$enable_colors" = xyes || test "x$enable_colors" = xauto ], - [AS_IF([ test "x$disable_mini" = xyes], - [AS_IF([ test "x$ax_cv_curses_color" = xyes ], - [AC_MSG_RESULT([yes]) - AC_DEFINE([ENABLE_COLORS], [1], [Enable color support])], - [AS_IF([ test "x$enable_colors" = xyes ], - AC_MSG_ERROR(["No color support found in curses library"]) - AC_MSG_RESULT([no]), - AC_MSG_RESULT([no]) - ) - ]) - ], - [AC_MSG_RESULT([no]) - AC_MSG_WARN(["Colors disabled due to mini mode being enabled."])] - )], - [AC_MSG_RESULT([no])]) - -dnl test for LIRC support - -AC_ARG_ENABLE([lirc], - AS_HELP_STRING([--enable-lirc], - [Enable LIRC support]),, - [enable_lirc=no]) -if test x$enable_lirc = xyes; then - PKG_CHECK_MODULES([LIBLIRCCLIENT], [lirc],, - [PKG_CHECK_MODULES([LIBLIRCCLIENT], [liblircclient0],, - [AC_MSG_ERROR([lirc not found])] - )] - ) - - AC_DEFINE([ENABLE_LIRC], [1], [Enable LIRC support]) -fi - -AM_CONDITIONAL(ENABLE_LIRC, test x$enable_lirc = xyes) - - -dnl Optional screen - help screen -AC_MSG_CHECKING([whether to include the help screen]) -AC_ARG_ENABLE([help-screen], - AS_HELP_STRING([--enable-help-screen], - [Enable the help screen @<:@default=yes@:>@]),, - [enable_help_screen=$disable_mini]) -AC_MSG_RESULT([$enable_help_screen]) -if test "x$enable_help_screen" = "xyes" ; then - AC_DEFINE(ENABLE_HELP_SCREEN, 1, [Enable the help screen]) -fi - -AM_CONDITIONAL(ENABLE_HELP_SCREEN, test x$enable_help_screen = xyes) - -dnl Optional - curses getmouse support - -MPD_WITH_LIBRARY([CURSES], - [AC_CHECK_FUNC([getmouse], - [ax_cv_curses_mouse=yes], - [ax_cv_curses_mouse=no])]) - -AC_ARG_ENABLE([mouse], - AS_HELP_STRING([--enable-mouse], - [Enable curses getmouse support @<:@default=yes@:>@]),, - [enable_mouse=auto]) - -AC_MSG_CHECKING([whether to include mouse support]) - -AS_IF([ test "x$enable_mouse" = xyes || test "x$enable_mouse" = xauto ], - [AS_IF([ test "x$disable_mini" = xyes], - [AS_IF([ test "x$ax_cv_curses_mouse" = xyes ], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_GETMOUSE], [1], [Enable mouse support])], - [AC_MSG_RESULT([no]) - AS_IF([ test "x$enable_mouse" = xyes ], - [AC_MSG_ERROR(["No mouse support found in curses library"]) - ]) - ]) - ], - [AC_MSG_RESULT([no]) - AC_MSG_WARN("Mouse disabled due to mini mode being enabled.")] - )], - [AC_MSG_RESULT([no])]) - -dnl Optional screen - artist -AC_MSG_CHECKING([whether to include the artist screen]) -AC_ARG_ENABLE([artist-screen], - AS_HELP_STRING([--enable-artist-screen], - [Enable artist screen @<:@default=yes@:>@]),, - [enable_artist_screen=$disable_mini]) -AC_MSG_RESULT([$enable_artist_screen]) -if test "x$enable_artist_screen" = "xyes" ; then - AC_DEFINE(ENABLE_ARTIST_SCREEN, 1, [Enable artist screen]) -fi - -AM_CONDITIONAL(ENABLE_ARTIST_SCREEN, test x$enable_artist_screen = xyes) - -dnl Optional screen - search -AC_MSG_CHECKING([whether to include the search screen]) -AC_ARG_ENABLE([search-screen], - AS_HELP_STRING([--enable-search-screen], - [Enable search screen (EXPERIMENTAL) @<:@default=yes@:>@]),, - [enable_search_screen=$disable_mini]) -AC_MSG_RESULT([$enable_search_screen]) -if test "x$enable_search_screen" = "xyes" ; then - AC_DEFINE(ENABLE_SEARCH_SCREEN, 1, [Enable search screen]) -fi - -AM_CONDITIONAL(ENABLE_SEARCH_SCREEN, test x$enable_search_screen = xyes) - -dnl Optional screen - song viewer -AC_MSG_CHECKING([whether to include the song viewer screen]) -AC_ARG_ENABLE([song-screen], - AS_HELP_STRING([--enable-song-screen], - [Enable song viewer screen @<:@default=yes@:>@]),, - [enable_song_screen=$disable_mini]) -AC_MSG_RESULT([$enable_song_screen]) -if test "x$enable_song_screen" = "xyes" ; then - AC_DEFINE(ENABLE_SONG_SCREEN, 1, [Enable song viewer screen]) -fi - -AM_CONDITIONAL(ENABLE_SONG_SCREEN, test x$enable_song_screen = xyes) - -dnl Optional screen - key editor -AC_MSG_CHECKING([whether to include the key editor screen]) -AC_ARG_ENABLE([key-screen], - AS_HELP_STRING([--enable-key-screen], - [Enable key editor screen @<:@default=yes@:>@]),, - [enable_key_screen=$disable_mini]) -AC_MSG_RESULT([$enable_key_screen]) -if test "x$enable_key_screen" = "xyes" ; then - AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable key editor screen]) -fi - -AM_CONDITIONAL(ENABLE_KEYDEF_SCREEN, test x$enable_key_screen = xyes) - -dnl Optional screen - lyrics -AC_MSG_CHECKING([whether to include the lyrics screen]) -AC_ARG_ENABLE([lyrics-screen], - AS_HELP_STRING([--enable-lyrics-screen], - [Enable lyrics screen @<:@default=no@:>@]),, - [enable_lyrics_screen=no]) - -case "$host_os" in -mingw32* | windows*) - AS_IF([ test "x$enable_lyrics_screen" = xyes ], - [AC_MSG_ERROR([Lyrics screen is not yet compatible with windows.]) - ]) -esac - -if test "x$enable_lyrics_screen" = "xyes" ; then - AC_DEFINE(ENABLE_LYRICS_SCREEN, 1, [Enable lyrics screen]) -fi - -AM_CONDITIONAL(ENABLE_LYRICS_SCREEN, test x$enable_lyrics_screen = xyes) - -AC_MSG_RESULT([$enable_lyrics_screen]) - -AC_ARG_WITH([lyrics-plugin-dir], - AS_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) - -AM_CONDITIONAL(ENABLE_PLUGIN_LIBRARY, test x$enable_lyrics_screen = xyes) - -dnl Optional screen - outputs -AC_MSG_CHECKING([whether to include the outputs screen]) -AC_ARG_ENABLE([outputs-screen], - AS_HELP_STRING([--enable-outputs-screen], - [Enable outputs screen @<:@default=yes@:>@]),, - [enable_outputs_screen=$disable_mini]) - -if test "x$enable_outputs_screen" = "xyes" ; then - AC_DEFINE(ENABLE_OUTPUTS_SCREEN, 1, [Enable outputs screen]) -fi - -AM_CONDITIONAL(ENABLE_OUTPUTS_SCREEN, test x$enable_outputs_screen = xyes) -AC_MSG_RESULT([$enable_outputs_screen]) - - -dnl Optional screen - client-to-client chat -AC_MSG_CHECKING([whether to include the chat screen]) -AC_ARG_ENABLE([chat-screen], - AC_HELP_STRING([--enable-chat-screen], - [Enable chat screen @<:@default=no@:>@]),, - [enable_chat_screen=no]) -if test "x$enable_chat_screen" = "xauto"; then - enable_chat_screen=yes -fi -AC_MSG_RESULT([$enable_chat_screen]) -if test "x$enable_chat_screen" = "xyes" ; then - AC_DEFINE(ENABLE_CHAT_SCREEN, 1, [Enable chat screen]) -fi -AM_CONDITIONAL(ENABLE_CHAT_SCREEN, test x$enable_chat_screen = xyes) - -AM_CONDITIONAL(ENABLE_SCREEN_TEXT, - test x$enable_lyrics_screen = xyes -o x$enable_chat_screen = xyes) - -dnl -dnl Windows OS Resource File -dnl -AC_SUBST(VERSION_MAJOR) -AC_SUBST(VERSION_MINOR) -AC_SUBST(VERSION_REVISION) -AC_SUBST(VERSION_EXTRA) - -dnl -dnl build options -dnl - -AC_ARG_ENABLE(werror, - AS_HELP_STRING([--enable-werror], - [Treat warnings as errors @<:@default=no@:>@]),, - enable_werror=no) - -if test "x$enable_werror" = xyes; then - AX_APPEND_COMPILE_FLAGS([-Werror]) -fi - -AC_ARG_ENABLE(debug, - AS_HELP_STRING([--enable-debug], - [Enable debugging @<:@default=no@:>@]),, - enable_debug=no) - -if test "x$enable_debug" = xno; then - AM_CFLAGS="$AM_CFLAGS -DNDEBUG" - - AX_APPEND_COMPILE_FLAGS([-ffunction-sections]) - AX_APPEND_COMPILE_FLAGS([-fdata-sections]) - - AX_APPEND_LINK_FLAGS([-Wl,--gc-sections]) -fi - -AC_ARG_ENABLE(test, - AS_HELP_STRING([--enable-test], - [build the test programs @<:@default=no@:>@]),, - enable_test=$enable_debug) - -AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes) - -dnl -dnl autogenerated documentation -dnl - -AC_ARG_ENABLE(documentation, - AS_HELP_STRING([--enable-documentation], - [build doxygen documentation @<:@default=no@:>@]),, - enable_documentation=no) - -if test x$enable_documentation = xyes; then - AC_PATH_PROG(DOXYGEN, doxygen) - if test x$DOXYGEN = x; then - AC_MSG_ERROR([doxygen not found]) - fi - AC_SUBST(DOXYGEN) -fi - -AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes) - -dnl -dnl CFLAGS -dnl - -AC_SUBST(AM_CFLAGS) - -AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden]) -AX_APPEND_COMPILE_FLAGS([-ffast-math]) -AX_APPEND_COMPILE_FLAGS([-ftree-vectorize]) - -AX_APPEND_COMPILE_FLAGS([-Wall]) -AX_APPEND_COMPILE_FLAGS([-Wextra]) -AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations]) -AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes]) -AX_APPEND_COMPILE_FLAGS([-Wshadow]) -AX_APPEND_COMPILE_FLAGS([-Wpointer-arith]) -AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes]) -AX_APPEND_COMPILE_FLAGS([-Wcast-qual]) -AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) - - -dnl -dnl Generate output files -dnl - -AC_CONFIG_FILES([Makefile po/Makefile.in po/Makefile]) -AC_OUTPUT(doc/doxygen.conf) diff --git a/doc/doxygen.conf.in b/doc/doxygen.conf.in index f65b93d..d6faeee 100644 --- a/doc/doxygen.conf.in +++ b/doc/doxygen.conf.in @@ -51,7 +51,7 @@ PROJECT_LOGO = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doc/api +OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..a65a8c2 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,16 @@ +dconf = configuration_data() +dconf.set('VERSION', meson.project_version()) +dconf.set('abs_top_srcdir', meson.source_root()) + +doxyfile = configure_file(input: 'doxygen.conf.in', + output: 'doxygen.conf', + configuration: dconf) + +datadir = join_paths(get_option('datadir'), 'doc', 'spede') + +html_target = custom_target('apidocs', + input: doxyfile, + output: 'html', + command: [doxygen, doxyfile], + install: true, + install_dir: docdir) diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 deleted file mode 100644 index 2bb27ef..0000000 --- a/m4/ax_append_compile_flags.m4 +++ /dev/null @@ -1,67 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# For every FLAG1, FLAG2 it is checked whether the compiler works with the -# flag. If it does, the flag is added FLAGS-VARIABLE -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. During the check the flag is always added to the -# current language's flags. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: This macro depends on the AX_APPEND_FLAG and -# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with -# AX_APPEND_LINK_FLAGS. -# -# LICENSE -# -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 5 - -AC_DEFUN([AX_APPEND_COMPILE_FLAGS], -[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) -AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) -for flag in $1; do - AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) -done -])dnl AX_APPEND_COMPILE_FLAGS diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 deleted file mode 100644 index 08f2e07..0000000 --- a/m4/ax_append_flag.m4 +++ /dev/null @@ -1,71 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) -# -# DESCRIPTION -# -# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space -# added in between. -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains -# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly -# FLAG. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 6 - -AC_DEFUN([AX_APPEND_FLAG], -[dnl -AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF -AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) -AS_VAR_SET_IF(FLAGS,[ - AS_CASE([" AS_VAR_GET(FLAGS) "], - [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], - [ - AS_VAR_APPEND(FLAGS,[" $1"]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) - ], - [ - AS_VAR_SET(FLAGS,[$1]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) -AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_APPEND_FLAG diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4 deleted file mode 100644 index fd70fc7..0000000 --- a/m4/ax_append_link_flags.m4 +++ /dev/null @@ -1,65 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# For every FLAG1, FLAG2 it is checked whether the linker works with the -# flag. If it does, the flag is added FLAGS-VARIABLE -# -# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is -# used. During the check the flag is always added to the linker's flags. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. -# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. -# -# LICENSE -# -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 5 - -AC_DEFUN([AX_APPEND_LINK_FLAGS], -[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) -AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) -for flag in $1; do - AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4]) -done -])dnl AX_APPEND_LINK_FLAGS diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 deleted file mode 100644 index ca36397..0000000 --- a/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,74 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 4 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 deleted file mode 100644 index eb01a6c..0000000 --- a/m4/ax_check_link_flag.m4 +++ /dev/null @@ -1,74 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the linker or gives an error. -# (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_LINK_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 4 - -AC_DEFUN([AX_CHECK_LINK_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $4 $1" - AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - LDFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_LINK_FLAGS diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4 deleted file mode 100644 index cae1111..0000000 --- a/m4/ax_require_defined.m4 +++ /dev/null @@ -1,37 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_REQUIRE_DEFINED(MACRO) -# -# DESCRIPTION -# -# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have -# been defined and thus are available for use. This avoids random issues -# where a macro isn't expanded. Instead the configure script emits a -# non-fatal: -# -# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found -# -# It's like AC_REQUIRE except it doesn't expand the required macro. -# -# Here's an example: -# -# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) -# -# LICENSE -# -# Copyright (c) 2014 Mike Frysinger -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 1 - -AC_DEFUN([AX_REQUIRE_DEFINED], [dnl - m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) -])dnl AX_REQUIRE_DEFINED diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4 deleted file mode 100644 index 9461eef..0000000 --- a/m4/ax_with_curses.m4 +++ /dev/null @@ -1,582 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_with_curses.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_WITH_CURSES -# -# DESCRIPTION -# -# This macro checks whether a SysV or X/Open-compatible Curses library is -# present, along with the associated header file. The NcursesW -# (wide-character) library is searched for first, followed by Ncurses, -# then the system-default plain Curses. The first library found is the -# one returned. Finding libraries will first be attempted by using -# pkg-config, and should the pkg-config files not be available, will -# fallback to combinations of known flags itself. -# -# The following options are understood: --with-ncursesw, --with-ncurses, -# --without-ncursesw, --without-ncurses. The "--with" options force the -# macro to use that particular library, terminating with an error if not -# found. The "--without" options simply skip the check for that library. -# The effect on the search pattern is: -# -# (no options) - NcursesW, Ncurses, Curses -# --with-ncurses --with-ncursesw - NcursesW only [*] -# --without-ncurses --with-ncursesw - NcursesW only [*] -# --with-ncursesw - NcursesW only [*] -# --with-ncurses --without-ncursesw - Ncurses only [*] -# --with-ncurses - NcursesW, Ncurses [**] -# --without-ncurses --without-ncursesw - Curses only -# --without-ncursesw - Ncurses, Curses -# --without-ncurses - NcursesW, Curses -# -# [*] If the library is not found, abort the configure script. -# -# [**] If the second library (Ncurses) is not found, abort configure. -# -# The following preprocessor symbols may be defined by this macro if the -# appropriate conditions are met: -# -# HAVE_CURSES - if any SysV or X/Open Curses library found -# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions -# HAVE_CURSES_COLOR - if library supports color (enhanced functions) -# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features -# HAVE_NCURSESW - if NcursesW (wide char) library is to be used -# HAVE_NCURSES - if the Ncurses library is to be used -# -# HAVE_CURSES_H - if is present and should be used -# HAVE_NCURSESW_H - if should be used -# HAVE_NCURSES_H - if should be used -# HAVE_NCURSESW_CURSES_H - if should be used -# HAVE_NCURSES_CURSES_H - if should be used -# -# (These preprocessor symbols are discussed later in this document.) -# -# The following output variables are defined by this macro; they are -# precious and may be overridden on the ./configure command line: -# -# CURSES_LIBS - library to add to xxx_LDADD -# CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS -# -# In previous versions of this macro, the flags CURSES_LIB and -# CURSES_CPPFLAGS were defined. These have been renamed, in keeping with -# AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should -# eventually supersede the use of AX_WITH_CURSES. Neither the library -# listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS, -# respectively CPPFLAGS, by default. You need to add both to the -# appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For -# example: -# -# prog_LDADD = @CURSES_LIBS@ -# prog_CPPFLAGS = @CURSES_CFLAGS@ -# -# If CURSES_LIBS is set on the configure command line (such as by running -# "./configure CURSES_LIBS=-lmycurses"), then the only header searched for -# is . If the user needs to specify an alternative path for a -# library (such as for a non-standard NcurseW), the user should use the -# LDFLAGS variable. -# -# The following shell variables may be defined by this macro: -# -# ax_cv_curses - set to "yes" if any Curses library found -# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present -# ax_cv_curses_color - set to "yes" if color functions present -# ax_cv_curses_obsolete - set to "yes" if obsolete features present -# -# ax_cv_ncursesw - set to "yes" if NcursesW library found -# ax_cv_ncurses - set to "yes" if Ncurses library found -# ax_cv_plaincurses - set to "yes" if plain Curses library found -# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" -# -# These variables can be used in your configure.ac to determine the level -# of support you need from the Curses library. For example, if you must -# have either Ncurses or NcursesW, you could include: -# -# AX_WITH_CURSES -# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then -# AC_MSG_ERROR([requires either NcursesW or Ncurses library]) -# fi -# -# If any Curses library will do (but one must be present and must support -# color), you could use: -# -# AX_WITH_CURSES -# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then -# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) -# fi -# -# Certain preprocessor symbols and shell variables defined by this macro -# can be used to determine various features of the Curses library. In -# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses -# library found conforms to the traditional SysV and/or X/Open Base Curses -# definition. Any working Curses library conforms to this level. -# -# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the -# library supports the X/Open Enhanced Curses definition. In particular, -# the wide-character types attr_t, cchar_t and wint_t, the functions -# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES -# are checked. The Ncurses library does NOT conform to this definition, -# although NcursesW does. -# -# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library -# supports color functions and macros such as COLOR_PAIR, A_COLOR, -# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the -# X/Open Base Curses definition, but are part of the Enhanced set of -# functions. The Ncurses library DOES support these functions, as does -# NcursesW. -# -# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the -# library supports certain features present in SysV and BSD Curses but not -# defined in the X/Open definition. In particular, the functions -# getattrs(), getcurx() and getmaxx() are checked. -# -# To use the HAVE_xxx_H preprocessor symbols, insert the following into -# your system.h (or equivalent) header file: -# -# #if defined HAVE_NCURSESW_CURSES_H -# # include -# #elif defined HAVE_NCURSESW_H -# # include -# #elif defined HAVE_NCURSES_CURSES_H -# # include -# #elif defined HAVE_NCURSES_H -# # include -# #elif defined HAVE_CURSES_H -# # include -# #else -# # error "SysV or X/Open-compatible Curses header file required" -# #endif -# -# For previous users of this macro: you should not need to change anything -# in your configure.ac or Makefile.am, as the previous (serial 10) -# semantics are still valid. However, you should update your system.h (or -# equivalent) header file to the fragment shown above. You are encouraged -# also to make use of the extended functionality provided by this version -# of AX_WITH_CURSES, as well as in the additional macros -# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. -# -# LICENSE -# -# Copyright (c) 2009 Mark Pulford -# Copyright (c) 2009 Damian Pietras -# Copyright (c) 2012 Reuben Thomas -# Copyright (c) 2011 John Zaitseff -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 17 - -# internal function to factorize common code that is used by both ncurses -# and ncursesw -AC_DEFUN([_FIND_CURSES_FLAGS], [ - AC_MSG_CHECKING([for $1 via pkg-config]) - - AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS]) - _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1]) - _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1]) - - AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[ - AC_MSG_RESULT([no]) - # No suitable .pc file found, have to find flags via fallback - AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [ - AS_ECHO() - pkg_cv__ax_cv_$1_libs="-l$1" - pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS" - LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" - CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags" - - AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs]) - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], - [ - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs]) - AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[ - ax_cv_$1=yes - ],[ - AC_MSG_RESULT([no]) - m4_if( - [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"], - [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"] - ) - LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" - - AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs]) - AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[ - ax_cv_$1=yes - ],[ - ax_cv_$1=no - ]) - ]) - ],[ - ax_cv_$1=no - ]) - ]) - ],[ - AC_MSG_RESULT([yes]) - # Found .pc file, using its information - LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" - CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags" - ax_cv_$1=yes - ]) -]) - -AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) -AC_DEFUN([AX_WITH_CURSES], [ - AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses]) - AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw]) - AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], - [force the use of Ncurses or NcursesW])], - [], [with_ncurses=check]) - AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], - [do not use NcursesW (wide character support)])], - [], [with_ncursesw=check]) - - ax_saved_LIBS=$LIBS - ax_saved_CPPFLAGS=$CPPFLAGS - - AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], - [ax_with_plaincurses=no], [ax_with_plaincurses=check]) - - ax_cv_curses_which=no - - # Test for NcursesW - AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [ - _FIND_CURSES_FLAGS([ncursesw]) - - AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ - AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) - ]) - - AS_IF([test "x$ax_cv_ncursesw" = xyes], [ - ax_cv_curses=yes - ax_cv_curses_which=ncursesw - CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs" - CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags" - AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) - AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) - - AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@define _XOPEN_SOURCE_EXTENDED 1 - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - attr_t d = WA_NORMAL; - cchar_t e; - wint_t f; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - wattr_set(stdscr, d, 0, NULL); - wget_wch(stdscr, &f); - ]])], - [ax_cv_header_ncursesw_curses_h=yes], - [ax_cv_header_ncursesw_curses_h=no]) - ]) - AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ - ax_cv_curses_enhanced=yes - ax_cv_curses_color=yes - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) - ]) - - AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@define _XOPEN_SOURCE_EXTENDED 1 - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - attr_t d = WA_NORMAL; - cchar_t e; - wint_t f; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - wattr_set(stdscr, d, 0, NULL); - wget_wch(stdscr, &f); - ]])], - [ax_cv_header_ncursesw_h=yes], - [ax_cv_header_ncursesw_h=no]) - ]) - AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ - ax_cv_curses_enhanced=yes - ax_cv_curses_color=yes - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) - ]) - - AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@define _XOPEN_SOURCE_EXTENDED 1 - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - attr_t d = WA_NORMAL; - cchar_t e; - wint_t f; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - wattr_set(stdscr, d, 0, NULL); - wget_wch(stdscr, &f); - ]])], - [ax_cv_header_ncurses_h_with_ncursesw=yes], - [ax_cv_header_ncurses_h_with_ncursesw=no]) - ]) - AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ - ax_cv_curses_enhanced=yes - ax_cv_curses_color=yes - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) - ]) - - AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [ - AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) - ]) - ]) - ]) - unset pkg_cv__ax_cv_ncursesw_libs - unset pkg_cv__ax_cv_ncursesw_cppflags - - # Test for Ncurses - AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ - _FIND_CURSES_FLAGS([ncurses]) - - AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ - AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) - ]) - - AS_IF([test "x$ax_cv_ncurses" = xyes], [ - ax_cv_curses=yes - ax_cv_curses_which=ncurses - CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs" - CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags" - AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) - AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) - - AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - ]])], - [ax_cv_header_ncurses_curses_h=yes], - [ax_cv_header_ncurses_curses_h=no]) - ]) - AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ - ax_cv_curses_color=yes - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) - ]) - - AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - ]])], - [ax_cv_header_ncurses_h=yes], - [ax_cv_header_ncurses_h=no]) - ]) - AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ - ax_cv_curses_color=yes - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) - ]) - - AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ - AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) - ]) - ]) - ]) - unset pkg_cv__ax_cv_ncurses_libs - unset pkg_cv__ax_cv_ncurses_cppflags - - # Test for plain Curses (or if CURSES_LIBS was set by user) - AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ - AS_IF([test "x$CURSES_LIBS" != x], [ - LIBS="$ax_saved_LIBS $CURSES_LIBS" - ], [ - LIBS="$ax_saved_LIBS -lcurses" - ]) - - AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], - [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) - ]) - - AS_IF([test "x$ax_cv_plaincurses" = xyes], [ - ax_cv_curses=yes - ax_cv_curses_which=plaincurses - AS_IF([test "x$CURSES_LIBS" = x], [ - CURSES_LIBS="-lcurses" - ]) - AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) - - # Check for base conformance (and header file) - - AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - initscr(); - ]])], - [ax_cv_header_curses_h=yes], - [ax_cv_header_curses_h=no]) - ]) - AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ - AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if is present]) - - # Check for X/Open Enhanced conformance - - AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@define _XOPEN_SOURCE_EXTENDED 1 - @%:@include - @%:@ifndef _XOPEN_CURSES - @%:@error "this Curses library is not enhanced" - "this Curses library is not enhanced" - @%:@endif - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - attr_t d = WA_NORMAL; - cchar_t e; - wint_t f; - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - wattr_set(stdscr, d, 0, NULL); - wget_wch(stdscr, &f); - ]])], - [ax_cv_plaincurses_enhanced=yes], - [ax_cv_plaincurses_enhanced=no]) - ]) - AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ - ax_cv_curses_enhanced=yes - ax_cv_curses_color=yes - AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - ]) - - # Check for color functions - - AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@define _XOPEN_SOURCE_EXTENDED 1 - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - chtype c = COLOR_PAIR(1) & A_COLOR; - initscr(); - init_pair(1, COLOR_WHITE, COLOR_RED); - ]])], - [ax_cv_plaincurses_color=yes], - [ax_cv_plaincurses_color=no]) - ]) - AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ - ax_cv_curses_color=yes - AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) - ]) - - # Check for obsolete functions - - AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - chtype a = A_BOLD; - int b = KEY_LEFT; - int g = getattrs(stdscr); - int h = getcurx(stdscr) + getmaxx(stdscr); - initscr(); - ]])], - [ax_cv_plaincurses_obsolete=yes], - [ax_cv_plaincurses_obsolete=no]) - ]) - AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ - ax_cv_curses_obsolete=yes - AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) - ]) - ]) - - AS_IF([test "x$ax_cv_header_curses_h" = xno], [ - AC_MSG_WARN([could not find a working curses.h]) - ]) - ]) - ]) - - AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no]) - AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no]) - AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no]) - AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) - - LIBS=$ax_saved_LIBS - CPPFLAGS=$ax_saved_CPPFLAGS - - unset ax_saved_LIBS - unset ax_saved_CPPFLAGS -])dnl diff --git a/m4/glib-gettext.m4 b/m4/glib-gettext.m4 deleted file mode 100644 index 155b1d8..0000000 --- a/m4/glib-gettext.m4 +++ /dev/null @@ -1,436 +0,0 @@ -# Copyright (C) 1995-2002 Free Software Foundation, Inc. -# Copyright (C) 2001-2003,2004 Red Hat, Inc. -# -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under -# the same distribution terms as the rest of that program. -# -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# -# Macro to add for using GNU gettext. -# Ulrich Drepper , 1995, 1996 -# -# Modified to never use included libintl. -# Owen Taylor , 12/15/1998 -# -# Major rework to remove unused code -# Owen Taylor , 12/11/2002 -# -# Added better handling of ALL_LINGUAS from GNU gettext version -# written by Bruno Haible, Owen Taylor 5/30/3002 -# -# Modified to require ngettext -# Matthias Clasen 08/06/2004 -# -# We need this here as well, since someone might use autoconf-2.5x -# to configure GLib then an older version to configure a package -# using AM_GLIB_GNU_GETTEXT -AC_PREREQ(2.53) - -dnl -dnl We go to great lengths to make sure that aclocal won't -dnl try to pull in the installed version of these macros -dnl when running aclocal in the glib directory. -dnl -m4_copy([AC_DEFUN],[glib_DEFUN]) -m4_copy([AC_REQUIRE],[glib_REQUIRE]) -dnl -dnl At the end, if we're not within glib, we'll define the public -dnl definitions in terms of our private definitions. -dnl - -# GLIB_LC_MESSAGES -#-------------------- -glib_DEFUN([GLIB_LC_MESSAGES], - [AC_CHECK_HEADERS([locale.h]) - if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your file defines LC_MESSAGES.]) - fi - fi]) - -# GLIB_PATH_PROG_WITH_TEST -#---------------------------- -dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# GLIB_WITH_NLS -#----------------- -glib_DEFUN([GLIB_WITH_NLS], - dnl NLS is obligatory - [USE_NLS=yes - AC_SUBST(USE_NLS) - - gt_cv_have_gettext=no - - CATOBJEXT=NONE - XGETTEXT=: - INTLLIBS= - - AC_CHECK_HEADER(libintl.h, - [gt_cv_func_dgettext_libintl="no" - libintl_extra_libs="" - - # - # First check in libc - # - AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, - [AC_TRY_LINK([ -#include -], - [return !ngettext ("","", 1)], - gt_cv_func_ngettext_libc=yes, - gt_cv_func_ngettext_libc=no) - ]) - - if test "$gt_cv_func_ngettext_libc" = "yes" ; then - AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, - [AC_TRY_LINK([ -#include -], - [return !dgettext ("","")], - gt_cv_func_dgettext_libc=yes, - gt_cv_func_dgettext_libc=no) - ]) - fi - - if test "$gt_cv_func_ngettext_libc" = "yes" ; then - AC_CHECK_FUNCS(bind_textdomain_codeset) - fi - - # - # If we don't have everything we want, check in libintl - # - if test "$gt_cv_func_dgettext_libc" != "yes" \ - || test "$gt_cv_func_ngettext_libc" != "yes" \ - || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then - - AC_CHECK_LIB(intl, bindtextdomain, - [AC_CHECK_LIB(intl, ngettext, - [AC_CHECK_LIB(intl, dgettext, - gt_cv_func_dgettext_libintl=yes)])]) - - if test "$gt_cv_func_dgettext_libintl" != "yes" ; then - AC_MSG_CHECKING([if -liconv is needed to use gettext]) - AC_MSG_RESULT([]) - AC_CHECK_LIB(intl, ngettext, - [AC_CHECK_LIB(intl, dcgettext, - [gt_cv_func_dgettext_libintl=yes - libintl_extra_libs=-liconv], - :,-liconv)], - :,-liconv) - fi - - # - # If we found libintl, then check in it for bind_textdomain_codeset(); - # we'll prefer libc if neither have bind_textdomain_codeset(), - # and both have dgettext and ngettext - # - if test "$gt_cv_func_dgettext_libintl" = "yes" ; then - glib_save_LIBS="$LIBS" - LIBS="$LIBS -lintl $libintl_extra_libs" - unset ac_cv_func_bind_textdomain_codeset - AC_CHECK_FUNCS(bind_textdomain_codeset) - LIBS="$glib_save_LIBS" - - if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then - gt_cv_func_dgettext_libc=no - else - if test "$gt_cv_func_dgettext_libc" = "yes" \ - && test "$gt_cv_func_ngettext_libc" = "yes"; then - gt_cv_func_dgettext_libintl=no - fi - fi - fi - fi - - if test "$gt_cv_func_dgettext_libc" = "yes" \ - || test "$gt_cv_func_dgettext_libintl" = "yes"; then - gt_cv_have_gettext=yes - fi - - if test "$gt_cv_func_dgettext_libintl" = "yes"; then - INTLLIBS="-lintl $libintl_extra_libs" - fi - - if test "$gt_cv_have_gettext" = "yes"; then - AC_DEFINE(HAVE_GETTEXT,1, - [Define if the GNU gettext() function is already present or preinstalled.]) - GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl - if test "$MSGFMT" != "no"; then - glib_save_LIBS="$LIBS" - LIBS="$LIBS $INTLLIBS" - AC_CHECK_FUNCS(dcgettext) - MSGFMT_OPTS= - AC_MSG_CHECKING([if msgfmt accepts -c]) - GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: test 1.0\n" -"PO-Revision-Date: 2007-02-15 12:01+0100\n" -"Last-Translator: test \n" -"Language-Team: C \n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" -], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - AC_SUBST(MSGFMT_OPTS) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], - [CATOBJEXT=.gmo - DATADIRNAME=share], - [case $host in - *-*-solaris*) - dnl On Solaris, if bind_textdomain_codeset is in libc, - dnl GNU format message catalog is always supported, - dnl since both are added to the libc all together. - dnl Hence, we'd like to go with DATADIRNAME=share and - dnl and CATOBJEXT=.gmo in this case. - AC_CHECK_FUNC(bind_textdomain_codeset, - [CATOBJEXT=.gmo - DATADIRNAME=share], - [CATOBJEXT=.mo - DATADIRNAME=lib]) - ;; - *-*-openbsd*) - CATOBJEXT=.mo - DATADIRNAME=share - ;; - *) - CATOBJEXT=.mo - DATADIRNAME=lib - ;; - esac]) - LIBS="$glib_save_LIBS" - INSTOBJEXT=.mo - else - gt_cv_have_gettext=no - fi - fi - ]) - - if test "$gt_cv_have_gettext" = "yes" ; then - AC_DEFINE(ENABLE_NLS, 1, - [always defined to indicate that i18n is enabled]) - fi - - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is not GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - AC_MSG_RESULT( - [found xgettext program is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - - AC_OUTPUT_COMMANDS( - [case "$CONFIG_FILES" in *po/Makefile.in*) - sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile - esac]) - - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.ac. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - dnl Make all variables we use known to autoconf. - AC_SUBST(CATALOGS) - AC_SUBST(CATOBJEXT) - AC_SUBST(DATADIRNAME) - AC_SUBST(GMOFILES) - AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLLIBS) - AC_SUBST(PO_IN_DATADIR_TRUE) - AC_SUBST(PO_IN_DATADIR_FALSE) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) - -# AM_GLIB_GNU_GETTEXT -# ------------------- -# Do checks necessary for use of gettext. If a suitable implementation -# of gettext is found in either in libintl or in the C library, -# it will set INTLLIBS to the libraries needed for use of gettext -# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable -# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() -# on various variables needed by the Makefile.in.in installed by -# glib-gettextize. -dnl -AU_DEFUN([GLIB_GNU_GETTEXT], - [AC_REQUIRE([AC_PROG_CC])dnl - - GLIB_LC_MESSAGES - GLIB_WITH_NLS - - if test "$gt_cv_have_gettext" = "yes"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - NEW_LINGUAS="$NEW_LINGUAS $presentlang" - fi - done - LINGUAS=$NEW_LINGUAS - AC_MSG_RESULT($LINGUAS) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly - dnl find the mkinstalldirs script in another subdir but ($top_srcdir). - dnl Try to locate is. - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - AC_SUBST(MKINSTALLDIRS) - - dnl Generate list of files to be processed by xgettext which will - dnl be included in po/Makefile. - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - ], - [[$0: This macro is deprecated. You should use upstream gettext instead.]]) - -# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) -# ------------------------------- -# Define VARIABLE to the location where catalog files will -# be installed by po/Makefile. -glib_DEFUN([GLIB_DEFINE_LOCALEDIR], -[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl -glib_save_prefix="$prefix" -glib_save_exec_prefix="$exec_prefix" -glib_save_datarootdir="$datarootdir" -test "x$prefix" = xNONE && prefix=$ac_default_prefix -test "x$exec_prefix" = xNONE && exec_prefix=$prefix -datarootdir=`eval echo "${datarootdir}"` -if test "x$CATOBJEXT" = "x.mo" ; then - localedir=`eval echo "${libdir}/locale"` -else - localedir=`eval echo "${datadir}/locale"` -fi -prefix="$glib_save_prefix" -exec_prefix="$glib_save_exec_prefix" -datarootdir="$glib_save_datarootdir" -AC_DEFINE_UNQUOTED($1, "$localedir", - [Define the location where the catalogs will be installed]) -]) - -dnl -dnl Now the definitions that aclocal will find -dnl -ifdef(glib_configure_ac,[],[ -AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) -AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) -])dnl - -# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) -# -# Create a temporary file with TEST-FILE as its contents and pass the -# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with -# 0 and perform ACTION-IF-FAIL for any other exit status. -AC_DEFUN([GLIB_RUN_PROG], -[cat >conftest.foo <<_ACEOF -$2 -_ACEOF -if AC_RUN_LOG([$1 conftest.foo]); then - m4_ifval([$3], [$3], [:]) -m4_ifvaln([$4], [else $4])dnl -echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD -sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD -fi]) - diff --git a/m4/mpd_with_flags.m4 b/m4/mpd_with_flags.m4 deleted file mode 100644 index 4f82b79..0000000 --- a/m4/mpd_with_flags.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl Run code with the specified CFLAGS/CXXFLAGS and LIBS appended. -dnl Restores the old values afterwards. -dnl -dnl Parameters: cflags, libs, code -AC_DEFUN([MPD_WITH_FLAGS], [ - ac_save_CFLAGS="$[]CFLAGS" - ac_save_CXXFLAGS="$[]CXXFLAGS" - ac_save_LIBS="$[]LIBS" - CFLAGS="$[]CFLAGS $1" - CXXFLAGS="$[]CXXFLAGS $1" - LIBS="$[]LIBS $2" - $3 - CFLAGS="$[]ac_save_CFLAGS" - CXXFLAGS="$[]ac_save_CXXFLAGS" - LIBS="$[]ac_save_LIBS" -]) - -dnl Run code with the specified library's CFLAGS/CXXFLAGS and LIBS -dnl appended. Restores the old values afterwards. -dnl -dnl Parameters: libname, code -AC_DEFUN([MPD_WITH_LIBRARY], - [MPD_WITH_FLAGS([$[]$1_CFLAGS], [$[]$1_LIBS], [$2])]) diff --git a/m4/nls.m4 b/m4/nls.m4 deleted file mode 100644 index afdb9ca..0000000 --- a/m4/nls.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software -dnl Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -AC_PREREQ([2.50]) - -AC_DEFUN([AM_NLS], -[ - AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE([nls], - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT([$USE_NLS]) - AC_SUBST([USE_NLS]) -]) diff --git a/m4/pkg.m4 b/m4/pkg.m4 deleted file mode 100644 index 4688002..0000000 --- a/m4/pkg.m4 +++ /dev/null @@ -1,275 +0,0 @@ -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl -dnl Copyright © 2004 Scott James Remnant . -dnl Copyright © 2012-2015 Dan Nicholson -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR diff --git a/m4/po.m4 b/m4/po.m4 deleted file mode 100644 index c5a2f6b..0000000 --- a/m4/po.m4 +++ /dev/null @@ -1,453 +0,0 @@ -# po.m4 serial 24 (gettext-0.19) -dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -AC_PREREQ([2.60]) - -dnl Checks for all prerequisites of the po subdirectory. -AC_DEFUN([AM_PO_SUBDIRS], -[ - AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AC_PROG_MKDIR_P])dnl - AC_REQUIRE([AC_PROG_SED])dnl - AC_REQUIRE([AM_NLS])dnl - - dnl Release version of the gettext macros. This is used to ensure that - dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) - - dnl Perform the following tests also if --disable-nls has been given, - dnl because they are needed for "make dist" to work. - - dnl Search for GNU msgfmt in the PATH. - dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. - dnl The second test excludes FreeBSD msgfmt. - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) - - dnl Test whether it is GNU msgfmt >= 0.15. -changequote(,)dnl - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac -changequote([,])dnl - AC_SUBST([MSGFMT_015]) -changequote(,)dnl - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; - *) GMSGFMT_015=$GMSGFMT ;; - esac -changequote([,])dnl - AC_SUBST([GMSGFMT_015]) - - dnl Search for GNU xgettext 0.12 or newer in the PATH. - dnl The first test excludes Solaris xgettext and early GNU xgettext versions. - dnl The second test excludes FreeBSD xgettext. - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - - dnl Test whether it is GNU xgettext >= 0.15. -changequote(,)dnl - case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; - *) XGETTEXT_015=$XGETTEXT ;; - esac -changequote([,])dnl - AC_SUBST([XGETTEXT_015]) - - dnl Search for GNU msgmerge 0.11 or newer in the PATH. - AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, - [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) - - dnl Installation directories. - dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we - dnl have to define it here, so that it can be used in po/Makefile. - test -n "$localedir" || localedir='${datadir}/locale' - AC_SUBST([localedir]) - - dnl Support for AM_XGETTEXT_OPTION. - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= - AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) - - AC_CONFIG_COMMANDS([po-directories], [[ - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - gt_tab=`printf '\t'` - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done]], - [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - ]) -]) - -dnl Postprocesses a Makefile in a directory containing PO files. -AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], -[ - # When this code is run, in config.status, two variables have already been - # set: - # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, - # - LINGUAS is the value of the environment variable LINGUAS at configure - # time. - -changequote(,)dnl - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - # Find a way to echo strings without interpreting backslash. - if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='echo' - else - if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='printf %s\n' - else - echo_func () { - cat < "$ac_file.tmp" - tab=`printf '\t'` - if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` - cat >> "$ac_file.tmp" < /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` - cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. - -AC_PREREQ([2.50]) - -# Search path for a program which passes the given test. - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN([AM_PATH_PROG_WITH_TEST], -[ -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which - # contains only /bin. Note that ksh looks also at the FPATH variable, - # so we have to set that as well for the test. - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - || PATH_SEPARATOR=';' - } -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL([ac_cv_path_$1], -[case "[$]$1" in - [[\\/]]* | ?:[[\\/]]*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in ifelse([$5], , $PATH, [$5]); do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$][$1]) -else - AC_MSG_RESULT([no]) -fi -AC_SUBST([$1])dnl -]) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..09e8bc2 --- /dev/null +++ b/meson.build @@ -0,0 +1,376 @@ +project('ncmpc', 'c', + version: '0.28', + default_options: [ + 'c_std=c99', + ], + license: 'GPLv2+', +) + +cc = meson.get_compiler('c') + +conf = configuration_data() +conf.set_quoted('PACKAGE', meson.project_name()) +conf.set_quoted('VERSION', meson.project_version()) +conf.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'))) +conf.set_quoted('LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir'))) + +mini = get_option('mini') +conf.set('NCMPC_MINI', mini) + +enable_locale = get_option('locale') +if enable_locale == 'false' or mini + enable_locale = false +elif cc.has_header('locale.h') + enable_locale = true +elif enable_locale == 'auto' + enable_locale = false +else + error('locale.h not found') +endif +conf.set('ENABLE_LOCALE', enable_locale) + +enable_nls = get_option('nls') +if enable_nls == 'false' or mini + enable_nls = false +elif cc.has_header('libintl.h') + enable_nls = true +elif enable_nls == 'auto' + enable_nls = false +else + error('libintl.h not found') +endif +conf.set('ENABLE_NLS', enable_nls) +if enable_nls + conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) + subdir('po') +endif + +if get_option('tcp') + conf.set('ENABLE_TCP', true) + conf.set('HAVE_GETADDRINFO', cc.has_function('getaddrinfo')) +endif + +async_connect = get_option('async_connect') +conf.set('ENABLE_ASYNC_CONNECT', async_connect) + +conf.set('ENABLE_MULTIBYTE', get_option('multibyte')) + +curses = get_option('curses') +if curses == 'ncursesw' + curses_dep = dependency('ncursesw') +elif curses == 'ncurses' + curses_dep = dependency('ncurses') +else + curses_dep = dependency('ncursesw', required: false) + if curses_dep.found() + curses = 'ncursesw' + else + curses_dep = dependency('ncurses', required: false) + + if curses_dep.found() + curses = 'ncurses' + else + # TODO: find other curses implementation (pdcurses?) + endif + endif +endif + +if curses == 'ncursesw' + conf.set('HAVE_NCURSESW', true) + curses_enhanced = true + curses_color = true + if cc.has_header('ncursesw/curses.h', dependencies: curses_dep) + conf.set('HAVE_NCURSESW_CURSES_H', true) + elif cc.has_header('ncursesw.h', dependencies: curses_dep) + conf.set('HAVE_NCURSESW_H', true) + else + error('No ncursesw header found') + endif +elif curses == 'ncurses' + conf.set('HAVE_NCURSES', true) + curses_enhanced = true + curses_color = true + if cc.has_header('ncurses/curses.h', dependencies: curses_dep) + conf.set('HAVE_NCURSES_CURSES_H', true) + elif cc.has_header('ncurses.h', dependencies: curses_dep) + conf.set('HAVE_NCURSES_H', true) + else + error('No ncurses header found') + endif +else + if cc.has_header('curses.h', dependencies: curses_dep) + conf.set('HAVE_CURSES_H', true) + + # TODO: test this with pdcurses + curses_enhanced = cc.has_header_symbol('curses.h', '_XOPEN_CURSES', dependencies: curses_dep) + curses_color = curses_enhanced or cc.has_header_symbol('curses.h', 'COLOR_PAIR', dependencies: curses_dep) + else + error('No curses header found') + endif +endif +conf.set('HAVE_CURSES_ENHANCED', curses_enhanced) + +enable_mouse = get_option('mouse') +if enable_mouse == 'false' + enable_mouse = false +elif cc.has_function('getmouse', dependencies: curses_dep) + enable_mouse = true +elif enable_mouse == 'auto' + enable_mouse = false +else + error('getmouse() not available') +endif +conf.set('HAVE_GETMOUSE', enable_mouse) + +enable_lirc = get_option('lirc') +if enable_lirc == 'false' + enable_lirc = false + lirc_dep = [] +else + lirc_dep = dependency('lirc', required: false) + if not lirc_dep.found() + lirc_dep = dependency('liblircclient0', required: false) + endif + + if lirc_dep.found() + enable_lirc = true + elif enable_lirc == 'auto' + enable_lirc = false + else + error('liblirc not found') + endif +endif +conf.set('ENABLE_LIRC', enable_lirc) + +common_cflags = [ +] + +test_cflags = [ + '-Wall', + '-Wextra', + '-Wno-deprecated-declarations', + '-Wmissing-prototypes', + '-Wshadow', + '-Wpointer-arith', + '-Wstrict-prototypes', + '-Wcast-qual', + '-Wwrite-strings', + '-fvisibility=hidden', +] + +test_ldflags = [ +] + +if get_option('buildtype') != 'debug' + test_cflags += [ + '-ffunction-sections', + '-fdata-sections', + ] + test_ldflags += [ + '-Wl,--gc-sections', + ] +endif + +foreach f: test_cflags + if cc.has_argument(f) + common_cflags += [ f ] + endif +endforeach + +add_global_arguments(common_cflags, language: 'c') + +foreach f: test_ldflags + if cc.has_argument(f) + add_global_link_arguments(f, language: 'c') + endif +endforeach + +glib_dep = dependency('glib-2.0', version: '>= 2.30') +libmpdclient_dep = dependency('libmpdclient', version: '>= 2.9') + +inc = include_directories( + 'src', + + # for the generated config.h + meson.current_build_dir(), +) + +sources = [] + +need_screen_text = false +need_plugin_library = false + +if host_machine.system() != 'windows' + sources += [ + 'src/signals.c', + ] +endif + +if not mini + sources += [ + 'src/db_completion.c', + 'src/xterm_title.c', + 'src/hscroll.c', + 'src/match.c', + 'src/conf.c', + ] +endif + +if async_connect + sources += [ + 'src/net/socket.c', + 'src/net/resolver.c', + 'src/net/async_connect.c', + 'src/net/async_rconnect.c', + 'src/aconnect.c', + ] +endif + +if enable_lirc + sources += [ + 'src/lirc.c', + ] +endif + +enable_help_screen = get_option('help_screen') and not mini +conf.set('ENABLE_HELP_SCREEN', enable_help_screen) +if enable_help_screen + sources += ['src/screen_help.c'] +endif + +enable_artist_screen = get_option('artist_screen') and not mini +conf.set('ENABLE_ARTIST_SCREEN', enable_artist_screen) +if enable_artist_screen + sources += ['src/screen_artist.c'] +endif + +enable_search_screen = get_option('search_screen') and not mini +conf.set('ENABLE_SEARCH_SCREEN', enable_search_screen) +if enable_search_screen + sources += ['src/screen_search.c'] +endif + +enable_song_screen = get_option('song_screen') and not mini +conf.set('ENABLE_SONG_SCREEN', enable_song_screen) +if enable_song_screen + sources += ['src/screen_song.c'] +endif + +enable_keydef_screen = get_option('key_screen') and not mini +conf.set('ENABLE_KEYDEF_SCREEN', enable_keydef_screen) +if enable_keydef_screen + sources += ['src/screen_keydef.c'] +endif + +enable_lyrics_screen = get_option('lyrics_screen') and not mini +conf.set('ENABLE_LYRICS_SCREEN', enable_lyrics_screen) +if enable_lyrics_screen + sources += ['src/screen_lyrics.c', 'src/lyrics.c'] + + lyrics_plugin_dir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name(), 'lyrics') + conf.set_quoted('LYRICS_PLUGIN_DIR', lyrics_plugin_dir) + install_data( + 'lyrics/10-hd.sh', + 'lyrics/20-lyricwiki.rb', + install_dir: lyrics_plugin_dir) + + need_screen_text = true + need_plugin_library = true +endif + +enable_outputs_screen = get_option('outputs_screen') and not mini +conf.set('ENABLE_OUTPUTS_SCREEN', enable_outputs_screen) +if enable_outputs_screen + sources += ['src/screen_outputs.c'] +endif + +enable_chat_screen = get_option('chat_screen') and not mini +conf.set('ENABLE_CHAT_SCREEN', enable_chat_screen) +if enable_chat_screen + sources += ['src/screen_chat.c'] + need_screen_text = true +endif + +if need_screen_text + sources += ['src/screen_text.c'] +endif + +if need_plugin_library + if host_machine.system() == 'windows' + error('Plugins not yet compatible with Windows') + endif + + sources += ['src/plugin.c'] +endif + +if host_machine.system() == 'windows' + subdir('src/win') +endif + +ncmpc = executable('ncmpc', + 'src/main.c', + 'src/gidle.c', + 'src/mpdclient.c', + 'src/callbacks.c', + 'src/playlist.c', + 'src/filelist.c', + 'src/options.c', + 'src/command.c', + 'src/keyboard.c', + 'src/ncu.c', + 'src/player_command.c', + 'src/title_bar.c', + 'src/progress_bar.c', + 'src/status_bar.c', + 'src/screen.c', + 'src/screen_init.c', + 'src/screen_paint.c', + 'src/screen_utils.c', + 'src/screen_status.c', + 'src/screen_list.c', + 'src/screen_find.c', + 'src/screen_client.c', + 'src/screen_queue.c', + 'src/screen_browser.c', + 'src/screen_file.c', + 'src/list_window.c', + 'src/save_playlist.c', + 'src/song_paint.c', + 'src/colors.c', + 'src/charset.c', + 'src/wreadln.c', + 'src/strfsong.c', + 'src/time_format.c', + 'src/utils.c', + sources, + include_directories: inc, + dependencies: [ + glib_dep, + curses_dep, + lirc_dep, + libmpdclient_dep, + ], + install: true +) + +configure_file(output: 'config.h', configuration: conf) + +install_man('doc/ncmpc.1') + +docdir = join_paths(get_option('datadir'), 'doc', meson.project_name()) +install_data('AUTHORS', 'COPYING', 'NEWS', 'README.rst', + 'doc/config.sample', + 'doc/keys.sample', + 'doc/ncmpc.lirc', + install_dir: docdir) + +if not mini + subdir('test') +endif + +if get_option('documentation') + doxygen = find_program('doxygen', required: false) + if doxygen.found() + subdir('doc') + endif +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..7529394 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,78 @@ +option('curses', type: 'combo', + choices: ['ncursesw', 'ncurses', 'auto'], + value: 'auto', + description: 'Choose which curses implementation to use') + +option('mouse', type: 'combo', + choices: ['true', 'false', 'auto'], + value: 'auto', + description: 'Enable mouse support') + +option('colors', type: 'combo', + choices: ['ncursesw', 'ncurses', 'auto'], + value: 'auto', + description: 'Enable color support') + +option('multibyte', type: 'boolean', + value: 'true', + description: 'Enable multibyte character support') + +option('locale', type: 'combo', + choices: ['true', 'false', 'auto'], + description: 'Enable locale support') + +option('nls', type: 'combo', + choices: ['true', 'false', 'auto'], + description: 'Enable NLS support') + +option('lirc', type: 'combo', + choices: ['true', 'false', 'auto'], + description: 'Enable LIRC support') + +option('tcp', type: 'boolean', + value: true, + description: 'Enable TCP support') + +option('async_connect', type: 'boolean', + value: true, + description: 'Enable asynchronous connect') + +option('mini', type: 'boolean', + value: false, + description: 'Build ncmpc-mini, i.e. without all optional features') + +option('help_screen', type: 'boolean', + value: true, + description: 'Enable the help screen') + +option('artist_screen', type: 'boolean', + value: true, + description: 'Enable the artist screen') + +option('search_screen', type: 'boolean', + value: true, + description: 'Enable the search screen') + +option('song_screen', type: 'boolean', + value: true, + description: 'Enable the song viewer screen') + +option('key_screen', type: 'boolean', + value: true, + description: 'Enable the key editor screen') + +option('lyrics_screen', type: 'boolean', + value: false, + description: 'Enable the lyrics screen') + +option('outputs_screen', type: 'boolean', + value: true, + description: 'Enable the outputs screen') + +option('chat_screen', type: 'boolean', + value: false, + description: 'Enable the chat screen') + +option('documentation', type: 'boolean', + value: false, + description: 'Build API documentation') diff --git a/po/ChangeLog b/po/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 0000000..660bd48 --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,28 @@ +src/colors.c +src/command.c +src/conf.c +src/i18n.h +src/list_window.c +src/main.c +src/options.c +src/player_command.c +src/save_playlist.c +src/screen.c +src/screen_artist.c +src/screen_browser.c +src/screen_chat.c +src/screen_client.c +src/screen_file.c +src/screen_find.c +src/screen_help.c +src/screen_init.c +src/screen_keydef.c +src/screen_lyrics.c +src/screen_outputs.c +src/screen_queue.c +src/screen_search.c +src/screen_song.c +src/screen_utils.c +src/status_bar.c +src/title_bar.c +src/utils.c diff --git a/po/POTFILES.in b/po/POTFILES.in deleted file mode 100644 index 1ea275c..0000000 --- a/po/POTFILES.in +++ /dev/null @@ -1,30 +0,0 @@ -# source files - -src/colors.c -src/command.c -src/conf.c -src/i18n.h -src/list_window.c -src/main.c -src/options.c -src/player_command.c -src/save_playlist.c -src/screen.c -src/screen_artist.c -src/screen_browser.c -src/screen_chat.c -src/screen_client.c -src/screen_file.c -src/screen_find.c -src/screen_help.c -src/screen_init.c -src/screen_keydef.c -src/screen_lyrics.c -src/screen_outputs.c -src/screen_queue.c -src/screen_search.c -src/screen_song.c -src/screen_utils.c -src/status_bar.c -src/title_bar.c -src/utils.c diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..c289598 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,28 @@ +i18n = import('i18n') + +langs = [ + 'cs', + 'da', + 'de', + 'eo', + 'es', + 'fi', + 'fr', + 'gl', + 'he', + 'hu', + 'it', + 'ko', + 'nb', + 'nl', + 'pl', + 'pt_BR', + 'ru', + 'sk', + 'sv', + 'uk', + 'zh_CN', +] + +#i18n.gettext('ncmpc', languages: langs) +i18n.gettext('ncmpc', preset: 'glib') diff --git a/src/win/meson.build b/src/win/meson.build new file mode 100644 index 0000000..ad310b4 --- /dev/null +++ b/src/win/meson.build @@ -0,0 +1,19 @@ +splitted_version = meson.project_version().split('.') + +wconf = configuration_data() +wconf.set('VERSION_MAJOR', splitted_version[0]) +wconf.set('VERSION_MINOR', splitted_version[1]) +if splitted_version.length() >= 3 + wconf.set('VERSION_REVISION', splitted_version[2]) +else + wconf.set('VERSION_REVISION', '0') +endif +if splitted_version.length() >= 4 + wconf.set('VERSION_EXTRA', splitted_version[3]) +else + wconf.set('VERSION_EXTRA', '0') +endif +configure_file(input: 'ncmpc_win32_rc.rc.in', output: 'ncmpc_win32_rc.rc', configuration: wconf) + +windows = import('windows') +sources += windows.compile_resources('ncmpc_win32_rc.rc') diff --git a/test.sh b/test.sh deleted file mode 100755 index a5ea63c..0000000 --- a/test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -e -# -# This shell script tests the build of ncmpc with various compile-time -# options. -# -# Author: Max Kellermann - -PREFIX=/tmp/ncmpc -rm -rf $PREFIX - -export CFLAGS="-Os" - -test -x configure || NOCONFIGURE=1 ./autogen.sh - -# all features on, wide curses -./configure --prefix=$PREFIX/full --enable-debug --enable-werror \ - --with-ncursesw \ - --enable-lyrics-screen --enable-colors --enable-lirc -make -j2 install - -# all features on, no debugging -./configure --prefix=$PREFIX/full --disable-debug --enable-werror \ - --with-ncursesw \ - --enable-lyrics-screen --enable-colors --enable-lirc -make -j2 install - -# all features on, narrow curses -./configure --prefix=$PREFIX/narrow --enable-debug --enable-werror \ - --with-ncurses \ - --enable-lyrics-screen --enable-colors --enable-lirc -make -j2 install - -# all features on, no wide characters and no NLS -./configure --prefix=$PREFIX/nonls --enable-debug --enable-werror \ - --disable-wide --disable-nls \ - --enable-lyrics-screen --enable-colors --enable-lirc -make -j2 install - -# no bloat -./configure --prefix=$PREFIX/nobloat --enable-debug --enable-werror \ - --disable-wide --disable-nls \ - --enable-lyrics-screen --disable-lirc --disable-key-screen \ - --disable-colors --disable-mouse -make -j2 install - -# ncmpc-mini and ncmpc-tiny -CFLAGS="-Os" ./configure --prefix=$PREFIX/mini --disable-debug --enable-werror \ - --enable-mini -make -j2 install -make src/ncmpc-tiny diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..27be82a --- /dev/null +++ b/test/meson.build @@ -0,0 +1,13 @@ +executable( + 'run_hscroll', + 'run_hscroll.c', + objects: ncmpc.extract_objects( + 'src/hscroll.c', + 'src/charset.c', + ), + include_directories: inc, + dependencies: [ + curses_dep, + glib_dep, + ], +)