libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] m4/libtool.m4: Allow Go language tests to be disabled


From: Eric N. Vander Weele
Subject: [PATCH] m4/libtool.m4: Allow Go language tests to be disabled
Date: Mon, 7 Mar 2016 12:25:29 -0800

Originally, there was no explicit way to disable Go language checks,
similar to the Fortran (i.e., FC and F77).

This change removes the macro that is available in upstream Autoconf and
allows the disablement of tests for the Go language.

Signed-off-by: Eric N. Vander Weele <address@hidden>
---
 m4/libtool.m4 | 118 +++++++++++++++++++++++++---------------------------------
 1 file changed, 51 insertions(+), 67 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ee292af..2281b85 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -847,31 +847,6 @@ m4_defun([_LT_LANG],
 ])# _LT_LANG
 
 
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC],     [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
-  fi
-fi
-if test -z "$GOC"; then
-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
 # _LT_LANG_DEFAULT_CONFIG
 # -----------------------
 m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -8027,6 +8002,10 @@ m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
 
+if test -z "$GO" || test no = "$GO"; then
+  _lt_disable_GO=yes
+fi
+
 # Source file extension for Go test sources.
 ac_ext=go
 
@@ -8034,58 +8013,63 @@ ac_ext=go
 objext=o
 _LT_TAGVAR(objext, $1)=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
+# No sense in running all these tests if we already determined that
+# the GOC compiler isn't working.
+if test yes != "$_lt_disable_GO"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="package main; func main() { }"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='package main; func main() { }'
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
 
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
-_LT_CC_BASENAME([$compiler])
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_GCC=$GCC
+  GCC=yes
+  CC=${GOC-"gccgo"}
+  CFLAGS=$GOFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_TAGVAR(LD, $1)=$LD
+  _LT_CC_BASENAME([$compiler])
 
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  # Go did not exist at the time GCC didn't implicitly link libc in.
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+  _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+  _LT_TAGVAR(reload_flag, $1)=$reload_flag
+  _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
+  ## CAVEAT EMPTOR:
+  ## There is no encapsulation within the following macros, do not change
+  ## the running order or otherwise move them around unless you know exactly
+  ## what you are doing...
+  if test -n "$compiler"; then
+    _LT_COMPILER_NO_RTTI($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
 
-  _LT_CONFIG($1)
-fi
+    _LT_CONFIG($1)
+  fi
 
-AC_LANG_RESTORE
 
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_GO"
+
+AC_LANG_RESTORE
 ])# _LT_LANG_GO_CONFIG
 
 
-- 
2.7.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]