-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfigure.ac
155 lines (124 loc) · 4.79 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
## -*-m4-*-
dnl Process this file with autoreconf -vi to produce a configure script.
# FILE:
# configure.ac
#
# FUNCTION:
# implements checks for a variety of system-specific functions
#
# Contents:
# Headers - Autoconf header stuff
# Variables - Hardcoded variables
# Programs - Check for programs binaries
# Functions - Check for functions
# With - Check for --with/without options
# Enable - Check for --enable/disable options
# Libraries - Check for libraries
# Footer - Autoconf footer stuff
### --------------------------------------------------------------------------
### Headers
### check for various programs, and stuff (do this first because later
### commands depend on them):
AC_INIT([glextrusion], 3.1.2, [], [gle], [https://github.com/linas/glextrusion])
LIBVERINFO="4:2:1"
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY],1)])
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
AC_ISC_POSIX
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_CHECK_FUNCS(memcpy)
### --------------------------------------------------------------------------
### Variables
### Set up all the initial variable values...
# We should always see these errors...
CFLAGS="${CFLAGS} -Wall"
# Strict, or lenient tesselator?
AC_ARG_ENABLE(lenient-tess,
[ --enable-lenient-tess compile for lenient tesselator],
AC_DEFINE(LENIENT_TESSELATOR,1),
AC_DEFINE(DELICATE_TESSELATOR,1) )
# Disable texture mapping?
AC_ARG_ENABLE(auto-texture,
[ --disable-auto-texture compile with texture mapping disabled],
AC_DEFINE(AUTO_TEXTURE,0),
AC_DEFINE(AUTO_TEXTURE,1) )
# Should we build for old IrisGL?
AC_ARG_ENABLE(irisgl,
[ --enable-irisgl compile for old IrisGL/GL-3.2],
AC_DEFINE(GL_32,1),
AC_DEFINE(OPENGL_10,1) )
AC_ARG_ENABLE( debug,
[ --enable-debug compile with debugging flags set],
CFLAGS="${CFLAGS} -g"
LDFLAGS="${LDFLAGS} -g"
AC_DEFINE(DEBUG_OUTPUT,1), )
AC_ARG_ENABLE( profile,
[ --enable-profile compile with profiling set],
CFLAGS="${CFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg")
AC_ARG_ENABLE( warnings,
[ --enable-warnings compile with lots of warnings
generated],
CFLAGS="${CFLAGS} -g -Wall -ansi -pedantic -Wwrite-strings -Wid-clash-31 -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wshadow -Woverloaded-virtual -Winline -felide-constructors -fnonnull-objects"
LDFLAGS="${LDFLAGS} -g -Wall"
)
### --------------------------------------------------------------------------
### Libraries
LIBS="$LIBS -lm"
# We're going to set up our own X configure variables. These are only
# used in side configure. At the end, we use them to set X_LIBS.
# This allows us to be careful about libarary ordering, in case that's
# important.
AC_PATH_XTRA
if test x"$no_x" = xyes; then
AC_ERROR([Can not find X11 development headers or libraries.])
fi
# AC_CHECK_HEADER(GL/gl.h)
# AC_CHECK_HEADER(GL/glut.h)
# configure seems to work best when tested subroutines take no arguments
AC_CHECK_LIB(GL, glGetError,
X_LIBS="-lGL $X_LIBS",
AC_MSG_ERROR([Cannot find required GL library]),
$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(GLU, gluNewQuadric,
X_LIBS="-lGLU $X_LIBS",
AC_MSG_ERROR([Cannot find required GLU library]),
$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS)
# ----------------------------------------------------------
# Newest versions of glut require Xmu, which doesn't show up
# by default in X_LIBS
AC_CHECK_LIB(Xmu, XmuLookupStandardColormap,
X_LIBS="-lXmu $X_LIBS",
AC_MSG_ERROR([Cannot find required Xmu library]),
$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(Xi, XListInputDevices,
X_LIBS="-lXi -lXext $X_LIBS",
AC_MSG_ERROR([Cannot find required Xi (X11 Input Extension) library]),
$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS)
# latest versions of glut also use Xi the XInput extension
AC_CHECK_LIB(glut, glutSwapBuffers,
X_LIBS="-lglut $X_LIBS",
AC_MSG_ERROR([Cannot find required glut library]),
$X_PRE_LIBS -lXmu $X_LIBS -lX11 $X_EXTRA_LIBS)
# This is how to use the variables set by AC_PATH_XTRA:
# cc @X_CFLAGS@ -c -o foo.o foo.c
# cc @X_LIBS@ (-lfoo...) @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@
# (Perhaps X_LIBS should have been called X_LDFLAGS.)
X_LIBS="$X_LIBS -lXt -lX11"
AC_SUBST(LIBVERINFO)
AC_OUTPUT(
Makefile
src/Makefile
doc/Makefile
doc/html/Makefile
examples/Makefile
man/Makefile
ms-visual-c/Makefile
ms-visual-c/gle/Makefile
swig/Makefile
)