]> www.ginac.de Git - cln.git/blob - m4/param.m4
INSTALL.CMake: proper installation command
[cln.git] / m4 / param.m4
1 dnl -*- Autoconf -*-
2 dnl Copyright (C) 1993-2008, 2011, 2017 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.61])
12
13 dnl CL_MACHINE([MESSAGE], [PROGRAM_TO_RUN], [CROSS_MACRO], [DESTINATION], [CACHE_VAR])
14 AC_DEFUN([CL_MACHINE],
15 [
16   AC_REQUIRE([AC_PROG_CC])
17   AC_REQUIRE([AC_C_CHAR_UNSIGNED])
18   cl_machine_file_c=$2
19   if test -z "$[$5]"; then
20     AC_MSG_CHECKING(for [$1])
21     cl_machine_file_h=$4
22     cl_machine_file_program=`cat "$cl_machine_file_c"`
23     AC_RUN_IFELSE(
24       [AC_LANG_SOURCE([
25          #include "confdefs.h"
26          $cl_machine_file_program
27          ])],
28       [AC_MSG_RESULT([created $cl_machine_file_h])
29        if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
30          # The file exists and we would not be changing it
31          rm -f conftest.h
32        else
33          rm -f "$cl_machine_file_h"
34          mv conftest.h "$cl_machine_file_h"
35        fi
36        [$5]=1
37       ],
38       [AC_MSG_RESULT([creation of $cl_machine_file_h failed])],
39       [AC_MSG_RESULT([creating $cl_machine_file_h])
40        $3([$4])
41       ])
42     rm -f conftest.h
43   fi
44 ])