]> www.ginac.de Git - cln.git/blob - m4/param.m4
* Fix typo.
[cln.git] / m4 / param.m4
1 dnl -*- Autoconf -*-
2 dnl Copyright (C) 1993-2005 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
11 AC_PREREQ(2.13)
12
13 dnl CL_MACHINE([MESSAGE], [PROGRAM_TO_RUN], [CROSS_MACRO], [DESTINATION], [CACHE_VAR])
14 AC_DEFUN([CL_MACHINE],
15 [AC_REQUIRE([AC_PROG_CC])dnl
16 AC_REQUIRE([AC_C_CHAR_UNSIGNED])dnl
17 cl_machine_file_c=$2
18 if test -z "$[$5]"; then
19 AC_CHECKING(for [$1])
20 if test $cross_compiling = no; then
21 cl_machine_file_h=$4
22 cat > conftest.$ac_ext <<EOF
23 #include "confdefs.h"
24 EOF
25 cat "$cl_machine_file_c" >> conftest.$ac_ext
26 ORIGCC="$CC"
27 if test $ac_cv_prog_gcc = yes; then
28 # gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
29 # target 80386. Strip "-O".
30 CC=`echo "$CC " | sed -e 's/-O //g'`
31 fi
32 AC_TRY_EVAL(ac_link)
33 CC="$ORIGCC"
34 if test -s conftest; then
35   echo "creating $cl_machine_file_h"
36   ./conftest > conftest.h
37   if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
38     # The file exists and we would not be changing it
39     rm -f conftest.h
40   else
41     rm -f "$cl_machine_file_h"
42     mv conftest.h "$cl_machine_file_h"
43   fi
44   [$5]=1
45 else
46   echo "creation of $cl_machine_file_h failed"
47 fi
48 rm -f conftest*
49 else
50 echo "creating $cl_machine_file_h"
51 $3([$4])
52 fi
53 fi
54 ])