This URL has Read-Only access.

Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 2eb8ec17

History | View | Annotate | Download (6.9 kB)

1
#                                               -*- Autoconf -*-
2
# Process this file with autoconf to produce a configure script.
3

    
4
AC_PREREQ([2.61])
5
AC_INIT(SPINFramework, [0.3.2], [https://sourceforge.net/apps/trac/spinframework/])
6
AC_MSG_NOTICE([Configuring the SPIN Framework])
7
AM_INIT_AUTOMAKE([subdir-objects -Wno-portability])
8
#AC_CONFIG_SRCDIR([include/ModelNode.h])
9
AC_CONFIG_HEADERS([include/config.h])
10
AC_CONFIG_MACRO_DIR([m4])
11
AC_CANONICAL_HOST # fills $host variable
12

    
13
# Special cases
14
case "$host" in *-darwin* | *-macos10*)
15
  if test -d /opt/local ; then
16
    CPPFLAGS="$CPPFLAGS -I/opt/local/include"
17
    LDFLAGS="$LDFLAGS -L/opt/local/lib"
18
  elif test -d /sw ; then
19
    CPPFLAGS="$CPPFLAGS -I/sw/include"
20
    LDFLAGS="$LDFLAGS -L/sw/lib"
21
  fi
22
  ;;
23
esac
24

    
25
# OSX does not include /usr/local/lib/pkgconfig path, so we export it here
26
# (for everyone, just in case)
27
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
28
export PKG_CONFIG_PATH
29

    
30
CXXFLAGS+=" -Wfatal-errors"
31
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/local/lib64"
32

    
33
AC_CONFIG_FILES([
34
        Makefile 
35
        src/Makefile 
36
        src/tinyxml/Makefile 
37
        src/osgWrappers/introspection/Makefile 
38
        src/spin/Makefile])
39

    
40
# Checks for programs.
41
AC_PROG_CXX
42
AC_PROG_CC
43
AC_PROG_INSTALL
44
AC_PROG_LIBTOOL
45

    
46
# Checks for typedefs, structures, and compiler characteristics.
47
AC_HEADER_STDBOOL
48
AC_C_INLINE
49
AC_TYPE_SIZE_T
50
AC_CHECK_TYPES([ptrdiff_t])
51

    
52
# OpenGL:
53
AX_CHECK_GLUT
54

    
55
# Checks for libraries
56
AC_CHECK_LIB([m],[sqrt])
57
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.0)
58
PKG_CHECK_MODULES([LIBXML2], libxml-2.0 >= 2.0)
59
#AC_SUBST(LIBXML_LIBS)
60
#AC_SUBST(LIBXML_CFLAGS)
61

    
62
# Checks for header files.
63
AC_CHECK_HEADERS([arpa/inet.h stddef.h stdlib.h string.h sys/time.h])
64

    
65
# Checks for library functions.
66
AC_FUNC_ERROR_AT_LINE
67
AC_CHECK_FUNCS([gettimeofday memmove mkdir setenv sqrt strchr strpbrk uname])
68

    
69

    
70
# Check for Python:
71
#AX_PYTHON
72
AM_PATH_PYTHON
73

    
74
PYTHON_CPPFLAGS="`python-config --cflags`"
75
PYTHON_CPPFLAGS=${PYTHON_CPPFLAGS//"-Wstrict-prototypes"/}
76
PYTHON_LDFLAGS="`python-config --ldflags`"
77
AC_SUBST(PYTHON_CPPFLAGS)
78
AC_SUBST(PYTHON_LDFLAGS)
79

    
80
#AC_MSG_RESULT(["    PYTHON_LDFLAGS: $PYTHON_LDFLAGS"])
81
#AC_MSG_RESULT(["    PYTHON_CPPFLAGS: $PYTHON_CPPFLAGS"])
82

    
83

    
84
# manually set pythondir (where site-packages is located)
85
# and pyexecdir for OSX
86
case "$host" in *-darwin* | *-macos10*)
87
  pythondir=`python -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1,0)'`
88
  pyexecdir=`python -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1,0)'`
89
esac
90

    
91
# Using AX_PYTHON_DEVEL:
92
#AX_PYTHON_DEVEL
93

    
94
# Using AX_PYTHON_EMBED:
95
#AX_PYTHON_WITH
96
#AX_PYTHON_PATH
97
#AX_PYTHON_VERSION_ENSURE( [2.5] )
98
#AX_PYTHON_CSPEC
99
#AX_PYTHON_LSPEC
100

    
101
# Another python check: 
102
#AM_PATH_PYTHON
103
#AM_CHECK_PYTHON_HEADERS
104
#AM_CHECK_PYTHON_LIB
105
#if test -z "$PYTHON_INCLUDES" || test -z "$PYTHON_LIBS"; then
106
#AC_MSG_ERROR([Could not find Python])
107
#fi
108

    
109
# Check for boost:
110
AX_BOOST_BASE([1.35])
111

    
112

    
113
AX_BOOST_REGEX
114
if test "x${ax_cv_boost_regex}" = "xno" ; then
115
    AC_MSG_ERROR([missing package: libboost-regex-dev])
116
fi
117

    
118
AX_BOOST_FILESYSTEM
119
if test "x${ax_cv_boost_filesystem}" = "xno" ; then
120
        AC_MSG_ERROR([missing package: libboost-filesystem-dev])
121
fi
122

    
123
AX_BOOST_THREAD
124
if test "x${ax_cv_boost_thread}" = "xno" ; then
125
    AC_MSG_ERROR([missing package: libboost-thread-dev])
