diff --git a/configure.ac b/configure.ac index 589c798ed..8c791ca35 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,9 @@ AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes) AM_PATH_LISPDIR +AC_DEFINE_UNQUOTED([HOST_TYPE], ["$host"], + [Define to the host's GNU triplet.]) + #-------------------------------------------------------------------- # # User options (after above tests that may set default CFLAGS etc.) diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi index f7d0962df..f4caa8ac9 100644 --- a/doc/ref/api-options.texi +++ b/doc/ref/api-options.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -178,6 +178,14 @@ libguile/libpath.h, which is completely generated, so deleting this file before a build guarantees up-to-date values for that build. @end defvar +@cindex GNU triplet +@cindex canonical host type + +@defvar %host-type +The canonical host type (GNU triplet) of the host Guile was configured +for, e.g., @code{"x86_64-unknown-linux-gnu"} (@pxref{Canonicalizing,,, +autoconf, The GNU Autoconf Manual}). +@end defvar @node Feature Tracking @subsection Feature Tracking diff --git a/libguile/load.c b/libguile/load.c index f2c06f04f..246cf8977 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -778,6 +778,10 @@ scm_c_primitive_load_path (const char *filename) /* Information about the build environment. */ +SCM_VARIABLE_INIT (sys_host_type, "%host-type", + scm_from_locale_string (HOST_TYPE)); + + /* Initialize the scheme variable %guile-build-info, based on data provided by the Makefile, via libpath.h. */ static void