File: configure.ac

package info (click to toggle)
haskell-alut 2.2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 484 kB
  • ctags: 19
  • sloc: sh: 2,811; haskell: 535; makefile: 2
file content (144 lines) | stat: -rw-r--r-- 4,174 bytes parent folder | download | duplicates (3)
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
AC_INIT([Haskell ALUT package], [2.1.0.2], [sven.panne@aedion.de], [ALUT])

# Safety check: Ensure that we are in the correct source directory.
AC_CONFIG_SRCDIR([include/HsALUT.h.in])

# The first file mentioned below will be generated by autoheader and contains
# defines which are needed during package build time only. The second header
# contains all kinds of stuff which is needed for using this package.
AC_CONFIG_HEADERS([include/HsALUTConfig.h include/HsALUT.h])

# we do not really care about this here, but this avoids a warning about an
# unknown option
FP_ARG_COMPILER

# We set this to "yes" later when we have found ALUT libs and headers.
ALUT_BUILD_PACKAGE=no

# Shall we build this package at all?
FP_ARG_ALUT

if test x"$enable_alut" = xyes; then

# Check for ALUT include paths and libraries
FP_CHECK_ALUT

if test "$ALUT_LIBS" = no; then
  AC_MSG_FAILURE([no ALUT library found, so this package cannot be built])
fi

# check for ALUT include files
FP_HEADER_ALUT

if test "$fp_found_alut_header" = no; then
  AC_MSG_FAILURE([no ALUT header found, so this package cannot be built])
fi

ALUT_BUILD_PACKAGE=yes

# checks for library functions.

fp_save_libs="$LIBS"
LIBS="$ALUT_LIBS $AL_LIBS $LIBS"

FP_FUNC_ALUTINIT_VOID
FP_CHECK_FUNC_ALUT([alutInitWithoutContext], [((int *)0, (char **)0)])
FP_FUNC_ALUTEXIT_VOID

FP_CHECK_FUNC_ALUT([alutGetError], [()])
FP_CHECK_FUNC_ALUT([alutGetErrorString], [(0)])

FP_CHECK_FUNC_ALUT([alutCreateBufferFromFile], [((const char *)0)])
FP_CHECK_FUNC_ALUT([alutCreateBufferFromFileImage], [((const ALvoid *)0, 0)])
FP_CHECK_FUNC_ALUT([alutCreateBufferHelloWorld], [()])
FP_CHECK_FUNC_ALUT([alutCreateBufferWaveform], [(0, 0.0f, 0.0f, 0.0f)])

FP_CHECK_FUNC_ALUT([alutLoadMemoryFromFile], [((const char *)0, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)])
FP_CHECK_FUNC_ALUT([alutLoadMemoryFromFileImage], [((const ALvoid *)0, 0, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)])
FP_CHECK_FUNC_ALUT([alutLoadMemoryHelloWorld], [((ALenum *)0, (ALsizei *)0, (ALfloat *)0)])
FP_CHECK_FUNC_ALUT([alutLoadMemoryWaveform], [(0, 0.0f, 0.0f, 0.0f, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)])

FP_CHECK_FUNC_ALUT([alutGetMIMETypes], [(0)])

FP_CHECK_FUNC_ALUT([alutGetMajorVersion], [()])
FP_CHECK_FUNC_ALUT([alutGetMinorVersion], [()])

FP_CHECK_FUNC_ALUT([alutSleep], [(0.0f)])

LIBS="$fp_save_libs"

# checks for constant values

FP_CHECK_CONSTS([ALUT_API_MAJOR_VERSION ALUT_API_MINOR_VERSION ALUT_WAVEFORM_SINE ALUT_WAVEFORM_SQUARE ALUT_WAVEFORM_SAWTOOTH ALUT_WAVEFORM_WHITENOISE ALUT_WAVEFORM_IMPULSE ALUT_LOADER_BUFFER ALUT_LOADER_MEMORY], [#if HAVE_AL_ALUT_H
#include <AL/alut.h>
#elif HAVE_OPENAL_ALUT_H
#include <OpenAL/alut.h>
#endif

#ifndef ALUT_API_MAJOR_VERSION
#define ALUT_API_MAJOR_VERSION   0
#endif

#ifndef ALUT_API_MINOR_VERSION
#define ALUT_API_MINOR_VERSION   0
#endif

#ifndef ALUT_WAVEFORM_SINE
#define ALUT_WAVEFORM_SINE       0x100
#endif

#ifndef ALUT_WAVEFORM_SQUARE
#define ALUT_WAVEFORM_SQUARE     0x101
#endif

#ifndef ALUT_WAVEFORM_SAWTOOTH
#define ALUT_WAVEFORM_SAWTOOTH   0x102
#endif

#ifndef ALUT_WAVEFORM_WHITENOISE
#define ALUT_WAVEFORM_WHITENOISE 0x103
#endif

#ifndef ALUT_WAVEFORM_IMPULSE
#define ALUT_WAVEFORM_IMPULSE    0x104
#endif

#ifndef ALUT_LOADER_BUFFER
#define ALUT_LOADER_BUFFER       0x300
#endif

#ifndef ALUT_LOADER_MEMORY
#define ALUT_LOADER_MEMORY       0x301
#endif])

# tell our build system about the results

AC_DEFINE_UNQUOTED([ALUT_CFLAGS],
  [`echo '' $ALUT_CFLAGS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
  [C flags for ALUT, as a list of string literals.])

AC_DEFINE_UNQUOTED([ALUT_LIBS],
  [`echo '' $ALUT_LIBS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
  [Library flags for ALUT, as a list of string literals.])

AC_DEFINE_UNQUOTED([ALUT_FRAMEWORKS],
  [`echo '' $ALUT_FRAMEWORKS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
  [Framework flags for ALUT, as a list of string literals.])

fi

if test "$ALUT_BUILD_PACKAGE" = yes; then
  BUILD_PACKAGE_BOOL=True
else
  BUILD_PACKAGE_BOOL=False
fi
AC_SUBST([BUILD_PACKAGE_BOOL])

case "$host" in
*-mingw32) CALLCONV=stdcall ;;
*)	CALLCONV=ccall ;;
esac
AC_SUBST([CALLCONV])

AC_CONFIG_FILES([ALUT.buildinfo])
AC_OUTPUT