-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
123 lines (108 loc) · 3.8 KB
/
configure.ac
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
# -*- Autoconf -*-
# vim: ft=m4
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([skyways], [0.0.1], [mark.nevill@gmail.com])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/configuration.hpp])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
PKG_PROG_PKG_CONFIG
# Checks for libraries.
AC_CHECK_LIB([GL], [glGetString])
AC_CHECK_LIB([GLEW], [glewInit])
PKG_CHECK_MODULES([FTGL],[ftgl >= 2.1])
AX_BOOST_BASE([1.34.0])
AX_BOOST_FILESYSTEM
AX_BOOST_PROGRAM_OPTIONS
modules=""
AC_ARG_ENABLE([qt], AS_HELP_STRING([--enable-qt], [Enable Qt backend (default: test)]),
[ if test "x$enableval" = "xyes" ; then qt_backend=yes
elif test "x$enableval" = "xtest" ; then qt_backend=test
elif test "x$enableval" = "xno" ; then qt_backend=no
else echo "Error: unknown --enable-qt option $enableval" ; exit 1
fi
],
[ qt_backend=test
])
if test "x$qt_backend" == "xyes" ; then
PKG_CHECK_MODULES([QT],[QtCore >= 4.5.0 QtGui >= 4.5.0 QtOpenGL >= 4.5.0])
AC_CHECK_LIB([pthread],[pthread_create],[QT_LIBS="-lpthread $QT_LIBS"])
AC_CHECK_LIB([GLU], [gluGetString],[QT_LIBS="-lGLU $QT_LIBS"])
elif test "x$qt_backend" == "xtest" ; then
PKG_CHECK_MODULES([QT],[QtCore >= 4.5.0 QtGui >= 4.5.0 QtOpenGL >= 4.5.0],[qt_backend="yes"],[qt_backend="no"])
if test "x$qt_backend" = "xyes" ; then
AC_CHECK_LIB([pthread],[pthread_create],[QT_LIBS="-lpthread $QT_LIBS"; qt_backend="yes"],[qt_backend="no"])
fi
if test "x$qt_backend" = "xyes" ; then
AC_CHECK_LIB([GLU], [gluGetString],[QT_LIBS="-lGLU $QT_LIBS"; qt_backend="yes"],[qt_backend="no"])
fi
fi
if test "x$qt_backend" = "xyes" ; then
modules="SkywaysQt $modules"
qt_backend_stmt=""
else
qt_backend_stmt="#"
fi
AC_SUBST(qt_backend)
AC_SUBST(qt_backend_stmt)
AC_ARG_ENABLE([sdl], AS_HELP_STRING([--enable-sdl], [Enable SDL backend (default: test)]),
[ if test "x$enableval" = "xyes" ; then sdl_backend=yes
elif test "x$enableval" = "xtest" ; then sdl_backend=test
elif test "x$enableval" = "xno" ; then sdl_backend=no
else echo "Error: unknown --enable-sdl option $enableval" ; exit 1
fi
],
[ sdl_backend=test
])
if test "x$sdl_backend" == "xyes" ; then
PKG_CHECK_MODULES([SDL],[sdl >= 1.2.13])
elif test "x$sdl_backend" == "xtest" ; then
PKG_CHECK_MODULES([SDL],[sdl >= 1.2.13],[sdl_backend="yes"],[sdl_backend="no"])
fi
if test "x$sdl_backend" = "xyes" ; then
modules="SkywaysSdl $modules"
sdl_backend_stmt=""
else
sdl_backend_stmt="#"
fi
AC_SUBST(sdl_backend)
AC_SUBST(sdl_backend_stmt)
AC_ARG_ENABLE([glut], AS_HELP_STRING([--enable-glut], [Enable GLUT backend (default: test)]),
[ if test "x$enableval" = "xyes" ; then glut_backend=yes
elif test "x$enableval" = "xtest" ; then glut_backend=test
elif test "x$enableval" = "xno" ; then glut_backend=no
else echo "Error: unknown --enable-glut option $enableval" ; exit 1
fi
],
[ glut_backend=test
])
if test "x$glut_backend" == "xyes" ; then
AC_CHECK_LIB([glut],[glutMainLoop],[GLUT_LIBS="-lglut"])
elif test "x$glut_backend" == "xtest" ; then
AC_CHECK_LIB([glut],[glutMainLoop],[GLUT_LIBS="-lglut"; glut_backend="yes"],[glut_backend="no"])
fi
if test "x$glut_backend" = "xyes" ; then
modules="SkywaysGlut $modules"
glut_backend_stmt=""
else
glut_backend_stmt="#"
fi
AC_SUBST(glut_backend)
AC_SUBST(GLUT_LIBS)
AC_SUBST(glut_backend_stmt)
if test -z "$modules" ; then
echo "Error: no backends will be built, aborting."
exit 1
fi
AC_SUBST(modules)
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "Configuration complete. Backends to be built:"
echo " Qt backend... $qt_backend"
echo " SDL backend... $sdl_backend"
echo " GLUT backend... $glut_backend"