*** empty log message ***
[bpt/guile.git] / configure.in
index c25778e..77ef365 100644 (file)
@@ -163,6 +163,9 @@ AC_ISC_POSIX
 AC_MINIX
 
 AM_PROG_CC_STDC
+
+## Needed for building DLLs on Cygwin, before AM_PROG_LIBTOOL
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
 AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
@@ -392,7 +395,11 @@ fi
 
 AC_MSG_CHECKING(for working IPv6 support)
 AC_CACHE_VAL(guile_cv_have_ipv6,
-[AC_TRY_COMPILE([#include <netinet/in.h>
+[AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>
 #include <sys/socket.h>],
 [struct sockaddr_in6 a;  a.sin6_family = AF_INET6;],
 guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)])
@@ -404,7 +411,11 @@ fi
 # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
 AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
 AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
-[AC_TRY_COMPILE([#include <netinet/in.h>],
+[AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>],
 [struct sockaddr_in6 sok;  sok.sin6_scope_id = 0;],
 guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)])
 AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
@@ -495,6 +506,10 @@ fi
 
 AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
 
+AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
+
+AC_CHECK_FUNCS(finite isinf isnan copysign)
+
 # When testing for the presence of alloca, we need to add alloca.o
 # explicitly to LIBOBJS to make sure that it is translated to
 # `alloca.lo' for libtool later on.  This can and should be done more cleanly.
@@ -659,6 +674,54 @@ if test "${THREAD_PACKAGE}" != "" ; then
   fi
 fi
 
+## Cross building      
+if test "$cross_compiling" = "yes"; then
+  AC_MSG_CHECKING(cc for build)
+  ## /usr/bin/cc still uses wrong assembler
+  ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
+  CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
+else
+  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi   
+AC_ARG_WITH(cc-for-build,
+  [  --with-cc-for-build=CC  native C compiler, to be used during build])
+test -n "$with_cc_for_build" && CC_FOR_BUILD="$with_cc_for_build"
+     
+## AC_MSG_CHECKING("if we are cross compiling")
+## AC_MSG_RESULT($cross_compiling)
+if test "$cross_compiling" = "yes"; then
+   AC_MSG_RESULT($CC_FOR_BUILD)
+fi
+
+## No need as yet to be more elaborate
+CCLD_FOR_BUILD="$CC_FOR_BUILD"
+
+AC_SUBST(cross_compiling)
+AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CCLD_FOR_BUILD)
+       
+## libtool erroneously calls CC_FOR_BUILD HOST_CC;
+## --HOST is the platform that PACKAGE is compiled for.
+HOST_CC="$CC_FOR_BUILD"
+AC_SUBST(HOST_CC)
+
+if test "$cross_compiling" = "yes"; then
+  AC_MSG_CHECKING(guile for build)
+  GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
+else
+  GUILE_FOR_BUILD='$(preinstguile)'
+fi   
+AC_ARG_WITH(guile-for-build,
+  [  --with-guile-for-build=guile  native guile executable, to be used during build])
+test -n "$with_guile_for_build" && GUILE_FOR_BUILD="$with_guile_for_build"
+
+## AC_MSG_CHECKING("if we are cross compiling")
+## AC_MSG_RESULT($cross_compiling)
+if test "$cross_compiling" = "yes"; then
+   AC_MSG_RESULT($GUILE_FOR_BUILD)
+fi
+AC_SUBST(GUILE_FOR_BUILD)
+                       
 ## If we're using GCC, ask for aggressive warnings.
 case "$GCC" in
   yes )