File: configure.in

package info (click to toggle)
race 0.7.0-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,704 kB
  • ctags: 1,424
  • sloc: cpp: 9,026; makefile: 211
file content (81 lines) | stat: -rw-r--r-- 2,484 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(src/race.cpp)

AC_PROG_CXX

dnl ------------------------------------------------
dnl BBN's macro for checking commandline parameters:
dnl ------------------------------------------------

dnl CHECK_ENABLED(feature,help,define,default)
define([CHECK_ENABLED],
[
  AC_ARG_ENABLE($1,[  $2],
  [
    if test "$enableval" != "no"; then
      $3="enabled"
      AC_DEFINE($3)
      AC_MSG_RESULT([enabled])
    else
      AC_MSG_RESULT([disabled])
    fi
  ],
  [
    if test "$4" = "enabled"; then
      $3="enabled"
      AC_DEFINE($3)
      AC_MSG_RESULT([enabled])
    else
      AC_MSG_RESULT([disabled])
    fi
  ])
])

RACE_VORBIS=enabled
RACE_SOUND=enabled

AC_CHECK_LIB(clanApp, main,,echo "Race requires ClanLib to run."; exit 1)
AC_CHECK_LIB(clanCore, main,,echo "Race requires ClanLib to run."; exit 1)
AC_CHECK_LIB(clanDisplay, main,,echo "Race requires ClanLib to run."; exit 1)
AC_CHECK_LIB(clanPNG, main,,echo "Race requires clanPNG to run. Is libPNG installed?"; exit 1)
AC_CHECK_LIB(clanJPEG, main,,echo "Race requires clanJPEG to run. Is libJPEG installed?"; exit 1)
AC_CHECK_LIB(clanGL, main,,echo "Race requires clanGL to run. Do you have OpenGL installed correctly?"; exit 1)
AC_CHECK_LIB(clanGUI, main,,echo "Race requires clanGUI to run."; exit 1)
AC_CHECK_LIB(clanVorbis, main,,echo "lib clanVorbis not found - music will be disabled"; RACE_VORBIS=disabled )
dnl AC_CHECK_LIB(clanSound, main,,echo "lib clanSound not found - music will be disabled"; RACE_SOUND=disabled )


AC_MSG_CHECKING(for sound support)
CHECK_ENABLED(sound,
  [--enable-sound      enable sounds (disable sound disables also music)],
  USE_SOUND, $RACE_SOUND)

if test "$USE_SOUND" = "enabled"; then
	libs="-lclanApp -lclanCore -lclanPNG -lclanJPEG -lclanDisplay -lclanSOUND -lclanGL -lclanGUI";
	cppflags="-DRACE_SOUND";
else
	libs="-lclanApp -lclanCore -lclanPNG -lclanJPEG -lclanDisplay -lclanGUI -lclanGL";
	cppflags="";
fi



AC_MSG_CHECKING(for music support)
CHECK_ENABLED(music,
  [--enable-music      enable music],
  USE_VORBIS, $RACE_VORBIS)

if test "$USE_VORBIS" = "enabled"; then
	libs="-lclanApp -lclanCore -lclanPNG -lclanJPEG -lclanVorbis -lclanDisplay -lclanSound -lclanGL -lclanGUI";
	cppflags="-DRACE_SOUND -DRACE_VORBIS";
else
	libs="-lclanApp -lclanCore -lclanPNG -lclanJPEG -lclanDisplay -lclanSound -lclanGL -lclanGUI";
fi


AC_SUBST(libs)
AC_SUBST(cppflags)

AC_OUTPUT(Makefile src/Makefile)