File: configure.in

package info (click to toggle)
mousetrap 1.0c-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,168 kB
  • ctags: 109
  • sloc: sh: 2,353; cpp: 899; makefile: 52
file content (90 lines) | stat: -rw-r--r-- 2,113 bytes parent folder | download | duplicates (5)
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

AC_INIT(src/mousetrap.cpp)
VERSION=0.9
PACKAGE=mousetrap
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE,"$VERSION")
CFLAGS="$CFLAGS"

dnl Determine default prefix
if test "x$prefix" = "xNONE"; then
  prefix="/usr/local"
fi

AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET

dnl ---- Checks for header files.

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h)


AC_ARG_WITH(sdl,     [  --with-sdl              build SDL interface], [], [with_sdl=yes])


if test "$with_sdl" != "no" ; then
AC_CHECK_PROG(SDL_CONFIG, sdl-config,yes)
if test x$SDL_CONFIG = "x"; then
  AC_MSG_ERROR([SDL_CONFIG not found!!! Install sdl libs])
fi

if test "$SDL_CONFIG" ; then
SDL_LIBS="`sdl-config --libs`"
SDL_CFLAGS="`sdl-config --cflags`"
INCS="$INCS $SDL_CFLAGS"
AC_CHECK_LIB(SDL, SDL_Init, [
AC_CHECK_HEADERS(SDL/SDL.h, ,[
AC_MSG_ERROR(SDL found but headers are missing!!)
with_sdl=no
])], [with_sdl=no], $SDL_LIBS)

AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, ,[
AC_MSG_ERROR([SDL_mixer libs and headers are missing!! Install sdl-mixer libs]) 
], $SDL_LIBS)
SDL_LIBS="$SDL_LIBS -lSDL_mixer"


AC_CHECK_LIB(SDL_gfx, pixelColor, ,[
AC_MSG_ERROR([SDL_gfx libs and headers are missing!! Install SDL-gfx libs]) 
], $SDL_LIBS)
SDL_LIBS="$SDL_LIBS -lSDL_gfx"

else
with_sdl=no
fi
fi

AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)

CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

dnl Determine if maintainer portions of the Makefiles should be included.
dnl AM_MAINTAINER_MODE

dnl datadir
DEFAULT_LIBDIR="$datadir"
AC_SUBST(DEFAULT_LIBDIR)


dnl Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$DEFAULT_PREFIX' for installation.])
AC_MSG_RESULT([Using '$DEFAULT_LIBDIR' for installation libraries.])
AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
AC_MSG_RESULT([Building with '$SDL_CFLAGS' for C++ compiler flags.])
AC_MSG_RESULT([Building with '$SDL_LIBS' for linker flags.])
AC_MSG_RESULT([])

AC_OUTPUT(Makefile
src/Makefile
)