[ODE] cross-compiling

Rodrigo Hernandez kwizatz at aeongames.com
Wed Jul 5 08:47:15 MST 2006


Thanks, I'll be looking at it and merging it into SVN

Daniel Monteiro Basso wrote:
> Hi,
>
> I made some changes to the configure.in file to allow cross-compiling
> from linux to windows, the patch file is attached. It was generated
> with:
> diff -Naur configure.in ../ode-0.6/configure.in >cross.patch
>
> It checks whether the building host is the same as the target host, and
> in the case it isn't, no AC_TRY_RUN is allowed and default values are
> used.
>
> As ODE is a library that may be used by other projects that also make
> use of autotools, I suggest the PACKAGE* and VERSION defines in
> include/ode/config.h.in be removed (they are defined in compile-time
> through -D switches anyway).
>
> Daniel
>   
> ------------------------------------------------------------------------
>
> --- configure.in	2006-07-05 00:08:44.000000000 -0300
> +++ ../ode-0.6/configure.in	2006-05-23 14:43:32.000000000 -0300
> @@ -85,8 +85,6 @@
>  dnl DOUBLE was chosen
>  AC_DEFINE(dDOUBLE,,[Use double precision])
>  dnl Check from lest likelly to more likelly.
> -if test "$build_os" == "$target_os"
> -then
>  AC_TRY_RUN([
>  #define dInfinity 1e20
>  int main()
> @@ -126,15 +124,9 @@
>  }
>  ],dinfinity=DBL_MAX,,)
>  else
> -#cross-compiling, use a reasonable value. We should add an option for setting this.
> -dinfinity=DBL_MAX
> -fi
> -else
>  dnl default to SINGLE.
>  AC_DEFINE(dSINGLE,,[Use single precision])
>  dnl Check from lest likelly to more likelly.
> -if test "$build_os" == "$target_os"
> -then
>  AC_TRY_RUN([
>  #define dInfinity 1e20f
>  int main()
> @@ -173,9 +165,6 @@
>  else return -1;
>  }
>  ],dinfinity=FLT_MAX,,)
> -#cross-compiling, use a reasonable value. We should add an option for setting this.
> -dinfinity=FLT_MAX
> -fi
>  fi
>  AC_MSG_RESULT($precision)
>  AC_DEFINE_UNQUOTED(dInfinity,${dinfinity},[dInfinity Constant])
> @@ -207,8 +196,6 @@
>  
>  
>  dnl Check for PENTIUM
> -if test "$build_os" == "$target_os"
> -then
>  AC_MSG_CHECKING(for a Pentium CPU)
>  AC_TRY_RUN([
>  int main() 
> @@ -218,9 +205,6 @@
>  return 0;
>  };
>  ],pentium=yes,pentium=no,)
> -else
> -pentium=no
> -fi
>  if test "x$pentium" == xyes 
>  then
>  AC_DEFINE(PENTIUM,1,[is this a pentium on a gcc-based platform?])
> @@ -229,8 +213,6 @@
>  
>  dnl Check for 64bit CPU
>  AC_MSG_CHECKING(for a x86-64 CPU)
> -if test "$build_os" == "$target_os"
> -then
>  AC_TRY_RUN([
>  int main()
>  {
> @@ -242,9 +224,6 @@
>  return 0;
>  };
>  ],cpu64=yes,cpu64=no,)
> -else
> -cpu64=no
> -fi
>  if test "x$cpu64" == xyes 
>  then
>  AC_DEFINE(X86_64_SYSTEM,1,[is this a X86_64 system on a gcc-based platform?])
> @@ -378,15 +357,12 @@
>  
>  dnl Check for autoscan sugested functions
>  AC_CHECK_FUNCS([floor memmove memset select sqrt sqrtf sinf cosf fabsf atan2f fmodf copysignf copysign snprintf vsnprintf gettimeofday isnan isnanf _isnan _isnanf __isnan __isnanf])
> -if test "$build_os" == "$target_os"
> -then
>  AC_FUNC_ALLOCA 
>  AC_FUNC_MALLOC
>  AC_FUNC_OBSTACK 
>  AC_FUNC_REALLOC
>  AC_FUNC_SELECT_ARGTYPES
>  AC_FUNC_VPRINTF
> -fi
>  
>  dnl include found system headers into config.h
>  AH_TOP([
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>   



More information about the ODE mailing list