-
Notifications
You must be signed in to change notification settings - Fork 2
/
mni_REQUIRE_OPENINVENTOR.m4
105 lines (83 loc) · 2.5 KB
/
mni_REQUIRE_OPENINVENTOR.m4
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
# Macros for finding OpenInventor and related libraries.
# Qt and SoQt sometimes need functions from X11 libraries.
#
AC_DEFUN([mni_REQUIRE_X11],
[
AC_REQUIRE([AC_PATH_XTRA])
# Qt requires Xext and X11 (and libm)
#
# SoQt needs the above plus SM, ICE, Xi and Xmu
if test "$no_x" != yes; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
LIBS="$X_PRE_LIBS -lXmu -lXext -lSM -lICE -lXi -lX11 $X_EXTRA_LIBS $LIBS"
fi
])
AC_DEFUN([mni_REQUIRE_GL],
[
AC_REQUIRE([mni_REQUIRE_X11])
mni_REQUIRE_LIB(GL,[#include <GL/gl.h>],[glEnd();])
])
AC_DEFUN([mni_REQUIRE_GLU],
[
AC_REQUIRE([mni_REQUIRE_GL])
mni_REQUIRE_LIB(GLU,[#include <GL/glu.h>],[gluBeginCurve(0);])
])
AC_DEFUN([mni_REQUIRE_OPENINVENTOR],
[
AC_REQUIRE([mni_REQUIRE_X11])
AC_REQUIRE([mni_REQUIRE_GL])
AC_LANG_PUSH(C++)
mni_LIBS_save=$LIBS
LIBS="-lCoin $LIBS"
AC_MSG_CHECKING([for Open Inventor (Coin)])
AC_TRY_LINK([#include <Inventor/SoDB.h>],
[SoDB::init();],
[result=yes],
[result=no])
AC_MSG_RESULT($result)
if test "$result" = no; then
LIBS="-lInventor $mni_LIBS_save"
AC_MSG_CHECKING([for Open Inventor (SGI)])
AC_TRY_LINK([#include <Inventor/SoDB.h>],
[SoDB::init();],
[result=yes],
[result=no])
AC_MSG_RESULT($result)
fi
AC_LANG_POP
if test "$result" = no; then
AC_MSG_ERROR([No Open Inventor library detected.])
fi
])
AC_DEFUN([mni_REQUIRE_QTGL],
[
AC_REQUIRE([mni_REQUIRE_X11])
AC_REQUIRE([mni_REQUIRE_GLU])
AC_MSG_CHECKING([value of the QTDIR environment variable])
if test x"$QTDIR" = x""; then
AC_MSG_RESULT([empty])
AC_MSG_WARN([QTDIR environment variable not set -- this might be an indication of a problem])
else
AC_MSG_RESULT([$QTDIR])
LDFLAGS="-L$QTDIR/lib $LDFLAGS"
CPPFLAGS="-I$QTDIR/include $CPPFLAGS"
fi
AC_SUBST([QTDIR], [$QTDIR])
AC_LANG_PUSH(C++)
mni_REQUIRE_LIB(qt,[#include <qapplication.h>],[QString str;])
AC_LANG_POP
AC_PATH_PROGS(MOC, moc, echo, $PATH:$QTDIR/bin)
AC_PATH_PROGS(UIC, uic, echo, $PATH:$QTDIR/bin)
])
dnl This used to have -lXi in it. Perhaps should AC_REQUIRE the AC_PATH_XTRA
dnl macro and do something intelligent with it.
AC_DEFUN([mni_REQUIRE_SOQT],
[
AC_REQUIRE([mni_REQUIRE_X11])
AC_REQUIRE([mni_REQUIRE_OPENINVENTOR])
AC_REQUIRE([mni_REQUIRE_QTGL])
AC_LANG_PUSH(C++)
mni_REQUIRE_LIB(SoQt,[#include <Inventor/Qt/SoQt.h>],[SoQt::mainLoop();])
AC_LANG_POP
])