summaryrefslogtreecommitdiff
path: root/m4/baltisot.m4
blob: bcb75e95c25b4371ccd5db156730c5e4fd65e420 (plain)
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
# Configure paths for Baltisot
# Nicolas Noble 2002-12-06
# stolen from Sam Lantinga
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor

dnl AM_PATH_SDL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for BALTISOT, and define BALTISOT_CFLAGS and BALTISOT_LIBS
dnl
AC_DEFUN(AM_PATH_BALTISOT,
[dnl 
dnl Get the cflags and libraries from the baltisot-config script
dnl
AC_ARG_WITH(baltisot-prefix,[  --with-baltisot-prefix=PFX Prefix where Baltisot is installed (optional)],
            baltisot_prefix="$withval", baltisot_prefix="")
AC_ARG_WITH(baltisot-exec-prefix,[  --with-baltisot-exec-prefix=PFX Exec prefix where Baltisot is installed (optional)],
            baltisot_exec_prefix="$withval", baltisot_exec_prefix="")

  if test x$baltisot_exec_prefix != x ; then
     baltisot_args="$baltisot_args --exec-prefix=$baltisot_exec_prefix"
     if test x${BALTISOT_CONFIG+set} != xset ; then
        BALTISOT_CONFIG=$baltisot_exec_prefix/bin/baltisot-config
     fi
  fi
  if test x$baltisot_prefix != x ; then
     baltisot_args="$baltisot_args --prefix=$baltisot_prefix"
     if test x${BALTISOT_CONFIG+set} != xset ; then
        BALTISOT_CONFIG=$baltisot_prefix/bin/baltisot-config
     fi
  fi

  PATH="$prefix/bin:$prefix/usr/bin:$PATH"
  AC_PATH_PROG(BALTISOT_CONFIG, baltisot-config, no, [$PATH])
  no_baltisot=""
  if test "$BALTISOT_CONFIG" = "no" ; then
    no_baltisot=yes
  else
    BALTISOT_CFLAGS=`$BALTISOT_CONFIG $baltisotconf_args --cflags`
    BALTISOT_LIBS=`$BALTISOT_CONFIG $baltisotconf_args --libs`
  fi

  if test "x$no_baltisot" = x ; then
     ifelse([$1], , :, [$1])     
  else
     BALTISOT_CFLAGS=""
     BALTISOT_LIBS=""
     ifelse([$2], , :, [$2])
  fi
  AC_SUBST(BALTISOT_CFLAGS)
  AC_SUBST(BALTISOT_LIBS)
])