diff --git a/C/bignum.c b/C/bignum.c
index adcb5031f..66bf3672c 100644
--- a/C/bignum.c
+++ b/C/bignum.c
@@ -100,12 +100,23 @@ p_is_bignum(void)
Term t = Deref(ARG1);
return(IsNonVarTerm(t) && IsApplTerm(t) && FunctorOfTerm(t) == FunctorBigInt);
#else
- return(FALSE);
+ return FALSE;
+#endif
+}
+
+static Int
+p_has_bignums(void)
+{
+#ifdef USE_GMP
+ return TRUE;
+#else
+ return FALSE;
#endif
}
void
Yap_InitBigNums(void)
{
+ Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag|HiddenPredFlag);
}
diff --git a/C/iopreds.c b/C/iopreds.c
index 2a15c70fc..35487d529 100644
--- a/C/iopreds.c
+++ b/C/iopreds.c
@@ -1080,6 +1080,16 @@ ReadlineGetc(int sno)
#endif /* HAVE_LIBREADLINE */
+static Int
+p_has_readline(void)
+{
+#if HAVE_LIBREADLINE
+ return TRUE;
+#else
+ return FALSE;
+#endif
+}
+
int
Yap_GetCharForSIGINT(void)
@@ -5937,6 +5947,7 @@ Yap_InitIOPreds(void)
#endif
Yap_InitCPred ("$same_file", 2, p_same_file, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred ("$float_format", 1, p_float_format, SafePredFlag|SyncPredFlag|HiddenPredFlag);
+ Yap_InitCPred ("$has_readline", 0, p_has_readline, SafePredFlag|HiddenPredFlag);
Yap_InitReadUtil ();
#if USE_SOCKET
diff --git a/changes-5.1.html b/changes-5.1.html
index 31cd83802..61fdb2ec2 100644
--- a/changes-5.1.html
+++ b/changes-5.1.html
@@ -16,6 +16,8 @@
Yap-5.1.3:
+- FIXED: support checking for big_nums and readline. (obs from
+Rui Camacho)
- FIXED: make thread_create more compatible with SWI. (obs from
Paulo Moura)
- FIXED: give startup path to chr. (obs from Paulo Moura)
diff --git a/docs/yap.tex b/docs/yap.tex
index c3da20750..ff4861f72 100644
--- a/docs/yap.tex
+++ b/docs/yap.tex
@@ -6753,9 +6753,9 @@ Just fail
@item system_options
@findex system_options (yap_flag/2 option)
@* This read only flag tells which options were used to compile
-YAP. Currently it informs whether the system supports
+YAP. Currently it informs whether the system supports @code{big_numbers},
@code{coroutining}, @code{depth_limit}, @code{low_level_tracer},
-@code{or-parallelism}, @code{rational_trees}, @code{tabling},
+@code{or-parallelism}, @code{rational_trees}, @code{readline}, @code{tabling},
@code{threads}, or the @code{wam_profiler}.
@item tabling_mode
diff --git a/pl/directives.yap b/pl/directives.yap
index b99895e86..69aef54c5 100644
--- a/pl/directives.yap
+++ b/pl/directives.yap
@@ -492,6 +492,8 @@ yap_flag(single_var_warnings,X) :-
yap_flag(system_options,X) :-
'$system_options'(X).
+'$system_options'(big_numbers) :-
+ '$has_bignums'.
'$system_options'(coroutining) :-
'$yap_has_coroutining'.
'$system_options'(depth_limit) :-
@@ -502,6 +504,8 @@ yap_flag(system_options,X) :-
\+ '$undefined'('$yapor_on', prolog).
'$system_options'(rational_trees) :-
'$yap_has_rational_trees'.
+'$system_options'(readline) :-
+ '$has_readline'.
'$system_options'(tabling) :-
\+ '$undefined'('$do_table'(_,_), prolog).
'$system_options'(threads) :-