-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
473 lines (382 loc) · 14.5 KB
/
configure.in
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# **************************************************************************
# SoGtk/configure.in
# $Id$
AC_INIT(src/Inventor/Gtk/SoGtk.cpp)
AC_CONFIG_AUX_DIR(cfg)
# **************************************************************************
# Make sure the given source repository is in sync with the master source
# repository.
SIM_AC_CVS_CHANGES([
# the addition of the "data" module
SIM_AC_CVS_CHANGE([
cvs co SoGtkData
], [test -d data/CVS])
])
# **************************************************************************
AC_CANONICAL_SYSTEM
SIM_AC_SETUP_MSVCPP_IFELSE
AM_CONDITIONAL(BUILD_WITH_MSVC, $BUILD_WITH_MSVC)
# **************************************************************************
# Library versioning
SOGTK_MAJOR_VERSION=0
SOGTK_MINOR_VERSION=9
SOGTK_MICRO_VERSION=99
SOGTK_VERSION=$SOGTK_MAJOR_VERSION.$SOGTK_MINOR_VERSION.$SOGTK_MICRO_VERSION
VERSION=$SOGTK_VERSION
AC_SUBST(SOGTK_MAJOR_VERSION)
AC_SUBST(SOGTK_MINOR_VERSION)
AC_SUBST(SOGTK_MICRO_VERSION)
AC_SUBST(SOGTK_VERSION)
# libtool versioning
LT_CURRENT=$SOGTK_MAJOR_VERSION
LT_AGE=0
LT_REVISION=`expr $SOGTK_MINOR_VERSION \* 100 + $SOGTK_MICRO_VERSION`
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# The following are set up in Inventor/Gtk/SoGtkBasic.h
AC_DEFINE_UNQUOTED([SOGTK_MAJOR_VERSION], [$SOGTK_MAJOR_VERSION],
[The major version number for SoGtk])
AC_DEFINE_UNQUOTED([SOGTK_MINOR_VERSION], [$SOGTK_MINOR_VERSION],
[The minor version number for SoGtk])
AC_DEFINE_UNQUOTED([SOGTK_MICRO_VERSION], [$SOGTK_MICRO_VERSION],
[The micro version number for SoGtk])
AC_DEFINE_UNQUOTED([SOGTK_VERSION], ["$SOGTK_VERSION"],
[The version string for SoGtk])
# **************************************************************************
# Locate compilers and set C++ as the default compiler to run in tests.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_CPLUSPLUS
# moved below AC_PROG_CC so -g is preserved in $C[XX]FLAGS - 20020521 mortene
if $BUILD_WITH_MSVC; then
SIM_AC_SETUP_MSVCRT([
CPPFLAGS="$CPPFLAGS $sim_ac_msvcrt_CPPFLAGS"
CFLAGS="$CFLAGS $sim_ac_msvcrt_CFLAGS"
CXXFLAGS="$CXXFLAGS $sim_ac_msvcrt_CXXFLAGS"
LDFLAGS="$LDFLAGS $sim_ac_msvcrt_LDFLAGS"
LIBS="$LIBS $sim_ac_msvcrt_LIBS"
# sim_ac_msvcrt_LIBLIBS is set up at the end
# sim_ac_msvcrt_LIBLDFLAGS is set up at the end
LDFLAGS="$LDFLAGS $sim_ac_msvcrt_LIBLDFLAGS"
LIBS="$LIBS $sim_ac_msvcrt_LIBLIBS"
AC_SUBST([SOGUI_MSVC_LIBC], [$sim_ac_msvcrt])
])
fi
# **************************************************************************
# Miscellaneous options and initializations.
AM_INIT_AUTOMAKE(SoGtk, $VERSION)
# File to cram results from the configure tests into.
AM_CONFIG_HEADER(src/config.h)
# Default to not building a static library.
# Can be overridden by the user with --enable-static.
AM_DISABLE_STATIC
# Turn off default maintainer make-rules -- use ./autogen.sh instead.
AM_MAINTAINER_MODE
# ranlib is a cygwin gcc tool, and we don't support cygwin gcc
if $BUILD_WITH_MSVC; then
RANLIB=true
export RANLIB
fi
# IRIX has 'ar' problems with libtool 1.3.5
case "$host_os" in
irix*)
if test x"${AR+set}" != x"set"; then
AR="CC -ar"
AR_FLAGS=
export AR AR_FLAGS
echo "overriding the libtool '\$AR' setting with 'CC -ar'"
fi
;;
*) ;;
esac
# Initialize libtool
AC_PROG_LIBTOOL
AC_LANG(C)
AC_LANG(C++)
# These are used for constructing the sogtk-config file.
AC_SUBST([SOGUI_EXTRA_CPPFLAGS], [])
AC_SUBST([SOGUI_EXTRA_CFLAGS], [])
AC_SUBST([SOGUI_EXTRA_CXXFLAGS], [])
AC_SUBST([SOGUI_EXTRA_LDFLAGS], [])
AC_SUBST([SOGUI_EXTRA_LIBS], [])
SIM_EXPAND_DIR_VARS
AC_CHECK_HEADERS([windows.h dirent.h unistd.h])
# *******************************************************************
# Instead of getenv() on most Win32 platforms (not Windows CE).
AC_MSG_CHECKING([for GetEnvironmentVariable() function])
AC_TRY_LINK([#include <windows.h>],
[(void)GetEnvironmentVariable("FOOBAR", NULL, 0);],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_GETENVIRONMENTVARIABLE],1, [Define to use GetEnvironmentVariable() instead of getenv()])],
[AC_MSG_RESULT([no])])
# **************************************************************************
# If you just want to generate docs, ignore all the build-related tests
sim_ac_build_library=true
AC_ARG_ENABLE(
[build],
AC_HELP_STRING([--disable-build], [disable configuring for library build]), [
case $enableval in
no) sim_ac_build_library=false ;;
*) ;;
esac])
AM_CONDITIONAL([BUILD_LIBRARY], [$sim_ac_build_library])
AC_ARG_WITH(
[alternate],
[AC_HELP_STRING([--with-alternate=string],
[specify name of alternate configuration])],
[CONFIG=$withval],
[CONFIG=default])
AC_SUBST(CONFIG)
AC_ARG_WITH(
[suffix],
[AC_HELP_STRING([--with-suffix=string],
[specify library name suffix (e.g. "_g")])],
[SUFFIX=$withval],
[SUFFIX=])
AC_SUBST(SUFFIX)
# **************************************************************************
SIM_AC_SOGUI_SETUP_DOXYGEN(SoGtk)
AM_CONDITIONAL([BUILD_METAFILES], [false])
AC_SUBST([meta_prefix], [bogus])
# **************************************************************************
if $sim_ac_build_library; then
# **************************************************************************
if test -n "$with_inventor" -a x"$with_inventor" != x"no"; then
SIM_AC_CHECK_DL([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_dl_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_dl_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_dl_libs $SOGUI_EXTRA_LIBS"
])
SIM_AC_CHECK_X11([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_x11_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_x11_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_x11_libs $SOGUI_EXTRA_LIBS"
SIM_AC_CHECK_X11SHMEM([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_x11shmem_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_x11shmem_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_x11shmem_libs $SOGUI_EXTRA_LIBS"
], [
AC_MSG_WARN([couldn't use X11 shared memory extension - may cause problems with OpenGL linking later])
])
], [
AC_MSG_WARN([couldn't use X11 library - may cause problems with OpenGL linking later])
])
SIM_AC_CHECK_OPENGL([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_ogl_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_ogl_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_ogl_libs $SOGUI_EXTRA_LIBS"
], [AC_MSG_ERROR([need OpenGL-compatible development system installation])])
SIM_AC_CHECK_GLU([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_glu_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_glu_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_glu_libs $SOGUI_EXTRA_LIBS"
], [
AC_MSG_ERROR([need OpenGL utility library])
])
SIM_AC_HAVE_INVENTOR_IFELSE([
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_inventor_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_inventor_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_inventor_libs $SOGUI_EXTRA_LIBS"
CPPFLAGS="$CPPFLAGS $sim_ac_inventor_cppflags"
LDFLAGS="$LDFLAGS $sim_ac_inventor_ldflags"
LIBS="$sim_ac_inventor_libs $LIBS"
], [
AC_MSG_ERROR([couldn't compile and link against Open Inventor])
])
SIM_AC_CONFIGURATION_SETTING([Open Inventor brand], [SGI/TGS Inventor])
else
SIM_AC_CHECK_HEADER_GL([CPPFLAGS="$CPPFLAGS $sim_ac_gl_cppflags"])
# SIM_AC_CHECK_HEADER_GLU()
SIM_AC_HAVE_COIN_IFELSE([
CPPFLAGS="$CPPFLAGS $sim_ac_coin_cppflags"
LDFLAGS="$CPPFLAGS $sim_ac_coin_ldflags"
LIBS="$sim_ac_coin_libs $LIBS"
SOGUI_EXTRA_CPPFLAGS="$SOGUI_EXTRA_CPPFLAGS $sim_ac_coin_cppflags"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $sim_ac_coin_ldflags"
SOGUI_EXTRA_LIBS="$sim_ac_coin_libs $SOGUI_EXTRA_LIBS"
], [
AC_MSG_ERROR([couldn't compile and link against Coin])
])
SIM_AC_CONFIGURATION_SETTING([Open Inventor brand], [Coin])
fi
# **************************************************************************
# Check for miscellaneous implementation-dependent Open Inventor features
SIM_AC_HAVE_INVENTOR_NODE(SoPolygonOffset)
SIM_AC_HAVE_INVENTOR_FEATURE(
[for SoKeyboardEvent::DELETE enum],
[#include <Inventor/events/SoKeyboardEvent.h>], [
/* This is either DELETE or KEY_DELETE */
SoKeyboardEvent::Key key = SoKeyboardEvent::DELETE;],
[HAVE_SOKEYBOARDEVENT_DELETE])
SIM_AC_HAVE_INVENTOR_FEATURE(
[for SoMouseButtonEvent::BUTTON5 enum],
[#include <Inventor/events/SoMouseButtonEvent.h>], [
/* mouse wheel support needs BUTTON4 and BUTTON5 */
SoMouseButtonEvent::Button button = SoMouseButtonEvent::BUTTON5;],
[HAVE_SOMOUSEBUTTONEVENT_BUTTON5])
SIM_AC_HAVE_INVENTOR_FEATURE(
[for SoCamera::setStereoMode() method],
[#include <Inventor/nodes/SoPerspectiveCamera.h>], [
/* SoCamera is abstract, so test with SoPerspectiveCamera */
SoPerspectiveCamera * c = new SoPerspectiveCamera;
c->setStereoMode(SoCamera::MONOSCOPIC);],
[HAVE_SOCAMERA_SETSTEREOMODE])
# **************************************************************************
SIM_AC_CHECK_JOYSTICK_LINUX([
if false; then
AC_DEFINE(HAVE_JOYSTICK_LINUX, ,
[Define to enable Linux Joystick driver support])
AC_DEFINE_UNQUOTED(SOXT_LINUX_JOYSTICK_DEVICE,
"$sim_ac_joystick_linux_device",
[Define this to device handle to fallback on])
fi
])
# for now, it's not a supported device enyways, but we need the conditional...
sim_ac_joystick=linux_avail=false
AM_CONDITIONAL(HAVE_JOYSTICK_LINUX, $sim_ac_joystick_linux_avail)
# Check for GTK+
# Ugly AM_PATH_GTK check macro from gtk.m4 doesn't work with C++ compilers.
sim_ac_gtk_store_ldflags=$LDFLAGS
LDFLAGS=
sim_ac_gtk_store_libs=$LIBS
LIBS=
AC_LANG_PUSH(C)
AM_PATH_GTK(1.2.6,
[SOGUI_EXTRA_CPPFLAGS="$GTK_CFLAGS $SOGUI_EXTRA_CPPFLAGS"
CPPFLAGS="$GTK_CFLAGS $CPPFLAGS"],
AC_MSG_ERROR(Test for Gtk+ failed.))
AC_LANG_POP
LDFLAGS=$sim_ac_gtk_store_ldflags
LIBS=$sim_ac_gtk_store_libs
# The AM_PATH_GTK check macro just lumps the LDFLAGS and LIBS together
# in GTK_LIBS.
for i in $GTK_LIBS; do
if test -n "`echo $i | egrep '^-L'`"; then
LDFLAGS="$LDFLAGS $i"
SOGUI_EXTRA_LDFLAGS="$SOGUI_EXTRA_LDFLAGS $i"
else
LIBS="$LIBS $i"
SOGUI_EXTRA_LIBS="$SOGUI_EXTRA_LIBS $i"
fi
done
# Check for GtkGLArea
LIBS="-lgtkgl $LIBS"
AC_CACHE_CHECK([whether the GtkGLArea widget is available],
sim_cv_lib_gtkgl,
[AC_TRY_LINK([#include <gtkgl/gtkglarea.h>],
[gtk_gl_area_new(0L);],
sim_cv_lib_gtkgl=yes,
sim_cv_lib_gtkgl=no)])
if test x"$sim_cv_lib_gtkgl" != xyes; then
AC_MSG_ERROR(Test for GtkGLArea extensions widget failed.)
else
SOGUI_EXTRA_LIBS="-lgtkgl $SOGUI_EXTRA_LIBS"
fi
# **************************************************************************
# Compiler control.
SIM_AC_COMPILE_DEBUG([
CPPFLAGS="$CPPFLAGS -DSOGTK_DEBUG=1"
# SIM_AC_CONFIGURATION_WARNING(
# [debug compilation causes slower and larger executabled])
], [
CPPFLAGS="$CPPFLAGS -DSOGTK_DEBUG=0"
])
CPPFLAGS="$CPPFLAGS -DSOGTK_INTERNAL"
SIM_AC_DEBUGSYMBOLS
SIM_AC_RTTI_SUPPORT
SIM_AC_EXCEPTION_HANDLING
SIM_AC_PROFILING_SUPPORT
SIM_AC_COMPILER_WARNINGS
# **************************************************************************
# Do we want to compile the example programs?
# * --with-test-code is a silent option
AM_CONDITIONAL(BUILD_TESTS, test "x${with_test_code+set}" = "xset")
SIM_AC_SOGUI_STATIC_DEFAULTS
if $sim_ac_static_defaults; then
SIM_AC_CONFIGURATION_SETTING([Static Materials], [Yes])
else
SIM_AC_CONFIGURATION_SETTING([Static Materials], [No])
fi
# **************************************************************************
# Gettext support
## Add the languages which your application supports here.
ALL_LINGUAS="de" # "no" tmp disabled. 20011209 mortene.
SIM_GNU_GETTEXT
## Set PACKAGE_LOCALE_DIR in config.h.
if test x"${prefix}" = x"NONE"; then
package_local_dir="${ac_default_prefix}/${DATADIRNAME}/locale";
else
package_locale_dir="${prefix}/${DATADIRNAME}/locale";
fi
AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR],
["${package_locale_dir}"],
[Location the locale data will get installed to.])
AM_CONDITIONAL([BUILD_INTL], test x"$GMSGFMT" = x"")
# **************************************************************************
# Submodules that must be configured.
# Material editor(s) not part of the public API yet, so there's
# no point yet in installing the material data.
#AC_CONFIG_SUBDIRS(data)
# **************************************************************************
# this will depend on platform in a while (Window will use sogtk$major)
SOGTK_LIBNAME=-lSoGtk
SIM_AC_UNIQIFY_LIST(SOGUI_EXTRA_CPPFLAGS, -I$includedir $SOGUI_EXTRA_CPPFLAGS)
SIM_AC_UNIQIFY_LIST(SOGUI_EXTRA_LDFLAGS, -L$libdir $SOGUI_EXTRA_LDFLAGS)
SIM_AC_UNIQIFY_LIST(SOGUI_EXTRA_LIBS, $SOGTK_LIBNAME $SOGUI_EXTRA_LIBS)
SIM_AC_UNIQIFY_LIST(CPPFLAGS, $CPPFLAGS)
SIM_AC_UNIQIFY_LIST(LDFLAGS, $LDFLAGS)
SIM_AC_UNIQIFY_LIST(LIBS, $LIBS)
# **************************************************************************
# END OF "if $sim_ac_build_library" TEST
fi
# **************************************************************************
COIN_COMPILER="$CXX"
if $BUILD_WITH_MSVC; then
# don't use wrapmsvc from source hierarchy when later using sogtk-config.
COIN_COMPILER="wrapmsvc"
fi
AC_SUBST(COIN_COMPILER)
# **************************************************************************
# Variable substitutions for using libSoGtk in the generic code.
AC_SUBST([GUI], [GTK])
AC_SUBST([Gui], [Gtk])
AC_SUBST([gui], [gtk])
AC_SUBST([EVENT], ["GdkEvent *"])
AC_SUBST([WIDGET], ["GtkWidget *"])
AC_SUBST([COMPONENTHEADER], [])
# **************************************************************************
# List all makefiles configure must automatically generate.
#
# Note that sogtk-$CONFIG.cfg needs to be generated from the configure
# script -- not just from the Makefile -- as the data/configure script
# depends on it. (data/configure is temporarily disabled, BTW, but anyway..)
AC_OUTPUT([
sogtk-$CONFIG.cfg:src/Inventor/Gtk/common/sogui.cfg.in
Makefile
src/Makefile
src/Inventor/Makefile
src/Inventor/Gtk/Makefile
src/Inventor/Gtk/devices/Makefile
src/Inventor/Gtk/viewers/Makefile
src/Inventor/Gtk/widgets/Makefile
man/Makefile
man/man1/Makefile
man/man3/Makefile
html/Makefile
po/Makefile.in
intl/Makefile
build/Makefile
build/sogtk.spec
test-code/Makefile
test-code/components/Makefile
test-code/widgets/Makefile
])
SIM_AC_CONFIGURATION_SETTING([Install Prefix], [$prefix])
SIM_AC_CONFIGURATION_SUMMARY
echo ""
echo "Now, run 'make install' to build and install So$Gui."
echo ""
# **************************************************************************