]> git.eshelyaron.com Git - emacs.git/commitdiff
* Add 'comp-native-driver-options-available-p'
authorAndreas Fuchs <asf@boinkor.net>
Fri, 21 Aug 2020 01:05:37 +0000 (21:05 -0400)
committerAndrea Corallo <akrl@sdf.org>
Wed, 26 Aug 2020 19:25:45 +0000 (21:25 +0200)
* src/comp.c (comp-native-driver-options-available-p): New
  function that returns t if driver options can be used.

src/comp.c

index 6cde761f761c041b08055d78858d302e8b101f2a..5bfbfbaf3c9b6bc0596dcd26f8bc70e6cce1c144 100644 (file)
@@ -4122,6 +4122,23 @@ DEFUN ("comp--release-ctxt", Fcomp__release_ctxt, Scomp__release_ctxt,
   return Qt;
 }
 
+DEFUN ("comp-native-driver-options-available-p", Fcomp_native_driver_options_available_p,
+       Scomp_native_driver_options_available_p,
+       0, 0, 0,
+       doc: /* Return t if `comp-native-driver-options' can be used.  */)
+  (void)
+{
+#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option)  \
+  || defined (WINDOWSNT)
+#pragma GCC diagnostic ignored "-Waddress"
+  if (gcc_jit_context_add_driver_option)
+    return Qt;
+#pragma GCC diagnostic pop
+#endif
+  return Qnil;
+}
+
+
 static void
 add_driver_options (void)
 {
@@ -5123,6 +5140,7 @@ native compiled one.  */);
                             "configuration, please recompile"));
 
   defsubr (&Scomp_el_to_eln_filename);
+  defsubr (&Scomp_native_driver_options_available_p);
   defsubr (&Scomp__init_ctxt);
   defsubr (&Scomp__release_ctxt);
   defsubr (&Scomp__compile_ctxt_to_file);