Initial version of Go bindings.
[oota-llvm.git] / autoconf / configure.ac
index 3e72ff5ea1a1a8cdb8c8571d0067103193b4f25f..a198280f23d12494568b4828d36ed79b45512f0a 100644 (file)
@@ -1287,6 +1287,7 @@ AC_PATH_PROG(GROFF, [groff])
 AC_PATH_PROG(GZIPBIN, [gzip])
 AC_PATH_PROG(PDFROFF, [pdfroff])
 AC_PATH_PROG(ZIP, [zip])
+AC_PATH_PROG(GO, [go])
 AC_PATH_PROGS(OCAMLC, [ocamlc])
 AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
 AC_PATH_PROGS(OCAMLDEP, [ocamldep])
@@ -1867,6 +1868,11 @@ if test "$BINDINGS_TO_BUILD" = auto ; then
   if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
     BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
   fi
+  if test "x$GO" != x ; then
+    if $GO run ${srcdir}/bindings/go/conftest.go ; then
+      BINDINGS_TO_BUILD="go $BINDINGS_TO_BUILD"
+    fi
+  fi
 fi
 AC_SUBST(BINDINGS_TO_BUILD,$BINDINGS_TO_BUILD)
 
@@ -1901,6 +1907,19 @@ for a_binding in $BINDINGS_TO_BUILD ; do
       fi
     fi
     ;;
+  go)
+    if test "x$GO" = x ; then
+      AC_MSG_WARN([--enable-bindings=go specified, but go not found. Try configure GO=/path/to/go])
+      binding_prereqs_failed=1
+    else
+      if $GO run ${srcdir}/bindings/go/conftest.go ; then
+        :
+      else
+        AC_MSG_WARN([--enable-bindings=go specified, but need at least Go 1.2. Try configure GO=/path/to/go])
+        binding_prereqs_failed=1
+      fi
+    fi
+    ;;
   esac
 done
 if test "$binding_prereqs_failed" = 1 ; then