-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfigure.ac
206 lines (182 loc) · 5.43 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
AC_INIT(wxmacmolplt, 7.7.3, [email protected])
AC_CONFIG_SRCDIR(src/main.cpp)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE([1.9 foreign])
dnl AC_CONFIG_HEADER
dnl AC_REVISION
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
GLU_LIBS=
HOST=
case "${host}" in
*msvc*)
HOST=MSW
GLU_LIBS="-lopengl32 -lglu32"
;;
*darwin*)
HOST=OSX
GLU_LIBS="-framework OpenGL"
;;
*)
HOST=LINUX
PKG_CHECK_MODULES([GLU], [glu], [], [GLU_LIBS="-lGL -lGLU"])
;;
esac
AM_CONDITIONAL(HOST_IS_MSW, [test "x$HOST" == xMSW])
AC_SUBST([GLU_LIBS])
#
# There isn't a reliable way to know we should use the Apple OpenGL framework
# without a configure option. A Mac OS X user may have installed an
# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
#
# AC_ARG_WITH([apple-opengl-framework],
# [AC_HELP_STRING([--with-apple-opengl-framework],
# [use Apple OpenGL framework (Mac OS X only; default=no)])],
# [],
# [with_apple_opengl_framework=no])
# LIBGL=
# AS_IF([test "x$with_apple_opengl_framework" != xno],
# [AC_SUBST([LIBGL], ["-framework OpenGL"])])
AC_ARG_WITH([quicktime],
[AC_HELP_STRING([--with-quicktime],
[use Quicktime (Mac OS X only; default=no)])],
[],
[with_quicktime=no])
AS_IF([test "x$with_quicktime" != xno],
[CPPFLAGS="$CPPFLAGS -D__MAC_USE_QUICKTIME__ -FQuickTime"])
AC_ARG_WITH(ming,
[[ --with-ming Include support for exporting flash animations
using the ming library; (default=yes)]],
[],
[with_ming=yes])
MING_LIBS=
AS_IF([test "x$with_ming" != xno],
[AC_CHECK_LIB([ming], [Ming_init],
[PKG_CHECK_MODULES([MING], [libming], [], [MING_LIBS="-lming"])
AC_DEFINE([HAVE_LIBMING])],
[if test "x$with_ming" != xyes ; then
AC_MSG_FAILURE([--with-ming was given, but test for ming failed])
fi], -lpng)])
AC_SUBST([MING_LIBS])
AC_ARG_WITH(glew,
[[ --with-glew Use the system provided glew library instead of
the built-in version; (default=yes if present)]],
[],
[with_glew=check])
GLEW_LIBS=
AS_IF([test "x$with_glew" != xno],
[AC_CHECK_LIB([GLEW], [glewInit],
[PKG_CHECK_MODULES([GLEW], [glew], [], [GLEW_LIBS="-lGLEW"])
AC_DEFINE([SYSTEM_GLEW])],
[if test "x$with_glew" = xyes; then
AC_MSG_FAILURE([--with-glew was given, but test for glew failed])
fi])])
AM_CONDITIONAL([SYSTEM_GLEW], [test "x$ac_cv_lib_GLEW_glewInit" = xyes])
AC_SUBST([GLEW_LIBS])
WXCONFIG=wx-config
AC_ARG_WITH(wx-config,
[[ --with-wx-config=FILE Use the given path to wx-config when determining
wxWidgets configuration; defaults to "wx-config"]],
[
if test "$withval" != "yes" -a "$withval" != ""; then
WXCONFIG=$withval
fi
])
dnl C-compiler checks
AC_PROG_CC
AC_PROG_CXX
dnl AX_CHECK_GL
dnl if test x"$no_gl" = xyes; then
dnl AC_MSG_ERROR([OpenGL is required.])
dnl fi
AC_MSG_CHECKING([wxWidgets version])
if wxversion=`$WXCONFIG --version`; then
AC_MSG_RESULT([$wxversion])
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
fi
WX_CXXFLAGS="`$WXCONFIG --cxxflags` -DINSTALL_PREFIX=\\\"$prefix\\\""
WX_LIBS="`$WXCONFIG --libs base,core,gl,adv,html`"
AC_SUBST([WX_CXXFLAGS])
AC_SUBST([WX_LIBS])
# The purpose here is to test for a working wx install
# before the GL test. This should give the user a better error
# when the install is broken rather than saying wx lacks GL support
AC_MSG_CHECKING([for wxWidgets libraries])
AC_LANG_SAVE()
AC_LANG_CPLUSPLUS()
TEMP_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS `$WXCONFIG --cxxflags`"
TEMP_LIBS=$LIBS
LIBS="$LIBS `$WXCONFIG --libs`"
AC_TRY_RUN([
#include <cstdlib>
#include "wx/wx.h"
using namespace std;
int main() {
wxWindow *win;
exit(0);
return 0;
}
],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([not found])
AC_MSG_ERROR([have you set LD_LIBRARY_PATH correctly?]))
CXXFLAGS=$TEMP_CXXFLAGS
LIBS=$TEMP_LIBS
AC_LANG_RESTORE()
AC_MSG_CHECKING([for OpenGL support in wxWidgets])
AC_LANG_SAVE()
AC_LANG_CPLUSPLUS()
TEMP_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS `$WXCONFIG --cxxflags`"
TEMP_LIBS=$LIBS
LIBS="$LIBS `$WXCONFIG --libs`"
AC_TRY_RUN([
#include <cstdlib>
#include "wx/wx.h"
#include "wx/glcanvas.h"
using namespace std;
int main() {
#if wxUSE_GLCANVAS
exit(0);
return 0;
#else
exit(-1);
return -1;
#endif
}
],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([not found])
AC_MSG_ERROR([wxMacMolPlt requires wxWidgets to be compiled with OpenGL support.]))
CXXFLAGS=$TEMP_CXXFLAGS
LIBS=$TEMP_LIBS
AC_LANG_RESTORE()
case "${host}" in
*msvc*)
datarootdir="${bindir}"
;;
esac
#Begin Mike Ekstrand's cleverness
if test -z "${datarootdir}"; then
datarootdir="${datadir}"
AC_SUBST([datarootdir])
fi
if test -z "${docdir}"; then
# be compatible with old make's
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
htmldir='${docdir}'
AC_SUBST([docdir])
AC_SUBST([dvidir])
AC_SUBST([pdfdir])
AC_SUBST([psdir])
AC_SUBST([htmldir])
fi
#End cleverness
AC_SUBST(ac_aux_dir)
AC_OUTPUT(Makefile src/Makefile)