visualtest/acinclude.m4
author Ryan C. Gordon <icculus@icculus.org>
Fri, 12 Aug 2016 19:59:00 -0400
changeset 10266 c09f06c4e8c8
parent 7924 fcb86d323770
permissions -rwxr-xr-x
emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7924
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
# Configure paths for SDL
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
# Sam Lantinga 9/21/99
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
# stolen from Manish Singh
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
# stolen back from Frank Belew
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
# stolen from Manish Singh
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
# Shamelessly stolen from Owen Taylor
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
# serial 1
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
AC_DEFUN([AM_PATH_SDL2],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
[dnl 
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
dnl Get the cflags and libraries from the sdl2-config script
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
            sdl_prefix="$withval", sdl_prefix="")
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
            sdl_exec_prefix="$withval", sdl_exec_prefix="")
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
		    , enable_sdltest=yes)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
  min_sdl_version=ifelse([$1], ,0.9.0,$1)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
  if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
    PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
           [sdl_pc=yes],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
           [sdl_pc=no])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
  else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
    sdl_pc=no
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
    if test x$sdl_exec_prefix != x ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
      sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
      if test x${SDL_CONFIG+set} != xset ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
        SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
      fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
    fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
    if test x$sdl_prefix != x ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
      sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
      if test x${SDL_CONFIG+set} != xset ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
        SDL_CONFIG=$sdl_prefix/bin/sdl2-config
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
      fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
    fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
  fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
  if test "x$sdl_pc" = xyes ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
    no_sdl=""
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
    SDL_CONFIG="pkg-config sdl2"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
  else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
    as_save_PATH="$PATH"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
    if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
      PATH="$prefix/bin:$prefix/usr/bin:$PATH"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
    fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
    AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
    PATH="$as_save_PATH"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
    AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
    no_sdl=""
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
    if test "$SDL_CONFIG" = "no" ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
      no_sdl=yes
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
    else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
      SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
      SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
      sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
      sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
      sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
      if test "x$enable_sdltest" = "xyes" ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
        ac_save_CFLAGS="$CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
        ac_save_CXXFLAGS="$CXXFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
        ac_save_LIBS="$LIBS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
        CFLAGS="$CFLAGS $SDL_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
        LIBS="$LIBS $SDL_LIBS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
