]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/rl_free_keymap'
authorAndre Noll <maan@systemlinux.org>
Tue, 22 Apr 2014 00:30:02 +0000 (02:30 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 22 Apr 2014 00:30:02 +0000 (02:30 +0200)
Cooking since 2014-03-10.

* t/rl_free_keymap:
  build: Check whether rl_free_keymap is declared.

1  2 
configure.ac
interactive.c

diff --combined configure.ac
index 07ecffdd71f31e1246d8262bda5fbdd762212f99,61ff547e1e09f62403fa65fde03f0ee0ce474aec..30bce8ee400858cb099c3bc7d1d2593c4f842225
@@@ -580,11 -580,7 +580,11 @@@ if test -n "$with_flac_libs"; the
        LDFLAGS="$LDFLAGS $flac_libs"
  fi
  AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
 -AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
 +AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
 +      # nope, try again with -logg
 +      AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
 +              have_flac=no, -lm -logg)
 +      ], -lm)
  if test "$have_flac" = "yes"; then
        AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
        AC_SUBST(flac_cppflags)
@@@ -732,17 -728,15 +732,17 @@@ AC_CHECK_HEADERS([readline/readline.h]
  ])
  
  if test "$have_readline" = "yes"; then
 -      readline_ldflags="$readline_libs -lreadline"
 -      AC_SEARCH_LIBS([rl_free_keymap], [readline], [], [have_readline="no"])
 +      readline_ldflags="$readline_libs"
 +      AC_SEARCH_LIBS([rl_free_keymap], [readline], [
 +              readline_ldflags="$readline_ldflags -lreadline"
 +      ], [have_readline="no"])
        if test "$have_readline" = "no"; then # try with -lcurses
                  # clear cache
                AC_MSG_NOTICE([trying again with -lcurses])
                  unset ac_cv_search_rl_free_keymap 2> /dev/null
                AC_SEARCH_LIBS([rl_free_keymap], [readline], [
                        have_readline=yes
 -                      readline_ldflags="$readline_ldflags -lcurses"
 +                      readline_ldflags="$readline_ldflags -lreadline -lcurses"
                ], [], [-lcurses])
        fi
        if test "$have_readline" = "no"; then # try with -ltermcap
                  unset ac_cv_search_rl_free_keymap 2> /dev/null
                AC_SEARCH_LIBS([rl_free_keymap], [readline], [
                        have_readline=yes
 -                      readline_ldflags="$readline_ldflags -ltermcap"
 +                      readline_ldflags="$readline_ldflags -lreadline -ltermcap"
                ], [], [-ltermcap])
        fi
  fi
  
  if test "$have_readline" = "yes"; then
-       :
+       AC_CHECK_DECL(
+               [rl_free_keymap],
+               [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
+               [],
+               [
+                       #include <stdio.h>
+                       #include <readline/readline.h>
+               ]
+       )
        AC_SUBST(readline_cppflags)
        AC_SUBST(readline_ldflags)
        AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
@@@ -1178,8 -1180,6 +1186,8 @@@ if test "$have_samplerate" = "yes"; the
        filter_cmdline_objs="$filter_cmdline_objs resample_filter"
        filters="$filters resample"
  fi
 +filters="$(echo $filters)"
 +AC_SUBST(filters)
  filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
  
  AC_SUBST(filter_objs, add_dot_o($filter_objs))
@@@ -1244,7 -1244,6 +1252,7 @@@ if test "$have_flac" = "yes"; the
        recv_errlist_objs="$recv_errlist_objs flac_afh"
  fi
  recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
 +AC_SUBST(receivers, "http dccp udp afh")
  AC_SUBST(recv_objs, add_dot_o($recv_objs))
  AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
        errors used by para_recv)
@@@ -1278,7 -1277,6 +1286,7 @@@ if test "$have_speex" = "yes"; the
  fi
  if test "$have_opus" = "yes"; then
        afh_errlist_objs="$afh_errlist_objs opus_afh opus_common"
 +      audio_format_handlers="$audio_format_handlers opus"
  fi
  if test "$have_faad" = "yes"; then
        afh_errlist_objs="$afh_errlist_objs aac_common aac_afh"
@@@ -1438,7 -1436,6 +1446,7 @@@ if test "$have_alsa" = "yes"; the
        writers="$writers alsa"
        default_writer="ALSA_WRITE"
  fi
 +AC_SUBST(writers)
  write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
  AC_SUBST(write_objs, add_dot_o($write_objs))
  AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
@@@ -1557,7 -1554,7 +1565,7 @@@ unix socket credentials: $have_ucre
  readline (interactive CLIs): $have_readline
  audio formats handlers: $audio_format_handlers
  id3 version2 support: $have_libid3tag
 -filters: $(echo $filters)
 +filters: $filters
  writers: $writers
  
  para_fade: $build_fade
diff --combined interactive.c
index ee953bf12a26377bb02efb3fc96e1b3cf3e7b0e9,5e4a89b3aa8111cc4f9912893ca0c12bf8f93430..9f2b71953c90f3148d17af0becf0b6a9f3eeaecd
@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * Copyright (C) 2011-2013 Andre Noll <maan@systemlinux.org>
 + * Copyright (C) 2011-2014 Andre Noll <maan@systemlinux.org>
   *
   * Licensed under the GPL v2. For licencing details see COPYING.
   */
@@@ -227,6 -227,7 +227,7 @@@ static void wipe_bottom_line(void
        fprintf(i9ep->stderr_stream, "\r");
  }
  
+ #ifndef RL_FREE_KEYMAP_DECLARED
  /**
   * Free all storage associated with a keymap.
   *
   * \param keymap The keymap to deallocate.
   */
  void rl_free_keymap(Keymap keymap);
+ #endif
  
  /**
   * Reset the terminal and save the in-memory command line history.