~ubuntu-branches/ubuntu/hardy/aide/hardy-proposed

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Mike Markley
  • Date: 2002-03-15 20:20:06 UTC
  • Revision ID: james.westby@ubuntu.com-20020315202006-fywvbk2rzaqe5ku2
Tags: upstream-0.8
ImportĀ upstreamĀ versionĀ 0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Local aide macros
 
2
 
 
3
dnl AIDE_CHECK_TYPEDEF(TYPE, HAVE_NAME)
 
4
dnl Check whether a typedef exists and create a #define $2 if it exists
 
5
dnl
 
6
AC_DEFUN(AIDE_CHECK_TYPEDEF,
 
7
  [ AC_MSG_CHECKING(for $1 typedef)
 
8
    AC_CACHE_VAL(aide_cv_typedef_$1,
 
9
    [AC_TRY_COMPILE([#include <stdlib.h>
 
10
    #include <sys/types.h>], [
 
11
    #undef $1
 
12
    int a = sizeof($1);
 
13
    ], aide_cv_typedef_$1=yes, aide_cv_typedef_$1=no )])
 
14
    AC_MSG_RESULT($aide_cv_typedef_$1)
 
15
    if test "$aide_cv_typedef_$1" = yes; then
 
16
          AC_DEFINE($2)
 
17
    fi
 
18
  ])
 
19
 
 
20
dnl AIDE_CHECK_ENDIAN
 
21
dnl define either LITTLE_ENDIAN_HOST or BIG_ENDIAN_HOST
 
22
dnl
 
23
define(AIDE_CHECK_ENDIAN,
 
24
  [ if test "$cross_compiling" = yes; then
 
25
        AC_MSG_WARN(cross compiling; assuming little endianess)
 
26
    fi
 
27
    AC_MSG_CHECKING(endianess)
 
28
    AC_CACHE_VAL(aide_cv_c_endian,
 
29
      [ aide_cv_c_endian=unknown
 
30
        # See if sys/param.h defines the BYTE_ORDER macro.
 
31
        AC_TRY_COMPILE([#include <sys/types.h>
 
32
        #include <sys/param.h>], [
 
33
        #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 
34
         bogus endian macros
 
35
        #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
 
36
        AC_TRY_COMPILE([#include <sys/types.h>
 
37
        #include <sys/param.h>], [
 
38
        #if BYTE_ORDER != BIG_ENDIAN
 
39
         not big endian
 
40
        #endif], aide_cv_c_endian=big, aide_cv_c_endian=little)])
 
41
        if test "$aide_cv_c_endian" = unknown; then
 
42
            AC_TRY_RUN([main () {
 
43
              /* Are we little or big endian?  From Harbison&Steele.  */
 
44
              union
 
45
              {
 
46
                long l;
 
47
                char c[sizeof (long)];
 
48
              } u;
 
49
              u.l = 1;
 
50
              exit (u.c[sizeof (long) - 1] == 1);
 
51
              }],
 
52
              aide_cv_c_endian=little,
 
53
              aide_cv_c_endian=big,
 
54
              aide_cv_c_endian=little
 
55
            )
 
56
        fi
 
57
      ])
 
58
    AC_MSG_RESULT([$aide_cv_c_endian])
 
59
    if test "$aide_cv_c_endian" = little; then
 
60
      AC_DEFINE(LITTLE_ENDIAN_HOST)
 
61
    else
 
62
      AC_DEFINE(BIG_ENDIAN_HOST)
 
63
    fi
 
64
  ])
 
65
 
 
66
dnl AIDE_LINK_FILES( SRC, DEST )
 
67
dnl same as AC_LINK_FILES, but collect the files to link in
 
68
dnl some special variables and do the link
 
69
dnl when AIDE_DO_LINK_FILES is called
 
70
dnl This is a workaround for AC_LINK_FILES, because it does not work
 
71
dnl correct when using a caching scheme
 
72
dnl
 
73
define(AIDE_LINK_FILES,
 
74
  [ if test "x$wk_link_files_src" = "x"; then
 
75
        wk_link_files_src="$1"
 
76
        wk_link_files_dst="$2"
 
77
    else
 
78
        wk_link_files_src="$wk_link_files_src $1"
 
79
        wk_link_files_dst="$wk_link_files_dst $2"
 
80
    fi
 
81
  ])
 
82
 
 
83
define(AIDE_DO_LINK_FILES,
 
84
  [ AC_LINK_FILES( $wk_link_files_src, $wk_link_files_dst )
 
85
  ])
 
86
 
 
87
dnl AIDE_MSG_PRINT(STRING)
 
88
dnl print a message
 
89
dnl
 
90
define(AIDE_MSG_PRINT,
 
91
  [ echo $ac_n "$1"" $ac_c" 1>&AC_FD_MSG
 
92
  ])
 
93