File: configure.ac

package info (click to toggle)
brutalchess 0.5.2%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,372 kB
  • sloc: cpp: 7,567; sh: 2,707; makefile: 73; ansic: 9
file content (81 lines) | stat: -rw-r--r-- 1,984 bytes parent folder | download | duplicates (4)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.58)
AC_INIT(brutalchess, 0.5, brutalchess-devel@lists.sourceforge.net)
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([src/config.h])

# Check the host to determine OS
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP

# Checks for header files.
AC_HEADER_STDC

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE


case $host_os in
	mingw21* | cygwin* | windows* )
		# Include files aren't found with MDL_HAVE_OPENGL
		# Libs have different names
		LIBS="$LIBS -lOpenGl32 -lGlu32"
		;;
	darwin* )
		CFLAGS="$CFLAGS -I/System/Library/Frameworks/OpenGL.framework/Headers"
		CXXFLAGS="$CXXFLAGS -I/System/Library/Frameworks/OpenGL.framework/Headers"
		LIBS="$LIBS -framework OpenGL"
		# OSX wants gl.h not GL/gl.h
		AC_CHECK_HEADERS([gl.h glu.h glx.h])
		;;
	* )
		MDL_HAVE_OPENGL
		CFLAGS="$CFLAGS $GL_CFLAGS"
		CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
		LIBS="$LIBS $GL_LIBS"
		AC_CHECK_HEADERS([GL/glx.h])
		;;
esac

SDL_VERSION=1.2.7
AM_PATH_SDL($SDL_VERSION, :,
		AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

AC_CHECK_FT2
CFLAGS="$CFLAGS $FT2_CFLAGS"
CXXFLAGS="$CXXFLAGS $FT2_CFLAGS"
LIBS="$LIBS $FT2_LIBS"

dnl Checks for libraries. 
dnl Replace `main' with a function in -lSDL_image: 
AC_CHECK_LIB(SDL_image, 
		IMG_Load, 
		LIBS="$LIBS -lSDL_image", 
		AC_MSG_ERROR([*** SDL_image library not found!]) 
)
# Checks for library functions.
#AC_CHECK_FUNCS([sqrt])

# Directory where resources are installed
AC_SUBST(bcdatadir, "${datadir}/brutalchess/", "Prefix")
AC_SUBST(modelsdir, "${bcdatadir}/models/", "Models")
AC_SUBST(artdir, "${bcdatadir}/art/", "Art")

AC_CONFIG_FILES([Makefile 
			src/Makefile
			art/Makefile
			models/Makefile])
AC_OUTPUT