209209
210210
211211
212- # PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
213- # ---------------------------------------
214- # Readline versions < 2.1 don't have rl_completion_append_character
212+ # PGAC_READLINE_VARIABLES
213+ # -----------------------
214+ # Readline versions < 2.1 don't have rl_completion_append_character,
215+ # and some versions lack rl_completion_suppress_quote.
216+ # Libedit lacks rl_filename_quote_characters and rl_filename_quoting_function
215217
216- AC_DEFUN ( [ PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER ] ,
218+ AC_DEFUN ( [ PGAC_READLINE_VARIABLES ] ,
217219[ AC_CACHE_CHECK ( [ for rl_completion_append_character] , pgac_cv_var_rl_completion_append_character ,
218220[ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>
219- #ifdef HAVE_READLINE_READLINE_H
220- # include <readline/readline.h>
221+ #if defined(HAVE_READLINE_READLINE_H)
222+ #include <readline/readline.h>
223+ #elif defined(HAVE_EDITLINE_READLINE_H)
224+ #include <editline/readline.h>
221225#elif defined(HAVE_READLINE_H)
222- # include <readline.h>
226+ #include <readline.h>
223227#endif
224228] ,
225229[ rl_completion_append_character = 'x';] ) ] ,
@@ -228,7 +232,59 @@ AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER],
228232if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
229233AC_DEFINE ( HAVE_RL_COMPLETION_APPEND_CHARACTER , 1 ,
230234 [ Define to 1 if you have the global variable 'rl_completion_append_character'.] )
231- fi] ) # PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
235+ fi
236+ AC_CACHE_CHECK ( [ for rl_completion_suppress_quote] , pgac_cv_var_rl_completion_suppress_quote ,
237+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>
238+ #if defined(HAVE_READLINE_READLINE_H)
239+ #include <readline/readline.h>
240+ #elif defined(HAVE_EDITLINE_READLINE_H)
241+ #include <editline/readline.h>
242+ #elif defined(HAVE_READLINE_H)
243+ #include <readline.h>
244+ #endif
245+ ] ,
246+ [ rl_completion_suppress_quote = 1;] ) ] ,
247+ [ pgac_cv_var_rl_completion_suppress_quote=yes] ,
248+ [ pgac_cv_var_rl_completion_suppress_quote=no] ) ] )
249+ if test x"$pgac_cv_var_rl_completion_suppress_quote" = x"yes"; then
250+ AC_DEFINE ( HAVE_RL_COMPLETION_SUPPRESS_QUOTE , 1 ,
251+ [ Define to 1 if you have the global variable 'rl_completion_suppress_quote'.] )
252+ fi
253+ AC_CACHE_CHECK ( [ for rl_filename_quote_characters] , pgac_cv_var_rl_filename_quote_characters ,
254+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>
255+ #if defined(HAVE_READLINE_READLINE_H)
256+ #include <readline/readline.h>
257+ #elif defined(HAVE_EDITLINE_READLINE_H)
258+ #include <editline/readline.h>
259+ #elif defined(HAVE_READLINE_H)
260+ #include <readline.h>
261+ #endif
262+ ] ,
263+ [ rl_filename_quote_characters = "x";] ) ] ,
264+ [ pgac_cv_var_rl_filename_quote_characters=yes] ,
265+ [ pgac_cv_var_rl_filename_quote_characters=no] ) ] )
266+ if test x"$pgac_cv_var_rl_filename_quote_characters" = x"yes"; then
267+ AC_DEFINE ( HAVE_RL_FILENAME_QUOTE_CHARACTERS , 1 ,
268+ [ Define to 1 if you have the global variable 'rl_filename_quote_characters'.] )
269+ fi
270+ AC_CACHE_CHECK ( [ for rl_filename_quoting_function] , pgac_cv_var_rl_filename_quoting_function ,
271+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <stdio.h>
272+ #if defined(HAVE_READLINE_READLINE_H)
273+ #include <readline/readline.h>
274+ #elif defined(HAVE_EDITLINE_READLINE_H)
275+ #include <editline/readline.h>
276+ #elif defined(HAVE_READLINE_H)
277+ #include <readline.h>
278+ #endif
279+ ] ,
280+ [ rl_filename_quoting_function = 0;] ) ] ,
281+ [ pgac_cv_var_rl_filename_quoting_function=yes] ,
282+ [ pgac_cv_var_rl_filename_quoting_function=no] ) ] )
283+ if test x"$pgac_cv_var_rl_filename_quoting_function" = x"yes"; then
284+ AC_DEFINE ( HAVE_RL_FILENAME_QUOTING_FUNCTION , 1 ,
285+ [ Define to 1 if you have the global variable 'rl_filename_quoting_function'.] )
286+ fi
287+ ] ) # PGAC_READLINE_VARIABLES
232288
233289
234290
0 commit comments