File: acinclude.m4

package info (click to toggle)
libchamplain 0.12.15-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,436 kB
  • ctags: 3,502
  • sloc: ansic: 17,857; sh: 11,332; makefile: 425; python: 286; xml: 211
file content (31 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

dnl CHAMPLAIN_CONFIG_COMMANDS is like AC_CONFIG_COMMANDS, except that:
dnl
dnl     1) It redirects the stdout of the command to the file.
dnl     2) It does not recreate the file if contents did not change.
dnl
dnl (macro copied from CAIRO)

AC_DEFUN([CHAMPLAIN_CONFIG_COMMANDS],
[dnl
        AC_CONFIG_COMMANDS($1,
        [
                _config_file=$1
                _tmp_file=champlainconf.tmp
                AC_MSG_NOTICE([creating $_config_file])
                {
                        $2
                } >> "$_tmp_file" ||
                AC_MSG_ERROR([failed to write to $_tmp_file])

                if cmp -s "$_tmp_file" "$_config_file"; then
                  AC_MSG_NOTICE([$_config_file is unchanged])
                  rm -f "$_tmp_file"
                else
                  mv "$_tmp_file" "$_config_file" ||
                  AC_MSG_ERROR([failed to update $_config_file])
                fi
        ], $3)
])