126
fi
127

    
128
#AC_CHECK_LIB(boost_python-mt, main, AC_MSG_NOTICE([boost_python? yep]), AC_MSG_NOTICE([boost_python? nada]), -l$PYTHON_LIB)
129

    
130
AX_BOOST_PYTHON
131
if test -z "$BOOST_PYTHON_LIB" ; then
132
    AC_MSG_ERROR([missing package. libboost-python-dev.])
133
fi
134

    
135
# Check for OpenSceneGraph:
136
#PKG_CHECK_MODULES(OpenSceneGraph, openscenegraph >= 2.8.0, , AC_MSG_ERROR([missing OpenSceneGraph]))
137
AC_CHECK_LIB(osg, osgGetVersion, , AC_MSG_ERROR([missing OpenSceneGraph]),)
138

    
139
# and osgIntrospection:
140
AC_CHECK_LIB(osgIntrospection, osgIntrospectionGetVersion, OSGINTROSPECTION_LIB="-losgIntrospection", AC_MSG_ERROR([missing OpenSceneGraph Introspection library]),)
141
AC_SUBST([OSGINTROSPECTION_LIB])
142

    
143
# another way to check for OSG libs?:
144
#AC_CHECK_LIB(osg,osgGetVersion)
145
#AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
146

    
147

    
148
# Mac OS X specific configure options
149
#AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify the prefix path to osg frameworks [default=standard framework paths]])
150
#AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>])
151
#AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>])
152

    
153

    
154
# check for liblo:
155
AC_CHECK_LIB(lo, lo_send_internal, LIBLO_LDFLAGS="-llo", AC_MSG_ERROR([missing liblo OSC library]),)
156
AC_SUBST([LIBLO_LDFLAGS])
157

    
158
# check for scenic shared video stuff:
159
AC_ARG_ENABLE([scenic],
160
	AS_HELP_STRING([--enable-scenic], [Enables SharedVideoTexture by linking with the shared_video library from Scenic]),
161
	[with_scenic=$enableval],
162
	[with_scenic=no])
163

    
164
AS_IF([test "x$with_scenic" = "xyes"],
165
	AC_CHECK_LIB([shared_video], [shared_video_is_present], SHARED_VIDEO_LIB="-lshared_video"; AC_DEFINE([WITH_SHARED_VIDEO],[],[A flag that compiles additional features for use with the shared_video library from Scenic]), AC_MSG_ERROR([missing Scenic shared_video library]),[-pthread])
166
	[with_scenic=no])
167

    
168

    
169
AC_ARG_ENABLE([fmod],
170
	AS_HELP_STRING([--enable-fmod], [Enables audio rendering via FMOD]),
171
	[with_fmod=$enableval],
172
	[with_fmod=no])
173

    
174
#AC_PUSH_LANG(C++)
175
#AS_IF([test "x$with_fmod" = "xyes"],
176
#	AC_CHECK_LIB([fmodex], [], FMOD_LDFLAGS="-lfmodex"; CPPFLAGS="$CPPFLAGS -I/Developer/FMOD\ Programmers\ API\ Mac/api/inc/"; AC_DEFINE([USE_FMOD],[],[A flag that enables audio rendering features using the FMOD engine]), AC_MSG_ERROR([missing FMOD libraries]),)
177
#	[with_fmod=no])
178
#AC_POP_LANG(C++)
179

    
180
AC_ARG_ENABLE([editor],
181
	AS_HELP_STRING([--enable-editor], [Enables compilation of the graphical editor]),
182
	[with_gui=$enableval],
183
	[with_gui=no])
184

    
185
# GNU help2man creates man pages from --help output; in many cases, this
186
# is sufficient, and obviates the need to maintain man pages separately.
187
# However, this means invoking executables, which we generally cannot do
188
# when cross-compiling, so we test to avoid that (the variable
189
# "cross_compiling" is set by AC_PROG_CC).
190
if test $cross_compiling = no; then
191
    AM_MISSING_PROG(HELP2MAN, help2man)
192
else
193
    HELP2MAN=:
194
fi
195

    
196
AM_CONDITIONAL(ENABLE_EDITOR, [test "x$with_gui" = xyes])
197

    
198

    
199
#AC_MSG_CHECKING([for Scenic shared_video support])
200
#AC_MSG_RESULT($with_scenic)
201

    
202
AC_MSG_NOTICE([============================================])
203
AC_MSG_NOTICE([PYTHON_LIB:          ${PYTHON_LIB}])
204
AC_MSG_NOTICE([PYTHON_INCLUDE_DIR:  ${PYTHON_INCLUDE_DIR}])
205
AC_MSG_NOTICE([PYTHON_CPPFLAGS:     ${PYTHON_CPPFLAGS}])
206
AC_MSG_NOTICE([PYTHON_LDFLAGS:      ${PYTHON_LDFLAGS}])
207
AC_MSG_NOTICE([BOOST_LDFLAGS:       ${BOOST_LDFLAGS}])
208
AC_MSG_NOTICE([BOOST_CPPFLAGS:      ${BOOST_CPPFLAGS}])
209
AC_MSG_NOTICE([BOOST_PYTHON_LIB:    ${BOOST_PYTHON_LIB}])
210
AC_MSG_NOTICE([pythondir:           ${pythondir}])
211
AC_MSG_NOTICE([pythonexecdir:       ${pyexecdir}])
212
AC_MSG_NOTICE([============================================])
213

    
214
#AC_OUTPUT(Makefile src/genwrapper/Makefile src/osgWrappers/Makefile src/spin/Makefile)
215
AC_OUTPUT