-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.in
379 lines (304 loc) · 8.44 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(nurbs++,3.0.12)
dnl
dnl the prefix stuff
dnl
has_prefix=no
if test "$prefix" != NONE; then
has_prefix=yes
else
prefix="/usr/local"
fi
PLIB_INSIDE_MINDSEYE
AM_PROG_LIBTOOL
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AM_CONFIG_HEADER(include/plib_config.h)
dnl the user can use --enable-shared to enable this
dnl AM_DISABLE_SHARED
AC_PROG_MAKE_SET
dnl
dnl Adding exception handling support
dnl
AC_ARG_ENABLE(exception,[ --enable-exception use exception handling instead of the Error class [default=yes]],
if test "$enable_exception" != no; then
AC_DEFINE(USE_EXCEPTION)
fi,AC_DEFINE(USE_EXCEPTION))
dnl
dnl Adding exception handling support
dnl
AC_ARG_ENABLE(verbose_exception,[ --enable-verbose-exception will print an error message when an exception is thrown [default=no]],
if test "$enable_verbose_exception" != no; then
AC_DEFINE(USE_EXCEPTION)
AC_DEFINE(VERBOSE_EXCEPTION)
fi)
dnl
dnl Adding debug information support
dnl
AC_ARG_ENABLE(debug,[ --enable-debug adds range checking and other debugging information
to the library [default=yes]],
if test "$enable_debug" != no; then
AC_DEFINE(DEBUG_PLIB)
fi,AC_DEFINE(DEBUG_PLIB))
dnl
dnl Create a library or not ?
dnl
include_source=no
AC_ARG_ENABLE(library,[ --enable-library it generates explicitely instantiate the templates.
This creates a library. If disabled, it will
include the source files with the header files
and the compiler will instantiate the templates
as it needs them [default=yes]],
if test "$enable_library" != no; then
include_source=no
else
include_source=yes
fi,include_source=no)
dnl
dnl Setting the flags for different compilers to the proper settings
dnl
dnl clean_list=""
if test "$CXX" = CC; then
case "$target_os" in
solaris*)
CXXFLAGS=$CXXFLAGS" -pta"
complex_lib="-lcomplex"
clean_list="-r Templates.DB"
;;
irix*)
CXXFLAGS=$CXXFLAGS" -pta -n32 -64"
complex_lib="-lcomplex"
clean_list="-r Templates.DB ii_files"
;;
esac
else
if test "$GXX" = yes; then
if test "$include_source" = yes; then
AC_DEFINE(INCLUDE_TEMPLATE_SOURCE)
CXXFLAGS=$CXXFLAGS" -frepo"
else
AC_DEFINE(NO_IMPLICIT_TEMPLATES)
CXXFLAGS=$CXXFLAGS" -fno-implicit-templates"
fi
case "$target_os" in
solaris*)
AC_DEFINE(USING_GNU_SOLARIS)
;;
linux*)
AC_DEFINE(USING_LINUX)
;;
alpha*)
AC_DEFINE(USING_GNU_DECALPHA)
;;
esac
fi
fi
dnl
dnl Optional library support
dnl
option_libs=
option_include=
dnl
dnl Addin CppUnit Support
dnl
WITH_CPPUNIT
dnl
dnl Adding Image Magick support
dnl
test_magick=yes
AC_ARG_WITH(magick,[ --with-magick[=/magickdir]
supports a limited set of the Image Magick library
functionnality with the IM_ImageT class [default=yes]],
if test "$with_magick" != no; then
test_magick=yes
else
test_magick=no
fi)
dnl has_image_magick=no
dnl if test "$test_magick" = yes; then
dnl WITH_IMAGE_MAGICK
dnl fi
dnl if test "$has_image_magick" = yes; then
dnl option_libs=' $(MAGICK_LDFLAGS) $(MAGICK_LIBS)'
dnl option_include=' $(MAGICK_CPPFLAGS)'
dnl AC_DEFINE(WITH_IMAGE_MAGICK)
dnl
dnl
dnl setting the order to be column order
dnl
user_defined_column_order=no
AC_ARG_ENABLE(column-order,[ --enable-column-order defines if the matrices are in row or column ordering [default=no]. This is always true if your are also compiling for OpenGL],
if test "$enable_column-order" != no; then
AC_DEFINE(COLUMN_ORDER)
user_defined_column_order=yes
fi)
dnl
dnl Adding OpenGL support
dnl
dnl AC_PATH_GL
if test "$use_opengl" = yes; then
AC_DEFINE(WITH_OPENGL)
AC_DEFINE(COLUMN_ORDER)
option_libs=$option_libs' $(GL_LIBS)'
option_include=$option_include' $(GL_CFLAGS)'
fi
AC_ARG_WITH(sunopengl,[ --with-sunopengl Sun's version of OpenGL has some particularities...],
if test "$with_sunopengl" != no; then
CXXFLAGS=$CXXFLAGS" -DSUNOPENGL"
fi)
dnl
dnl adjusting the option information
dnl
if test "$option_libs" != ''; then
echo 'option is defined'
option_libs='$(XLIBS)'$option_libs
option_include=$option_include' $(XINCLUDE)'
fi
dnl
dnl checking for the ways of your C++ compiler...
dnl
dnl first it must have namespaces...
CXX_MUST_HAVE_NAMESPACE
CXX_HAVE_TEMPLATE_OF_TEMPLATE
CXX_HAVE_ISO_FRIEND_DECL
CXX_HAVE_COMPLEX_FCNS
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
complex_header="complex.h"
use_iso_complex=no
AC_MSG_CHECKING(if the compiler can see complex instead of complex.h)
AC_TRY_COMPILE([#include <complex>],[return 1; ],
[use_iso_complex=yes ; ])
if test "$use_iso_complex" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
dnl echo "\nI am sorry. This library requires an ISO C++ compiler. The reason is"
dnl echo "the difference between the new standards and old implementations"
dnl echo "are big enough to become a maintenance problem. Even more so, when"
dnl echo "you take into account that an ISO C++ compiler should be available"
dnl echo "very soon now (tm) by your vendor. Or you can use a GNU alternative"
dnl echo "such as EGCS or GCC."
dnl exit 1
echo
echo "The ISO C++ standard requires the presence of <complex>."
echo "Your system doesn't seem to have it, you might not be able to"
echo "use NURBS++. Cross your fingers."
fi
AC_LANG_RESTORE
dnl The matrix libs and includes
packagedir=`pwd`
matrix_include='-I$(top_srcdir)/matrix -I$(top_srcdir)/image -I$(top_srcdir)/numerical'
matrix_lib_flag='-L$(top_srcdir)/matrix -L$(top_srcdir)/image -L$(top_srcdir)/numerical'
dnl matrix_lib='$(packagedir)/numerical/libmatrixN.la $(packagedir)/image/libmatrixI.la $(packagedir)/matrix/libmatrix.la '
matrix_lib='-lmatrixN -lmatrixI -lmatrix'
dnl the NURBS libs and includes
dnl
dnl creating a double floating point library
dnl
AC_ARG_ENABLE(float,[ --enable-float creates a single floating point library [default=yes]],
if test "$enable_float" != no; then
build_float=yes
else
build_float=no
fi,build_float=yes)
AC_ARG_ENABLE(double,[ --enable-double creates a double floating point library [default=yes]],
if test "$enable_double" != no; then
build_double=yes
else
build_double=no
fi,build_double=yes)
dnl
dnl setting the libraries to build
dnl
if test "$inside_mindseye" = yes; then
build_float=yes
build_double=no
fi
AM_CONDITIONAL(BUILD_CPPUNIT_TESTS,test "$build_test" = no)
AC_MSG_CHECKING(if building a float NURBS library)
if test "$build_float" = yes; then
build_lib="libnurbsf.la"
AM_CONDITIONAL(BUILD_FLOAT_DOUBLE,test $build_double = yes)
AM_CONDITIONAL(BUILD_FLOAT,test "$build_double" = no)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(if building a double NURBS library)
if test "$build_double" = yes; then
build_lib=$build_lib" libnurbsd.la"
AM_CONDITIONAL(BUILD_DOUBLE,test "$build_float" = no)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
nurbs_include='-I$(top_srcdir)/nurbs'
nurbs_libf='$(packagedir)/nurbs/libnurbsf.la'
nurbs_libd='$(packagedir)/nurbs/libnurbsd.la'
nurbs_lib="$nurbs_libf $nurbs_libd"
dnl
dnl Making the changes in the proper files
dnl
AC_DEFINE(PACKAGE)
AC_DEFINE(VERSION)
AC_SUBST(VERSION)
AC_SUBST(packagedir)
AC_SUBST(nurbs_libf)
AC_SUBST(nurbs_libd)
AC_SUBST(libld)
AC_SUBST(libld_options)
AC_SUBST(libcxx_flags)
AC_SUBST(MAGICK_CPPFLAGS)
AC_SUBST(MAGICK_LDFLAGS)
AC_SUBST(MAGICK_LIBS)
AC_SUBST(complex_lib)
AC_SUBST(matrix_lib)
AC_SUBST(matrix_lib_flag)
AC_SUBST(ar)
AC_SUBST(clean_list)
AC_SUBST(complex_header)
AC_SUBST(matrix_include)
AC_SUBST(nurbs_libs)
AC_SUBST(nurbs_include)
AC_SUBST(nurbs_lib)
AC_SUBST(nurbs_demo_lib)
AC_SUBST(libs_inc)
AC_SUBST(option_libs)
AC_SUBST(option_include)
AC_SUBST(CPPUNIT_CPPFLAGS)
AC_SUBST(CPPUNIT_LIBS)
PL_PROG_PERL
AC_OUTPUT(Makefile
Doxyfile
nurbs++-config
include/Makefile
config/Makefile
matrix/Makefile
numerical/Makefile
image/Makefile
nurbs/Makefile
examples/Makefile
examples/matrix/Makefile
examples/image/Makefile
examples/numerical/Makefile
examples/nurbs/Makefile
tests/Makefile
tests/matrix/Makefile
tests/nurbs/Makefile
nurbs++-3.0.12.pc
)
echo
echo 'The package has now been configured. Type '
echo ' make '
echo ' make install'
echo
echo 'To generate and install the NURBS++ package.'
echo
echo 'The library will be installed in ' $libdir
echo 'The header files will be installed in '$includedir'/nurbs++'
echo
echo