Browse Source

Make it possible to cross-compile CLN.

master
Bruno Haible 20 years ago
parent
commit
c437fd0700
  1. 10
      ChangeLog
  2. 18
      autoconf/aclocal.m4
  3. 4
      configure.ac

10
ChangeLog

@ -1,3 +1,13 @@
2005-08-27 Bruno Haible <bruno@clisp.org>
Make it possible to cross-compile CLN.
* m4/intparam.m4: New file.
* m4/floatparam.m4: New file.
* autoconf/aclocal.m4: Include both.
(CL_MACHINE): Add an additional CROSS_MACRO parameter.
* configure.ac (CL_MACHINE): When cross-compiling, use
CL_INTPARAM_CROSS and CL_FLOATPARAM_CROSS.
2005-08-27 Bruno Haible <bruno@clisp.org> 2005-08-27 Bruno Haible <bruno@clisp.org>
Define HAVE_LONGLONG and HAVE_LONGDOUBLE when cross-compiling. Define HAVE_LONGLONG and HAVE_LONGDOUBLE when cross-compiling.

18
autoconf/aclocal.m4

@ -11,6 +11,9 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
m4_include([intparam.m4])
m4_include([floatparam.m4])
dnl -*- Autoconf -*- dnl -*- Autoconf -*-
dnl Copyright (C) 1993-2003 Free Software Foundation, Inc. dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU dnl This file is free software, distributed under the terms of the GNU
@ -543,7 +546,7 @@ fi
]) ])
dnl -*- Autoconf -*- dnl -*- Autoconf -*-
dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
dnl Copyright (C) 1993-2005 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program dnl Public License, this file may be distributed as part of a program
@ -554,14 +557,15 @@ dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
AC_PREREQ(2.13) AC_PREREQ(2.13)
dnl CL_MACHINE([MESSAGE], [PROGRAM_TO_RUN], [CROSS_MACRO], [DESTINATION], [CACHE_VAR])
AC_DEFUN([CL_MACHINE], AC_DEFUN([CL_MACHINE],
[AC_REQUIRE([AC_PROG_CC])dnl [AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_C_CHAR_UNSIGNED])dnl AC_REQUIRE([AC_C_CHAR_UNSIGNED])dnl
cl_machine_file_c=$2 cl_machine_file_c=$2
cl_machine_file_h=$3
if test $cross_compiling = no; then
if test -z "$[$4]"; then
if test -z "$[$5]"; then
AC_CHECKING(for [$1]) AC_CHECKING(for [$1])
if test $cross_compiling = no; then
cl_machine_file_h=$4
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
EOF EOF
@ -584,14 +588,14 @@ if test -s conftest; then
rm -f "$cl_machine_file_h" rm -f "$cl_machine_file_h"
mv conftest.h "$cl_machine_file_h" mv conftest.h "$cl_machine_file_h"
fi fi
[$4]=1
[$5]=1
else else
echo "creation of $cl_machine_file_h failed" echo "creation of $cl_machine_file_h failed"
fi fi
rm -f conftest* rm -f conftest*
fi
else else
echo "cross-compiling - cannot create $cl_machine_file_h"
$3([$4])
fi
fi fi
]) ])

4
configure.ac

@ -142,9 +142,9 @@ dnl
AC_C_CHAR_UNSIGNED AC_C_CHAR_UNSIGNED
dnl DEFS __CHAR_UNSIGNED__ if char is unsigned dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
test -d 'include/cln' || mkdir -p 'include/cln' test -d 'include/cln' || mkdir -p 'include/cln'
CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
dnl builds include/cln/intparam.h dnl builds include/cln/intparam.h
CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
dnl builds include/cln/floatparam.h dnl builds include/cln/floatparam.h
dnl dnl
dnl interfacing to GNU gmp (must be at least version 3) dnl interfacing to GNU gmp (must be at least version 3)

Loading…
Cancel
Save