File: acinclude.m4

package info (click to toggle)
lurker 2.1-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,800 kB
  • ctags: 1,088
  • sloc: cpp: 10,527; sh: 1,348; xml: 1,278; perl: 206; makefile: 198
file content (92 lines) | stat: -rw-r--r-- 3,288 bytes parent folder | download | duplicates (7)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# AC_SEARCH_HEADER_DIRS(HEADER-FILE, SEARCH-DIRS,
#                        [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
#                        [INCLUDES])
AC_DEFUN([AC_SEARCH_HEADER_DIRS],
[AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
AC_CACHE_CHECK([for $1], ac_Header,
[ac_header_search_save_CPPFLAGS=$CPPFLAGS
AS_VAR_SET(ac_Header, no)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT([$5])
@%:@include <$1>])],
                  [AS_VAR_SET(ac_Header, standard)])
if test AS_VAR_GET(ac_Header) = no; then
  for ac_inc in $2; do
    CPPFLAGS="-I$ac_inc $ac_header_search_save_CPPFLAGS"
    AC_COMPILE_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT([$5])
@%:@include <$1>])],
                      [AS_VAR_SET(ac_Header, -I$ac_inc)
break])
  done
fi
CPPFLAGS=$ac_header_search_save_CPPFLAGS])
AS_IF([test AS_VAR_GET(ac_Header) != no],
  [test AS_VAR_GET(ac_Header) = standard || CPPFLAGS="AS_VAR_GET(ac_Header) $CPPFLAGS"
  $3],
      [$4])dnl
AS_VAR_POPDEF([ac_Header])dnl
])

# AC_SEARCH_EXPRESSION_LIBS(EXPR, SEARCH-LIBS, [INCLUDES]
#                          [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
#                          [OTHER-LIBRARIES])
AC_DEFUN([AC_SEARCH_EXPRESSION_LIBS],
[AS_VAR_PUSHDEF([ac_Expression], [ac_cv_expression_$1])dnl
AC_CACHE_CHECK([how $1 links], ac_Expression,
[ac_expression_search_save_LIBS=$LIBS
AS_VAR_SET(ac_Expression, no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$1])],
               [AS_VAR_SET(ac_Expression, "standard")])
if test "AS_VAR_GET(ac_Expression)" = "no"; then
  for ac_lib in $2; do
    LIBS="-l$ac_lib $6 $ac_expression_search_save_LIBS"
    AC_LINK_IFELSE([AC_LANG_PROGRAM([$3], [$1])],
                   [AS_VAR_SET(ac_Expression, -l$ac_lib)
break])
  done
fi
LIBS=$ac_expression_search_save_LIBS])
AS_IF([test "AS_VAR_GET(ac_Expression)" != "no"],
  [test "AS_VAR_GET(ac_Expression)" = "standard" || LIBS="AS_VAR_GET(ac_Expression) $LIBS"
  $4],
      [$5])dnl
AS_VAR_POPDEF([ac_Expression])dnl
])

# AC_SEARCH_CLASS_LIBS(CLASS, SEARCH-LIBS, [INCLUDES]
#                       [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
#                       [OTHER-LIBRARIES])
AC_DEFUN([AC_SEARCH_CLASS_LIBS],
[AC_CACHE_CHECK([for library containing class $1], [ac_cv_class_$1],
[ac_class_search_save_LIBS=$LIBS
ac_cv_class_$1=no
AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$1 foobar])],
               [ac_cv_class_$1="none required"])
if test "$ac_cv_class_$1" = no; then
  for ac_lib in $2; do
    LIBS="-l$ac_lib $6 $ac_class_search_save_LIBS"
    AC_LINK_IFELSE([AC_LANG_PROGRAM([$3], [$1 foobar])],
                   [ac_cv_class_$1="-l$ac_lib" 
break])
  done
fi
LIBS=$ac_class_search_save_LIBS])
AS_IF([test "$ac_cv_class_$1" != no],
  [test "$ac_cv_class_$1" = "none required" || LIBS="$ac_cv_class_$1 $LIBS"
  $4],
      [$5])dnl
])

AC_DEFUN([AC_DEFINE_DIR],
 [prefix_backup="$prefix"
  exec_prefix_backup="$exec_prefix"
  ac_define_dir_result="$2"
  if test "x${prefix}" = "xNONE"; then prefix="${ac_default_prefix}"; fi
  if test "x${exec_prefix}" = "xNONE"; then exec_prefix="${prefix}"; fi
  while echo "$ac_define_dir_result" | grep '\$' >/dev/null; do
    ac_define_dir_result=`eval echo $ac_define_dir_result`
  done
  prefix="${prefix_backup}"
  exec_prefix="${exec_prefix}"
  $1="$ac_define_dir_result"
  AC_SUBST($1)
 ])