Changeset 2643 for box/trunk


Ignore:
Timestamp:
26/02/2010 14:11:33 (2 years ago)
Author:
chris
Message:

Detect whether rl_completion_matches or completion_matches is declared
by readline headers at configure time, and use the appropriate one in
bbackupquery. Thanks to Melissa Jenkins for reporting the compilation
failure on OSX and providing additional details.

Location:
box/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupquery/bbackupquery.cpp

    r2641 r2643  
    133133        if (start == 0) 
    134134        { 
    135                 matches = rl_completion_matches(text, command_generator); 
     135                #ifdef HAVE_RL_COMPLETION_MATCHES 
     136                        matches = rl_completion_matches(text, 
     137                                command_generator); 
     138                #elif defined HAVE_COMPLETION_MATCHES 
     139                        matches = completion_matches(text, command_generator); 
     140                #endif 
    136141        } 
    137142 
  • box/trunk/infrastructure/m4/vl_lib_readline.m4

    r298 r2643  
    8080]) 
    8181 
     82dnl BOX_CHECK_VAR(name, where, headers) 
     83AC_DEFUN([BOX_CHECK_VAR], [ 
     84  AC_CACHE_CHECK([for $1 $2], [vl_cv_var_$1],  
     85    [AC_TRY_LINK([$3], [(void) $1], [vl_cv_var_$1=yes], [vl_cv_var_$1=no]) 
     86    ]) 
     87  if test "${vl_cv_var_$1}" = "yes"; then 
     88    AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, [Define if you have $1 $2]) 
     89  fi 
     90  ]) 
     91 
    8292dnl VL_LIB_READLINE_CHECK(name, libraries, headers, history headers) 
    8393AC_DEFUN([VL_LIB_READLINE_CHECK], [ 
     
    109119  ]) 
    110120 
     121  vl_cv_lib_includes="" 
     122 
    111123  vl_cv_lib_readline_compat_found=no 
    112124  if test "x$vl_cv_lib_$1" != "xno"; then 
    113     AC_CHECK_HEADERS([$3], [vl_cv_lib_readline_compat_found=yes]) 
     125    AC_CHECK_HEADERS([$3], [ 
     126      vl_cv_lib_readline_compat_found=yes 
     127      vl_cv_lib_includes="$vl_cv_lib_headers #include <$ac_header>" 
     128    ]) 
    114129  fi 
    115130 
    116131  if test "x$vl_cv_lib_readline_compat_found" = "xyes"; then 
     132    BOX_CHECK_VAR([rl_completion_matches], [in readline headers], 
     133      [$vl_cv_lib_includes]) 
     134 
     135    BOX_CHECK_VAR([completion_matches], [in readline headers], 
     136      [$vl_cv_lib_includes]) 
     137 
    117138    AC_DEFINE([HAVE_LIBREADLINE], 1, 
    118139              [Define if you have a readline compatible library]) 
Note: See TracChangeset for help on using the changeset viewer.