diff --git a/src/aclocal.m4 b/src/aclocal.m4
index 20c719e5bf2b72c3d82853a388ea1ae7696e7eda..7afb21b93ede61ba0722af1ec6bd983e5a60bdd4 100644
--- a/src/aclocal.m4
+++ b/src/aclocal.m4
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.159 2008/01/10 23:22:59 grubba Exp $
+dnl $Id: aclocal.m4,v 1.160 2008/01/11 00:22:27 grubba Exp $
 
 dnl Some compatibility with Autoconf 2.50+. Not complete.
 dnl newer Autoconf calls substr m4_substr
@@ -594,7 +594,7 @@ define([PIKE_RETAIN_VARIABLES],
 
 define([AC_LOW_MODULE_INIT],
 [
-  # $Id: aclocal.m4,v 1.159 2008/01/10 23:22:59 grubba Exp $
+  # $Id: aclocal.m4,v 1.160 2008/01/11 00:22:27 grubba Exp $
 
   MY_AC_PROG_CC
 
@@ -649,6 +649,8 @@ define([AC_LOW_MODULE_INIT],
     fi
   fi
   AC_SUBST(RUNPIKE)
+
+  PIKE_CHECK_LIBGCC
 ])
 
 
diff --git a/src/configure.in b/src/configure.in
index 90b40a535f0a5a6c70fee7c16b17323ffabca04d..dc85d0d22c3e95e9b5c2ca06c27983c7717cd46d 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1,4 +1,4 @@
-AC_REVISION("$Id: configure.in,v 1.1033 2008/01/10 23:23:16 grubba Exp $")
+AC_REVISION("$Id: configure.in,v 1.1034 2008/01/11 00:22:27 grubba Exp $")
 AC_INIT(interpret.c)
 AC_CONFIG_HEADER(machine.h)
 
@@ -2327,7 +2327,7 @@ if test "x$PIKE_PATH_TRANSLATE" = "x"; then
     # MinGW system.
     cat <<\EOF
 #!/bin/sh
-# Automatically generated by $Id: configure.in,v 1.1033 2008/01/10 23:23:16 grubba Exp $.
+# Automatically generated by $Id: configure.in,v 1.1034 2008/01/11 00:22:27 grubba Exp $.
 # MinGW-version. Do NOT edit.
 posix_name="`cat`"
 posix_prefix="/"
@@ -2365,7 +2365,7 @@ EOF
     # Native POSIX system.
   cat <<\EOF
 #!/bin/sh
-# Automatically generated by $Id: configure.in,v 1.1033 2008/01/10 23:23:16 grubba Exp $.
+# Automatically generated by $Id: configure.in,v 1.1034 2008/01/11 00:22:27 grubba Exp $.
 # POSIX-version. Do NOT edit.
 cat
 EOF
@@ -2374,7 +2374,7 @@ else
   # rntcl-style
   cat <<\EOF
 #!/bin/sh
-# Automatically generated by $Id: configure.in,v 1.1033 2008/01/10 23:23:16 grubba Exp $.
+# Automatically generated by $Id: configure.in,v 1.1034 2008/01/11 00:22:27 grubba Exp $.
 # RNTCL-version. Do NOT edit.
 sed -e "$PIKE_PATH_TRANSLATE"
 EOF
@@ -7709,8 +7709,6 @@ AC_MSG_RESULT($LINKFORSHARED)
 
 #############################################################################
 
-PIKE_CHECK_LIBGCC
-
 # In case we're going to use gcc for linking shared objects,
 # we should use the -static-libgcc flag if it exists.
 # Shared libgcc is nothing but trouble.
diff --git a/src/make_variables.in b/src/make_variables.in
index 4b8d75f099c9f0562ee0e47cd24ed282136ff6d4..f05afa5757d3ea10f4bedff2a0b4524b70db84fc 100644
--- a/src/make_variables.in
+++ b/src/make_variables.in
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# $Id: make_variables.in,v 1.28 2006/08/03 12:00:42 mast Exp $
+# $Id: make_variables.in,v 1.29 2008/01/11 00:22:27 grubba Exp $
 #
 # Note: This template is actually used only for make_variables in the
 # subdirectories; the one created in the build base dir is just an
@@ -53,4 +53,6 @@ MODNAME=@MODULE_NAME@
 MODPATH=@MODULE_PATH@
 MODDIR=@MODULE_DIR@
 
+LIBGCC=@LIBGCC@
+
 # End of make_variables.in
diff --git a/src/modules/dynamic_module_makefile.in b/src/modules/dynamic_module_makefile.in
index 7968efa056a5ae062fce50025e4582f234422bc1..1084652426b543043db903f759e247f0568edba1 100644
--- a/src/modules/dynamic_module_makefile.in
+++ b/src/modules/dynamic_module_makefile.in
@@ -1,8 +1,7 @@
 #
-# $Id: dynamic_module_makefile.in,v 1.123 2006/08/02 21:19:03 mast Exp $
+# $Id: dynamic_module_makefile.in,v 1.124 2008/01/11 00:22:27 grubba Exp $
 #
 
-LIBGCC=@LIBGCC@
 LC_REQ=@LC_REQ@
 
 LINKAGE_CPPFLAGS=