File: configure.in

package info (click to toggle)
openalpp-cvs 20060714-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,288 kB
  • ctags: 588
  • sloc: sh: 8,763; cpp: 4,310; makefile: 172; ansic: 56
file content (127 lines) | stat: -rw-r--r-- 2,937 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
# INITIATE AUTOCONF
AC_INIT([src/Makefile.am])

#BEGIN DEFAULT SETTINGS


# General

CXXFLAGS="-Wall -W"


#END DEFAULT SETTINGS



# BEGIN GENERAL AUTOCONF STUFF

AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(openalpp,0.2)

dnl C++ style
AC_LANG_CPLUSPLUS
#CXX=g++
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AM_PROG_LIBTOOL

dnl Check system type
#AC_CANONICAL_HOST

dnl create only shared libtool-libraries
AC_ENABLE_SHARED(yes)

dnl set the following to yes, if you want to create static
dnl libtool-libraries
AC_ENABLE_STATIC(no)

# ***** DEBUGGING
AC_ARG_ENABLE(debug,[  --enable-debug          enable debugging [default=no]])
if test "$enable_debug" = "yes"; then
    CXXFLAGS="-g $CXXFLAGS"
else
    CXXFLAGS="-O2 $CXXFLAGS"
fi

# ***** PROFILING
AC_ARG_ENABLE(profiling,[  --enable-profiling  enable profiling [default=no]])
if test "$enable_profiling" = "yes"; then
    CXXFLAGS="-pg $CXXFLAGS"
fi
CPPFLAGS="$CPPFLAGS -I/usr/local/include"

# ***** VRLAB_PREFIX
if test "$VRLAB_PREFIX"; then
    if test "$prefix" = "NONE"; then
        prefix="$VRLAB_PREFIX"
    fi
    CPPFLAGS="$CPPFLAGS -I$VRLAB_PREFIX/include"
    LDFLAGS="$LDFLAGS -L$VRLAB_PREFIX/lib"
fi


# END GENERAL AUTOCONF STUFF

dnl Checks for libraries.
# OpelAL
AC_CHECK_LIB(openal,main)
AC_CHECK_LIB(alut,main)

if test "$ac_cv_lib_alut_main" = "yes" ; then
   ALUT_LIB=-lalut
fi
AC_SUBST(ALUT_LIB)

#
# Was introduced sometime in 2005, does not show pre-2005
# #define ALC_STEREO_SOURCES                       0x1011
# There should really be a version number in the headers.
#
AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[#include <AL/alc.h>]],
                         [[int a = ALC_STEREO_SOURCES;]])],
        [OPENAL_VERSION=2005],
        [OPENAL_VERSION=2004])

  AC_TRY_COMPILE(
  [#include <AL/alut.h>],
  [alutLoadMemoryFromFile((const char*)0,(ALenum*)0,(ALsizei*)0,(ALfloat*)0);]
  , 
  [OPENAL_VERSION=2007])

if test $OPENAL_VERSION = 2005 ; then
  #
  # Was introduced sometime in 2006, does not show pre-2006
  # #define AL_VERSION_1_1
  #
  AC_TRY_COMPILE([#include <AL/al.h>], 
	       [AL_VERSION_1_1
               ],
               [OPENAL_VERSION=2005],
               [OPENAL_VERSION=2006])
fi

PKG_CHECK_MODULES(OPENTHREADS, openthreads >= 0.9.8, , [AC_MSG_ERROR(openthreads is a mandatory library)])

AC_DEFINE_UNQUOTED(OPENAL_VERSION, [$OPENAL_VERSION], [OpenAL CVS version (rough estimate)])

# PortAudio
AC_CHECK_LIB(portaudio,main,WITH_PORTAUDIO="yes")
AM_CONDITIONAL(WITH_PORTAUDIO, test "$WITH_PORTAUDIO" = "yes")

# Ogg Vorbis
AC_CHECK_LIB(ogg,main,WITH_OGGVORBIS="yes")
AM_CONDITIONAL(WITH_OGGVORBIS, [test "$WITH_OGGVORBIS" = "yes"])

dnl Checks for header files.
AC_HEADER_STDC

dnl Checks for typedefs, structures, and compiler characteristics.
#AC_C_CONST

dnl Checks for library functions.

AC_OUTPUT(Makefile include/Makefile include/openalpp/Makefile src/Makefile tests/Makefile openalpp.pc)