dnl Now check if the installed SDL is sufficiently new. (Also sanity
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
dnl checks the results of sdl2-config to some extent
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
      rm -f conf.sdltest
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
      AC_TRY_RUN([
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
#include <stdio.h>
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
#include <stdlib.h>
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
#include <string.h>
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
#include "SDL.h"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
char*
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
my_strdup (char *str)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
{
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
  char *new_str;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
  
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
  if (str)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
    {
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
      strcpy (new_str, str);
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
    }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
  else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
    new_str = NULL;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
  
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
  return new_str;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
}
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
int main (int argc, char *argv[])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
{
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
  int major, minor, micro;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
  char *tmp_version;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
  /* This hangs on some systems (?)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
  system ("touch conf.sdltest");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
  */
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
  /* HP/UX 9 (%@#!) writes to sscanf strings */
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
  tmp_version = my_strdup("$min_sdl_version");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
     printf("%s, bad version string\n", "$min_sdl_version");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
     exit(1);
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
   }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
   if (($sdl_major_version > major) ||
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
    {
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
      return 0;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
    }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
  else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
    {
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
      printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
      printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
      printf("*** best to upgrade to the required version.\n");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
      printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
      printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
      printf("*** config.cache before re-running configure\n");
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
      return 1;
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
    }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
}
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
        CFLAGS="$ac_save_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
        CXXFLAGS="$ac_save_CXXFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
        LIBS="$ac_save_LIBS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
      fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
    fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
    if test "x$no_sdl" = x ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
      AC_MSG_RESULT(yes)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
    else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
      AC_MSG_RESULT(no)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
    fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
  fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
  if test "x$no_sdl" = x ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
     ifelse([$2], , :, [$2])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
  else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
     if test "$SDL_CONFIG" = "no" ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
       echo "*** The sdl2-config script installed by SDL could not be found"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
       echo "*** your path, or set the SDL_CONFIG environment variable to the"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
       echo "*** full path to sdl2-config."
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
     else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
       if test -f conf.sdltest ; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
        :
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
       else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
          echo "*** Could not run SDL test program, checking why..."
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
          CFLAGS="$CFLAGS $SDL_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
          LIBS="$LIBS $SDL_LIBS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
          AC_TRY_LINK([
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
#include <stdio.h>
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
#include "SDL.h"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
int main(int argc, char *argv[])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
{ return 0; }
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
#undef  main
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
#define main K_and_R_C_main
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
],      [ return 0; ],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
        [ echo "*** The test program compiled, but did not run. This usually means"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
          echo "*** that the run-time linker is not finding SDL or finding the wrong"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
          echo "*** is required on your system"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
	  echo "***"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
          echo "*** If you have an old version installed, it is best to remove it, although"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
          echo "*** may want to edit the sdl2-config script: $SDL_CONFIG" ])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   190
          CFLAGS="$ac_save_CFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
          CXXFLAGS="$ac_save_CXXFLAGS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
          LIBS="$ac_save_LIBS"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
       fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
     fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
     SDL_CFLAGS=""
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
     SDL_LIBS=""
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
     ifelse([$3], , :, [$3])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
  fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
  AC_SUBST(SDL_CFLAGS)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
  AC_SUBST(SDL_LIBS)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
  rm -f conf.sdltest
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
# serial 1 (pkg-config-0.24)
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
# 
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
# This program is free software; you can redistribute it and/or modify
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
# it under the terms of the GNU General Public License as published by
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
# the Free Software Foundation; either version 2 of the License, or
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
# (at your option) any later version.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
# This program is distributed in the hope that it will be useful, but
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
# WITHOUT ANY WARRANTY; without even the implied warranty of
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
# General Public License for more details.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
# You should have received a copy of the GNU General Public License
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
# along with this program; if not, write to the Free Software
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   220
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   221
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
# As a special exception to the GNU General Public License, if you
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   223
# distribute this file as part of a program that contains a
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
# configuration script generated by Autoconf, you may include it under
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
# the same distribution terms that you use for the rest of that program.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   227
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
# ----------------------------------
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
AC_DEFUN([PKG_PROG_PKG_CONFIG],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   231
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   234
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   235
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   236
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   237
	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   238
fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   239
if test -n "$PKG_CONFIG"; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   240
	_pkg_min_version=m4_default([$1], [0.9.0])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
		AC_MSG_RESULT([yes])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
	else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
		AC_MSG_RESULT([no])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
		PKG_CONFIG=""
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
	fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   248
fi[]dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   249
])# PKG_PROG_PKG_CONFIG
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   250
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   251
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   252
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   253
# Check to see whether a particular set of modules exists.  Similar
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   254
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   255
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   256
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   257
# only at the first occurence in configure.ac, so if the first place
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   258
# it's called might be skipped (such as if it is within an "if", you
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   259
# have to call PKG_CHECK_EXISTS manually
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   260
# --------------------------------------------------------------
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   261
AC_DEFUN([PKG_CHECK_EXISTS],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   262
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   263
if test -n "$PKG_CONFIG" && \
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   264
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   265
  m4_default([$2], [:])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   266
m4_ifvaln([$3], [else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   267
  $3])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   268
fi])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   269
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   270
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   271
# ---------------------------------------------
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   272
m4_define([_PKG_CONFIG],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   273
[if test -n "$$1"; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   274
    pkg_cv_[]$1="$$1"
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   275
 elif test -n "$PKG_CONFIG"; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   276
    PKG_CHECK_EXISTS([$3],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   277
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   278
		     [pkg_failed=yes])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   279
 else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   280
    pkg_failed=untried
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   281
fi[]dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   282
])# _PKG_CONFIG
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   283
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   284
# _PKG_SHORT_ERRORS_SUPPORTED
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   285
# -----------------------------
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   286
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   287
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   288
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   289
        _pkg_short_errors_supported=yes
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   290
else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   291
        _pkg_short_errors_supported=no
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   292
fi[]dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   293
])# _PKG_SHORT_ERRORS_SUPPORTED
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   294
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   295
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   296
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   297
# [ACTION-IF-NOT-FOUND])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   298
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   299
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   300
# Note that if there is a possibility the first call to
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   301
# PKG_CHECK_MODULES might not happen, you should be sure to include an
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   302
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   303
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   304
#
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   305
# --------------------------------------------------------------
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   306
AC_DEFUN([PKG_CHECK_MODULES],
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   307
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   308
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   309
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   310
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   311
pkg_failed=no
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   312
AC_MSG_CHECKING([for $1])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   313
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   314
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   315
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   316
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   317
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   318
and $1[]_LIBS to avoid the need to call pkg-config.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   319
See the pkg-config man page for more details.])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   320
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   321
if test $pkg_failed = yes; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   322
   	AC_MSG_RESULT([no])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   323
        _PKG_SHORT_ERRORS_SUPPORTED
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   324
        if test $_pkg_short_errors_supported = yes; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   325
	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   326
        else 
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   327
	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   328
        fi
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   329
	# Put the nasty error message in config.log where it belongs
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   330
	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   331
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   332
	m4_default([$4], [AC_MSG_ERROR(
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   333
[Package requirements ($2) were not met:
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   334
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   335
$$1_PKG_ERRORS
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   336
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   337
Consider adjusting the PKG_CONFIG_PATH environment variable if you
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   338
installed software in a non-standard prefix.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   339
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   340
_PKG_TEXT])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   341
        ])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   342
elif test $pkg_failed = untried; then
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   343
     	AC_MSG_RESULT([no])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   344
	m4_default([$4], [AC_MSG_FAILURE(
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   345
[The pkg-config script could not be found or is too old.  Make sure it
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   346
is in your PATH or set the PKG_CONFIG environment variable to the full
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   347
path to pkg-config.
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   348
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   349
_PKG_TEXT
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   350
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   351
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   352
        ])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   353
else
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   354
	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   355
	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   356
        AC_MSG_RESULT([yes])
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   357
	$3
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   358
fi[]dnl
fcb86d323770 Added Apoorv Upreti's GSoC2013 work: visual test suite.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   359
])# PKG_CHECK_MODULES