File: ax_check_libsdl.m4

package info (click to toggle)
povray 1%3A3.7.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 147,232 kB
  • sloc: cpp: 845,011; ansic: 122,118; sh: 34,204; pascal: 6,420; asm: 3,355; ada: 1,681; makefile: 1,389; cs: 879; awk: 590; perl: 245; xml: 95
file content (64 lines) | stat: -rw-r--r-- 1,861 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
# SYNOPSIS
#
#   AX_CHECK_LIBSDL(required_version)
#
# DESCRIPTION
#
#   Check whether the system has libSDL version required_version.
#
# LAST MODIFICATION
#
#   2007-11-08
#
# COPYLEFT
#
#   Copyright (c) 2007 Nicolas Calimet
#
#   Copying and distribution of this file, with or without
#   modification, are permitted in any medium without royalty provided
#   the copyright notice and this notice are preserved.

AC_DEFUN([AX_CHECK_LIBSDL],
[
  AC_CHECK_PROGS([SDLCONFIG], [sdl-config])

  AC_MSG_CHECKING([for libSDL])
  ax_check_libsdl=`sdl-config 2>&1 | grep -v Usage`
  if test x"$ax_check_libsdl" != x""; then
    ax_check_libsdl="not found"
    AC_MSG_RESULT([$ax_check_libsdl])
  else
    AC_MSG_RESULT([yes])

    AC_MSG_CHECKING([for libSDL version >= $1])
    ax_check_libsdl_version=`sdl-config --version 2> /dev/null`
    if test x"$ax_check_libsdl_version" != x""; then
      AX_COMPARE_VERSION([$ax_check_libsdl_version], [ge], [$1], [ax_check_libsdl="ok"], [ax_check_libsdl="bad"])
      AC_MSG_RESULT([$ax_check_libsdl_version, $ax_check_libsdl])
    else
      ax_check_libsdl="unknown"
      AC_MSG_RESULT([$ax_check_libsdl])
    fi

    if test x"$ax_check_libsdl" = x"ok"; then
      ax_check_libsdl_cflags=`sdl-config --cflags 2> /dev/null`
      ax_check_libsdl_libs=`sdl-config --libs 2> /dev/null`
      ax_check_libsdl_save_cppflags="$CPPFLAGS"
      ax_check_libsdl_save_libs="$LIBS"
      CPPFLAGS="$ax_check_libsdl_cflags $CPPFLAGS"
      LIBS="$ax_check_libsdl_libs $LIBS"

      # check include file
      AC_CHECK_HEADER(
        [SDL/SDL.h],
        [AC_CHECK_LIB([SDL], [SDL_Quit], [], [ax_check_libsdl="not found"])],
        [ax_check_libsdl="no headers"]
      )
    fi

    if test x"$ax_check_libsdl" != x"ok"; then
      CPPFLAGS="$ax_check_libsdl_save_cppflags"
      LIBS="$ax_check_libsdl_save_libs"
    fi
  fi
])