Add configure guards around literal jv_numbers

Allow building jq in a mode that doesn't use decnumber for benchmarking
purposes. decnumber support is enabled by default, and this option is
meant to be removed once we're happy with the performance.
diff --git a/configure.ac b/configure.ac
index 2d6bf1c..7d2355b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,14 @@
    fi
 ])
 
+dnl Disable decNumber support
+AC_ARG_ENABLE([decnum],
+   AC_HELP_STRING([--disable-decnum], [disable decnum support]))
+
+AS_IF([test "x$enable_decnum" != "xno"],[
+   AC_DEFINE([USE_DECNUM],1)
+])
+
 AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
 AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = xyes])
 AM_CONDITIONAL([ENABLE_UBSAN], [test "x$enable_ubsan" = xyes])
diff --git a/src/jv.c b/src/jv.c
index b2bb495..866dd43 100644
--- a/src/jv.c
+++ b/src/jv.c
@@ -411,6 +411,7 @@
 
 double jv_number_value(jv j) {
   assert(JVP_HAS_KIND(j, JV_KIND_NUMBER));
+#ifdef USE_DECNUM
   if (JVP_HAS_FLAGS(j, JVP_FLAGS_NUMBER_LITERAL)) {
     jvp_literal_number* n = jvp_literal_number_ptr(j);
 
@@ -421,8 +422,11 @@
 
     return n->num_double;
   } else {
+#endif
     return j.u.number;
+#ifdef USE_DECNUM
   }
+#endif
 }
 
 int jv_is_integer(jv j){
diff --git a/src/jv_parse.c b/src/jv_parse.c
index d709e41..9ced9f6 100644
--- a/src/jv_parse.c
+++ b/src/jv_parse.c
@@ -501,11 +501,20 @@
   } else {
     // FIXME: better parser
     p->tokenbuf[p->tokenpos] = 0;
+#ifdef USE_DECNUM
     jv number = jv_number_with_literal(p->tokenbuf);
     if (jv_get_kind(number) == JV_KIND_INVALID) {
       return "Invalid numeric literal";
     }
     TRY(value(p, number));
+#else
+    char *end = 0;
+    double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
+    if (end == 0 || *end != 0) {
+      return "Invalid numeric literal";
+    }
+    TRY(value(p, jv_number(d)));
+#endif
   }
   p->tokenpos = 0;
   return 0;
diff --git a/src/jv_print.c b/src/jv_print.c
index 6c84803..15532c6 100644
--- a/src/jv_print.c
+++ b/src/jv_print.c
@@ -234,10 +234,12 @@
     if (jvp_number_is_nan(x)) {
       jv_dump_term(C, jv_null(), flags, indent, F, S);
     } else {
+#ifdef USE_DECNUM
       const char * literal_data = jv_number_get_literal(x);
       if (literal_data) {
         put_str(literal_data, F, S, flags & JV_PRINT_ISATTY);
       } else {
+#endif
         double d = jv_number_value(x);
         if (d != d) {
           // JSON doesn't have NaN, so we'll render it as "null"
@@ -249,7 +251,9 @@
           put_str(jvp_dtoa_fmt(C, buf, d), F, S, flags & JV_PRINT_ISATTY);
         }
       }
+#ifdef USE_DECNUM
     }
+#endif
     break;
   }
   case JV_KIND_STRING: