summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 5268dabc590c8288bd3a2bf62c4221b15fa685d6 (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
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
91
92
93
94
95
96
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(skin, 2012Q4.1, idr@freedesktop.org, skinning)
AC_CONFIG_SRCDIR([Makefile.am])
AM_CONFIG_HEADER([config.h])

AM_INIT_AUTOMAKE

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
PKG_PROG_PKG_CONFIG

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_HEADER_STDC


# SDL is required for this application.  Find its header files and
# libraries.  Make sure they exist.

CPPFLAGS="$CPPFLAGS `sdl-config --cflags`"
LIBS="$LIBS `sdl-config --libs`"

AC_CHECK_HEADER(SDL.h, [], [exit 1])

CPPFLAGS="$CPPFLAGS `pkg-config --cflags alsa`"
LIBS="$LIBS `pkg-config --libs alsa`"

# OpenGL is required for this application.  Find its header files and
# libraries.  Make sure they exist.

AC_CHECK_HEADER(GL/gl.h, [], [exit 1])
AC_CHECK_LIB([GL], [glVertexPointer], [], [exit 1])


# GLEW is required for this application.  Find its header files and
# libraries.  Make sure they exist.

AC_CHECK_HEADER(GL/glew.h, [], [exit 1])
AC_CHECK_LIB([GLEW], [glewInit], [], [exit 1], [-lGL])

AC_LANG_CPLUSPLUS

PKG_CHECK_MODULES([GLU3], [glu3])
AC_SUBST(GLU3_CFLAGS)
AC_SUBST(GLU3_LIBS)

AC_ARG_ENABLE([debug],
    [AS_HELP_STRING([--enable-debug],
        [use debug compiler flags and macros @<:@default=disabled@:>@])],
    [enable_debug="$enableval"],
    [enable_debug=no]
)
if test "x$enable_debug" = xyes; then
    DEFINES="$DEFINES -DDEBUG"
    if test "x$GCC" = xyes; then
	# Remove any -g flags from the command line
	CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g'`]
        CFLAGS="$CFLAGS -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
    fi
    if test "x$GXX" = xyes; then
	# Remove any -g flags from the command line
	CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g'`]
        CXXFLAGS="$CXXFLAGS -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
    fi
fi


if test "x$GCC" = xyes ; then
	WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
else
	WARN=""
fi

if test "x$GXX" = xyes ; then
	WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
else
	WARN=""
fi

CFLAGS="$CFLAGS $WARN"
CXXFLAGS="$CXXFLAGS $WARN"

AC_OUTPUT([Makefile
	src/Makefile])