File: configure.ac

package info (click to toggle)
sludge 2.2.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,852 kB
  • sloc: cpp: 32,432; sh: 1,237; makefile: 634; xml: 284
file content (164 lines) | stat: -rwxr-xr-x 5,879 bytes parent folder | download
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.55])
AC_INIT([SLUDGE], [2.2.2], [tobias.han@gmx.de], [sludge], [http://opensludge.github.io/])
AC_CONFIG_SRCDIR([source/CommonCode/tga.cpp])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([config.h])

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG()

AC_ARG_ENABLE([engine], [AC_HELP_STRING([--disable-engine], [don't build the SLUDGE Engine])])
AC_ARG_ENABLE([devkit], [AC_HELP_STRING([--enable-devkit], [build the SLUDGE DevKit])])
AC_ARG_ENABLE([doc], [AC_HELP_STRING([--enable-doc], [install the SLUDGE documentation])])
AC_ARG_ENABLE([gles2], [AC_HELP_STRING([--enable-gles2], [build engine using OpenGL ES 2.0])])
AC_ARG_ENABLE([pandora], [AC_HELP_STRING([--enable-pandora], [enable hacks for OpenPandora])])
AC_ARG_ENABLE([rpi], [AC_HELP_STRING([--enable-rpi], [enable Raspberry-PI support])])
AC_ARG_ENABLE([odroid], [AC_HELP_STRING([--enable-odroid], [enable ODroid support])])

# Set default targets:
if test "x$enable_engine" = x; then
  enable_engine="yes"
fi
if test "x$enable_devkit" = x; then
  enable_devkit="no"
fi
if test "x$enable_doc" = x; then
  enable_doc="no"
fi
if test "x$enable_gles2" = x; then
  enable_gles2="no"
fi
if test "x$enable_pandora" = x; then
  enable_pandora="no"
fi
if test "x$enable_rpi" = x; then
  enable_rpi="no"
fi
if test "x$enable_odroid" = x; then
  enable_odroid="no"
fi
if test "x$enable_pandora" = xyes; then
  enable_gles2="yes"
fi
if test "x$enable_rpi" = xyes; then
  enable_gles2="yes"
fi
if test "x$enable_odroid" = xyes; then
  enable_gles2="yes"
fi

# Are we cross compiling for windows?
case "${host}" in
        i[[3456789]]86-mingw32*) WIN32="yes" ;;
        *cygwin*) WIN32="yes" ;;
        *) WIN32="no" ;;
esac
AM_CONDITIONAL([COND_WIN32], test x"$WIN32" = xyes)

# Always build the Dev Kit for windows:
if test x"$WIN32" = xyes; then
  enable_engine="no"
  enable_devkit="yes"
fi

# Checks for libraries.
if test "x$enable_gles2" = xno; then
  PKG_CHECK_MODULES([GLEW], [glew])
else
  if test "x$enable_devkit" = xyes; then
    PKG_CHECK_MODULES([GLEW], [glew])
  fi
fi

if test "x$enable_engine" = xyes; then
  PKG_CHECK_MODULES([ENGINE], [sdl alure >= 1.1 openal vorbis ogg vpx])
  AC_CHECK_LIB([dumb], [duh_render], [ENGINE_LIBS="$ENGINE_LIBS -ldumb"], [AC_MSG_ERROR([cannot find DUMB library])])
  if test "x$enable_gles2" = xyes; then
    AC_CHECK_LIB([GLESv2], [glEnable], [ENGINE_LIBS="$ENGINE_LIBS -lGLESv2"], [AC_MSG_ERROR([cannot find GLESv2 library])])
    AC_CHECK_LIB([EGL], [eglInitialize], [ENGINE_LIBS="$ENGINE_LIBS -lEGL"], [AC_MSG_ERROR([cannot find EGL library])])
    AC_CHECK_LIB([X11], [XOpenDisplay], [ENGINE_LIBS="$ENGINE_LIBS -lX11"], [AC_MSG_ERROR([cannot find X11 library])])
  else
    PKG_CHECK_MODULES([GL], [gl glu])
  fi
fi

if test "x$enable_devkit" = xyes; then
  PKG_CHECK_MODULES([GLIB], [glib-2.0])
fi

PKG_CHECK_MODULES([LIBPNG], [libpng])

# Checks for header files.
AC_CHECK_HEADERS([limits.h malloc.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h], [], [AC_MSG_ERROR([cannot find one or more of these header files: limits.h malloc.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])])
AC_CHECK_HEADERS([getopt.h], [], [AC_MSG_ERROR([cannot find getopt header files])])

if test "x$enable_engine" = xyes; then
  AC_CHECK_HEADERS([SDL/SDL.h SDL/SDL_syswm.h], [], [AC_MSG_ERROR([cannot find SDL header files])])
  AC_CHECK_HEADERS([AL/alure.h], [], [AC_MSG_ERROR([cannot find alure header files])])
  AC_CHECK_HEADERS([vpx/vpx_decoder.h], [], [AC_MSG_ERROR([cannot find vpx header files])])
  AC_CHECK_HEADERS([vorbis/codec.h], [], [AC_MSG_ERROR([cannot find vorbis header files])])
  AC_CHECK_HEADERS([ogg/ogg.h], [], [AC_MSG_ERROR([cannot find ogg header files])])
  AC_CHECK_HEADERS([dumb.h], [], [AC_MSG_ERROR([cannot find DUMB header files])])
  if test "x$enable_gles2" = xyes; then
    AC_CHECK_HEADERS([GLES2/gl2.h], [], [AC_MSG_ERROR([cannot find gles2 header files])])
    AC_CHECK_HEADERS([EGL/egl.h], [], [AC_MSG_ERROR([cannot find egl header files])])
    AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h], [], [AC_MSG_ERROR([cannot find x11 header files])])
  else
    AC_CHECK_HEADERS([GL/glu.h], [], [AC_MSG_ERROR([cannot find glu header files])])
  fi
fi

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_CHECK_TYPES([ptrdiff_t])

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([atexit getcwd memset mkdir rmdir sqrt strstr strtol])

AM_CONDITIONAL([COND_ENGINE], [test "x$enable_engine" = xyes])
AM_CONDITIONAL([COND_DEVKIT], [test "x$enable_devkit" = xyes])
AM_CONDITIONAL([COND_DOC], [test "x$enable_doc" = xyes])
AM_CONDITIONAL([COND_GLES2], [test "x$enable_gles2" = xyes])
AM_CONDITIONAL([COND_PANDORA], [test "x$enable_pandora" = xyes])
AM_CONDITIONAL([COND_RPI], [test "x$enable_rpi" = xyes])
AM_CONDITIONAL([COND_ODROID], [test "x$enable_odroid" = xyes])

AC_CONFIG_FILES([Makefile
                 source/Makefile
                 source/Engine/Makefile
                 GTK_Dev_Kit/Makefile
                 GTK_Dev_Kit/support/Makefile
                 doc/Makefile])
AC_OUTPUT

echo "
SLUDGE configuration complete.
Note that Alure needs VorbisFile and FLAC to provide full sound support for the SLUDGE engine.

Will build..."
if test x"$WIN32" = xyes; then
echo "...the SLUDGE DevKit for Windows"
else
echo ""
echo "SLUDGE Engine        ..."$enable_engine
echo "SLUDGE DevKit        ..."$enable_devkit
echo "SLUDGE documentation ..."$enable_doc
echo "
Use the options --disable-engine, --enable-devkit and/or --enable-doc to (de)select components.
"
fi