Debian Codegraph @

debian/external_deps/fetk/sg/configure.ac

raw
1 dnl ##########################################################################
2 dnl SG = < Socket Graphics >
3 dnl Copyright (C) 1994-- Michael Holst
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl
19 dnl rcsid="INTENTIONALLY LEFT BLANK"
20 dnl ##########################################################################
21
22 dnl ##########################################################################
23 dnl File: configure.ac
24 dnl
25 dnl Purpose: configure.ac script for SG (Socket Graphics).
26 dnl
27 dnl Author: Michael Holst
28 dnl ##########################################################################
29
30 dnl 0. autoconf initialization
31 AC_INIT(sg, 1.0, [email protected])
32 AC_CONFIG_SRCDIR(src/ogl/sg/ogl.h)
33 AM_CONFIG_HEADER(src/aaa_inc/sgcf.h)
34 AC_CONFIG_AUX_DIR(config)
35 AC_PREFIX_DEFAULT(${HOME})
36 AC_CANONICAL_BUILD
37 AC_CANONICAL_HOST
38 AC_CANONICAL_TARGET
39
40 dnl 1. automake initialization
41 AM_INIT_AUTOMAKE([foreign])
42 FETK_VERSION="1:0:0"
43 AC_SUBST(FETK_VERSION)
44 AM_MAINTAINER_MODE
45
46 dnl 2. checks for programs
47 AC_LANG_C
48 AC_PROG_CC
49 AC_PROG_CPP
50 AC_DISABLE_STATIC
51 AM_PROG_LIBTOOL
52
53 dnl 3. checks for libraries
54 AC_CHECK_LIB(m,pow,[math_lib="-lm"],[math_lib=""])
55 AC_SUBST(math_lib)
56 AC_CHECK_LIB(iberty,strerrno,[liberty_lib="-liberty"],[liberty_lib=""])
57 AC_SUBST(liberty_lib)
58 nsl_lib="";
59 AC_CHECK_FUNC(gethostbyname,[try_nsl=""],[try_nsl="yes"])
60 if test -n "${try_nsl}"; then
61 AC_CHECK_LIB(nsl,gethostbyname,[nsl_lib="-lnsl"],[nsl_lib=""])
62 fi
63 AC_SUBST(nsl_lib)
64 socket_lib="";
65 AC_CHECK_FUNC(connect,[try_socket=""],[try_socket="yes"])
66 if test -n "${try_socket}"; then
67 AC_CHECK_LIB(socket,connect,[socket_lib="-lsocket"],[socket_lib=""])
68 fi
69 AC_SUBST(socket_lib)
70 thread_lib="";
71 AC_CHECK_FUNC(thr_create,[try_thread=""],[try_thread="yes"])
72 if test -n "${try_thread}"; then
73 AC_CHECK_LIB(thread,thr_create,[thread_lib="-lthread"],[thread_lib=""])
74 fi
75 AC_SUBST(thread_lib)
76
77 dnl 4. checks for header files
78 dnl 5. checks for typedefs
79 dnl 6. checks for structures
80 dnl 7. checks for compiler characteristics
81 dnl 8. checks for library functions
82 dnl 9. checks for system services
83 dnl 10. checks for anything else
84
85 dnl # ------------------------------------------------
86 dnl # CHECK WHETHER TO DISABLE CPU-VENDOR-HOST TRIPLET
87 dnl # ------------------------------------------------
88 fetk_cpu_vendor_os="";
89 AC_MSG_CHECKING([whether you want to disable the CPU-VENDOR-OS install triplet])
90 AC_ARG_ENABLE(triplet,
91 [ --disable-triplet disable CPU-VENDOR-OS install triplet [[default=no]]],
92 [ triplet_kill="yes"],
93 [ triplet_kill="" ]
94 )
95 if test "${triplet_kill}" = yes; then
96 AC_MSG_RESULT([yes])
97 fetk_cpu_vendor_os="";
98 else
99 AC_MSG_RESULT([no])
100 fetk_cpu_vendor_os="${host_cpu}-${host_vendor}-${host_os}";
101 fi
102 AC_SUBST(fetk_cpu_vendor_os)
103
104 dnl # ---------------------------------------------------
105 dnl # HANDLE VARIOUS ARCHITECTURE-SPECIFIC CONFIGURATIONS
106 dnl # ---------------------------------------------------
107 if test "${host_os}" = "cygwin"; then
108 AC_DEFINE(HAVE_CYGWIN)
109 fi
110
111 dnl # ---------------------------
112 dnl # HANDLE THE READLINE LIBRARY
113 dnl # ---------------------------
114 rl_lib="";
115 AC_MSG_CHECKING([whether your environment defines FETK_RL_LIBRARY])
116 if test -n "${FETK_RL_LIBRARY}"; then
117 AC_MSG_RESULT([yes])
118 rl_lib_path="-L${FETK_RL_LIBRARY} ";
119 else
120 AC_MSG_RESULT([no])
121 rl_lib_path="";
122 fi
123 LDFLAGS_SAVE=${LDFLAGS};
124 LDFLAGS=${rl_lib_path};
125 AC_CHECK_LIB(ncurses,tgetnum,
126 [ncurses_lib="-lncurses"],
127 [ncurses_lib=""],
128 [${math_lib}])
129 AC_CHECK_LIB(readline,readline,
130 [rl_use="yes";rl_lib="${rl_lib_path}-lreadline ${ncurses_lib}"],
131 [rl_use="";rl_lib=""],
132 [${rl_lib_path} ${ncurses_lib} ${math_lib}])
133 if test -n "${rl_use}"; then
134 AC_CHECK_LIB(readline,add_history,
135 [rl_use="yes";rl_lib="${rl_lib_path}-lreadline ${ncurses_lib}"],
136 [rl_use="";rl_lib=""],
137 [${rl_lib_path} ${ncurses_lib} ${math_lib}])
138 fi
139 LDFLAGS=${LDFLAGS_SAVE};
140 AC_SUBST(rl_lib)
141
142 dnl # -----------------------
143 dnl # HANDLE SYMBOL EMBEDDING
144 dnl # -----------------------
145 AC_MSG_CHECKING([whether EMBED macro can be used without compilation errors])
146 AC_TRY_COMPILE(,
147 [#define EMBED(rctag) \
148 static const char* rctag; \
149 static void* use_rcsid=(0 ? &use_rcsid : (void*)&rcsid);
150 EMBED(rcsid)],
151 [embed_ok=yes;AC_DEFINE(HAVE_EMBED)],[embed_ok=no])
152 AC_MSG_RESULT(${embed_ok})
153
154 dnl # ------------------
155 dnl # HANDLE OBJECTIVE-C
156 dnl # ------------------
157 AC_MSG_CHECKING([whether this is an OPENSTEP/NeXTSTEP/MacOS machine])
158 if test "${host_os}" = "openstep4"; then
159 AC_MSG_RESULT([yes])
160 objc_lib="-framework AppKit -Xlinker -read_only_relocs -Xlinker suppress";
161 else
162 AC_MSG_RESULT([no])
163 objc_lib="";
164 fi
165 AC_SUBST(objc_lib)
166
167 dnl # ----------------------
168 dnl # HANDLE THE X LIBRARIES
169 dnl # ----------------------
170 AC_MSG_CHECKING([whether your environment defines FETK_X_LIBRARY])
171 if test -n "${FETK_X_LIBRARY}"; then
172 AC_MSG_RESULT([yes])
173 x_lib_path="-L${FETK_X_LIBRARY} ";
174 else
175 AC_MSG_RESULT([no])
176 x_lib_path="";
177 fi
178 AC_PATH_X
179 AC_PATH_XTRA
180 if test -z "${no_x}"; then
181 AC_DEFINE(HAVE_X11)
182 x_lib_base="-lXaw -lXmu -lXi -lXt -lXext -lX11"
183 x_lib="${x_lib_path} ${X_LIBS} ${X_EXTRA_LIBS} ${X_PRE_LIBS} ${x_lib_base}"
184 else
185 x_lib=""
186 fi
187 AC_SUBST(x_lib)
188
189 AC_MSG_RESULT([----------- begin processing SG configure options ---------])
190
191 dnl # ------------------------
192 dnl # HANDLE DEBUG COMPILATION
193 dnl # ------------------------
194 AC_MSG_CHECKING([whether you want debug compilation])
195 AC_ARG_ENABLE(vdebug,
196 [ --enable-vdebug enable debug compilation [default=no]],
197 [ vdebug_use="yes" ],
198 [ vdebug_use="" ]
199 )
200 if test -z "${vdebug_use}"; then
201 AC_MSG_RESULT([no])
202 else
203 AC_MSG_RESULT([yes])
204 AC_DEFINE(HAVE_DEBUG)
205 fi
206
207 dnl # --------------------------------
208 dnl # HANDLE ANSI/PEDANTIC COMPILATION
209 dnl # --------------------------------
210 AC_MSG_CHECKING([whether you want pedantic ANSI compilation])
211 AC_ARG_ENABLE(pansi,
212 [ --enable-pansi enable pedantic ANSI compilation],
213 [ pansi_use="yes" ],
214 [ pansi_use="" ]
215 )
216 if test -z "${pansi_use}"; then
217 AC_MSG_RESULT([no])
218 wall=""
219 wall_pedantic=""
220 wall_pedantic_ansi=""
221 pedantic_ansi=""
222 else
223 AC_MSG_RESULT([yes])
224 wall="-Wall"
225 wall_pedantic="-Wall -pedantic"
226 wall_pedantic_ansi="-Wall -pedantic -ansi"
227 pedantic_ansi="-pedantic -ansi"
228 fi
229 AC_SUBST(wall)
230 AC_SUBST(wall_pedantic)
231 AC_SUBST(wall_pedantic_ansi)
232 AC_SUBST(pedantic_ansi)
233
234 dnl # ----------------
235 dnl # HANDLE PROFILING
236 dnl # ----------------
237 AC_MSG_CHECKING([whether you want profiling])
238 AC_ARG_ENABLE(gprof,
239 [ --enable-gprof enable gprof profiling [default=no]],
240 [ gprof_use="yes" ],
241 [ gprof_use="" ]
242 )
243 if test -z "${gprof_use}"; then
244 AC_MSG_RESULT([no])
245 profile=""
246 profile_lib=""
247 else
248 AC_MSG_RESULT([yes])
249 profile="-pg"
250 profile_lib="-pg"
251 fi
252 AC_SUBST(profile)
253 AC_SUBST(profile_lib)
254
255 dnl # ---------------------------------
256 dnl # HANDLE THE ELECTRIC FENCE LIBRARY
257 dnl # ---------------------------------
258 AC_MSG_CHECKING([whether you want ElectricFence])
259 AC_ARG_ENABLE(efence,
260 [ --enable-efence enable ElectricFence malloc lib [default=no]],
261 [ efence_use="yes" ],
262 [ efence_use="" ]
263 )
264 if test -z "${efence_use}"; then
265 AC_MSG_RESULT([no])
266 zfence="";
267 zfence_lib="";
268 else
269 AC_MSG_RESULT([yes ...poking around for it])
270 AC_CHECK_LIB(efence,main,
271 [efence_use="yes";zfence="zfence";zfence_lib="-lefence"],
272 [efence_use="";zfence="";zfence_lib=""])
273 fi
274 AC_SUBST(zfence)
275 AC_SUBST(zfence_lib)
276
277 dnl # ------------------------
278 dnl # HANDLE THE MOTIF LIBRARY
279 dnl # ------------------------
280
281 dnl # Check for forced build of Motif
282 motif_inc="";
283 motif_lib="";
284 motif_use="";
285 AC_MSG_CHECKING([whether you want to disable Motif])
286 AC_ARG_ENABLE(motif,
287 [ --disable-motif disable motif [default=no]],
288 [ motif_use="" ],
289 [ motif_use="yes" ],
290 )
291
292 dnl # Look for Motif if required
293 if test -z "${motif_use}"; then
294 AC_MSG_RESULT([yes -- Motif DISABLED])
295 motif_use="";
296 elif test -n "${no_x}"; then
297 AC_MSG_RESULT([no ...poking around])
298 AC_MSG_RESULT([You do not have X...Motif DISABLED])
299 motif_use="";
300 else
301 AC_MSG_RESULT([no ...poking around])
302 motif_use="";
303
304 dnl # Motif header location ENV specification
305 AC_MSG_CHECKING([whether your environment defines FETK_MOTIF_INCLUDE])
306 if test -n "${FETK_MOTIF_INCLUDE}"; then
307 AC_MSG_RESULT([yes])
308 motif_inc_path="-I${FETK_MOTIF_INCLUDE} ";
309 else
310 AC_MSG_RESULT([no])
311 AC_MSG_CHECKING([whether your environment defines FETK_INCLUDE])
312 if test -n "${FETK_INCLUDE}"; then
313 AC_MSG_RESULT([yes])
314 motif_inc_path="-I${FETK_INCLUDE} ";
315 else
316 AC_MSG_RESULT([no])
317 motif_inc_path="";
318 fi
319 fi
320
321 dnl # Motif library location ENV specification
322 AC_MSG_CHECKING([whether your environment defines FETK_MOTIF_LIBRARY])
323 if test -n "${FETK_MOTIF_LIBRARY}"; then
324 AC_MSG_RESULT([yes])
325 motif_lib_path="-L${FETK_MOTIF_LIBRARY} ";
326 else
327 AC_MSG_RESULT([no])
328 AC_MSG_CHECKING([whether your environment defines FETK_LIBRARY])
329 if test -n "${FETK_LIBRARY}"; then
330 AC_MSG_RESULT([yes])
331 motif_lib_path="-L${FETK_LIBRARY} ";
332 else
333 AC_MSG_RESULT([no])
334 motif_lib_path="";
335 fi
336 fi
337
338 dnl # Setup temp LDFLAGS and CPPFLAGS and look for Motif library and headers
339 LDFLAGS_SAVE=${LDFLAGS};
340 CPPFLAGS_SAVE=${CPPFLAGS};
341 LDFLAGS=${motif_lib_path};
342 CPPFLAGS=${motif_inc_path};
343 motif_use="";
344 AC_CHECK_HEADER(Xm/Xm.h,
345 [motif_use="yes";motif_inc="${motif_inc_path}"],
346 [motif_use="";motif_inc=""])
347 if test -n "${motif_use}"; then
348 AC_CHECK_LIB(Xm,XmGetColors,
349 [motif_use="yes";motif_lib="${motif_lib_path}-lXm"],
350 [motif_use="";motif_lib=""],
351 [${motif_lib_path}-lXm ${x_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${objc_lib} ${math_lib}])
352 fi
353 if test -z "${motif_use}"; then
354 AC_MSG_RESULT([** Motif library OR header missing ...Motif DISABLED **])
355 else
356 AC_MSG_RESULT([** Motif library AND header found ...will USE **])
357 AC_DEFINE(HAVE_MOTIF)
358 fi
359
360 dnl # Return LDFLAGS and CPPFLAGS to normal
361 LDFLAGS=${LDFLAGS_SAVE};
362 CPPFLAGS=${CPPFLAGS_SAVE};
363 fi
364
365 dnl # Final decisions on Motif
366 AC_SUBST(motif_inc)
367 AC_SUBST(motif_lib)
368 AM_CONDITIONAL(EXISTS_MOTIF, test x$motif_use = xyes)
369
370 dnl # ---------------------
371 dnl # HANDLE THE GL LIBRARY
372 dnl # ---------------------
373
374 dnl # Check for forced build of GL
375 gl_inc="";
376 gl_lib="";
377 gl="";
378 AC_MSG_CHECKING([whether you want force build of GL lib])
379 AC_ARG_ENABLE(glforce,
380 [ --enable-glforce force building of GL library [default=no]],
381 [ gl="gl" ],
382 [ gl="" ],
383 )
384
385 dnl # Look for GL if required
386 if test -n "${gl}"; then
387 AC_MSG_RESULT([yes])
388 else
389 AC_MSG_RESULT([no ...poking around])
390
391 dnl # GL header location ENV specification
392 AC_MSG_CHECKING([whether your environment defines FETK_GL_INCLUDE])
393 if test -n "${FETK_GL_INCLUDE}"; then
394 AC_MSG_RESULT([yes])
395 gl_inc_path="-I${FETK_GL_INCLUDE} ";
396 else
397 AC_MSG_RESULT([no])
398 gl_inc_path="";
399 fi
400 if test -n "${FETK_INCLUDE}"; then
401 gl_inc_path="${gl_inc_path} -I${FETK_INCLUDE} ";
402 fi
403
404 dnl # GL library location ENV specification
405 AC_MSG_CHECKING([whether your environment defines FETK_GL_LIBRARY])
406 if test -n "${FETK_GL_LIBRARY}"; then
407 AC_MSG_RESULT([yes])
408 gl_lib_path="-L${FETK_GL_LIBRARY} ";
409 else
410 AC_MSG_RESULT([no])
411 gl_lib_path="";
412 fi
413 if test -n "${FETK_LIBRARY}"; then
414 gl_lib_path="${gl_lib_path} -L${FETK_LIBRARY} ";
415 fi
416
417 dnl # Setup temp LDFLAGS and CPPFLAGS and look for GL library/headers
418 LDFLAGS_SAVE=${LDFLAGS};
419 CPPFLAGS_SAVE=${CPPFLAGS};
420 LDFLAGS=${gl_lib_path};
421 CPPFLAGS=${gl_inc_path};
422 gl_use="";
423 AC_CHECK_HEADER(GL/gl.h,
424 [gl_use="yes";gl_inc="${gl_inc_path}"],
425 [gl_use="";gl_inc=""])
426 if test -n "${gl_use}"; then
427 AC_MSG_CHECKING([whether you need the MacOSX hack for OpenGL])
428 if test "${host_vendor}" == "apple"; then
429 AC_MSG_RESULT([yes])
430 gl_lib_hack="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
431 else
432 AC_MSG_RESULT([no])
433 gl_lib_hack="";
434 fi
435 AC_CHECK_LIB(GL,glPushMatrix,
436 [gl_use="yes";gl_lib="${gl_lib_path}-lGL ${gl_lib_hack}"],
437 [gl_use="";gl_lib=""],
438 [${gl_lib_path}-lGL ${gl_lib_hack} ${motif_lib} ${x_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${objc_lib} ${math_lib}])
439 fi
440 if test -z "${gl_use}"; then
441 AC_MSG_RESULT([** GL library OR header missing ...will BUILD **])
442 gl="gl";
443 else
444 AC_MSG_RESULT([** GL library AND header found ...will USE **])
445 gl="";
446 fi
447
448 dnl # Return LDFLAGS and CPPFLAGS to normal
449 LDFLAGS=${LDFLAGS_SAVE};
450 CPPFLAGS=${CPPFLAGS_SAVE};
451 fi
452
453 dnl # Final decisions on GL
454 AC_SUBST(gl_inc)
455 AC_SUBST(gl_lib)
456 AC_SUBST(gl)
457 AM_CONDITIONAL(BUILD_GL, test x$gl = xgl)
458
459 dnl # ----------------------
460 dnl # HANDLE THE GLU LIBRARY
461 dnl # ----------------------
462
463 dnl # Check for forced build of GLU
464 glu_inc="";
465 glu_lib="";
466 glu="";
467 AC_MSG_CHECKING([whether you want force build of GLU lib])
468 AC_ARG_ENABLE(gluforce,
469 [ --enable-gluforce force building of GLU library [default=no]],
470 [ glu="glu" ],
471 [ glu="" ],
472 )
473
474 dnl # Look for GLU if required
475 if test -n "${glu}"; then
476 AC_MSG_RESULT([yes])
477 else
478 AC_MSG_RESULT([no ...poking around])
479
480 dnl # GLU header location ENV specification
481 AC_MSG_CHECKING([whether your environment defines FETK_GLU_INCLUDE])
482 if test -n "${FETK_GLU_INCLUDE}"; then
483 AC_MSG_RESULT([yes])
484 glu_inc_path="-I${FETK_GLU_INCLUDE} ";
485 else
486 AC_MSG_RESULT([no])
487 glu_inc_path="";
488 fi
489 if test -n "${FETK_INCLUDE}"; then
490 glu_inc_path="${glu_inc_path} -I${FETK_INCLUDE} ";
491 fi
492
493 dnl # GLU library location ENV specification
494 AC_MSG_CHECKING([whether your environment defines FETK_GLU_LIBRARY])
495 if test -n "${FETK_GLU_LIBRARY}"; then
496 AC_MSG_RESULT([yes])
497 glu_lib_path="-L${FETK_GLU_LIBRARY} ";
498 else
499 AC_MSG_RESULT([no])
500 glu_lib_path="";
501 fi
502 if test -n "${FETK_LIBRARY}"; then
503 glu_lib_path="${glu_lib_path} -L${FETK_LIBRARY} ";
504 fi
505
506 dnl # Setup temp LDFLAGS and CPPFLAGS and look for GLU library/headers
507 LDFLAGS_SAVE=${LDFLAGS};
508 CPPFLAGS_SAVE=${CPPFLAGS};
509 LDFLAGS=${glu_lib_path};
510 CPPFLAGS=${glu_inc_path};
511 glu_use="";
512 AC_CHECK_HEADER(GL/glu.h,
513 [glu_use="yes";glu_inc="${glu_inc_path}"],
514 [glu_use="";glu_inc=""])
515 if test -n "${glu_use}"; then
516 AC_CHECK_LIB(GLU,gluLookAt,
517 [glu_use="yes";glu_lib="${glu_lib_path}-lGLU"],
518 [glu_use="";glu_lib=""],
519 [${glu_lib_path}-lGLU ${gl_lib} ${motif_lib} ${x_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${objc_lib} ${math_lib}])
520 fi
521 if test -z "${glu_use}"; then
522 AC_MSG_RESULT([** GLU library OR header missing ...will BUILD **])
523 glu="glu";
524 else
525 AC_MSG_RESULT([** GLU library AND header found ...will USE **])
526 glu="";
527 fi
528
529 dnl # Return LDFLAGS and CPPFLAGS to normal
530 LDFLAGS=${LDFLAGS_SAVE};
531 CPPFLAGS=${CPPFLAGS_SAVE};
532 fi
533
534 dnl # Final decisions on GLU
535 AC_SUBST(glu_inc)
536 AC_SUBST(glu_lib)
537 AC_SUBST(glu)
538 AM_CONDITIONAL(BUILD_GLU, test x$glu = xglu)
539
540 dnl # ----------------------
541 dnl # HANDLE THE GLW LIBRARY
542 dnl # ----------------------
543
544 dnl # Check for forced build of GLw
545 glw_inc="";
546 glw_lib="";
547 glw="";
548 AC_MSG_CHECKING([whether you want force build of GLw lib])
549 AC_ARG_ENABLE(glwforce,
550 [ --enable-glwforce force building of GLw library [default=no]],
551 [ glw="glw" ],
552 [ glw="" ],
553 )
554
555 dnl # Look for GLw if required
556 if test -n "${glw}"; then
557 AC_MSG_RESULT([yes])
558 if test -n "${no_x}"; then
559 AC_MSG_RESULT([You do not have X...GLw DISABLED])
560 glw=""
561 fi
562 elif test -n "${no_x}"; then
563 AC_MSG_RESULT([no ...poking around])
564 AC_MSG_RESULT([You do not have X...GLw DISABLED])
565 glw=""
566 else
567 AC_MSG_RESULT([no ...poking around])
568
569 dnl # GLw header location ENV specification
570 AC_MSG_CHECKING([whether your environment defines FETK_GLW_INCLUDE])
571 if test -n "${FETK_GLW_INCLUDE}"; then
572 AC_MSG_RESULT([yes])
573 glw_inc_path="-I${FETK_GLW_INCLUDE} ";
574 else
575 AC_MSG_RESULT([no])
576 glw_inc_path="";
577 fi
578 if test -n "${FETK_INCLUDE}"; then
579 glw_inc_path="${glw_inc_path} -I${FETK_INCLUDE} ";
580 fi
581
582 dnl # GLw library location ENV specification
583 AC_MSG_CHECKING([whether your environment defines FETK_GLW_LIBRARY])
584 if test -n "${FETK_GLW_LIBRARY}"; then
585 AC_MSG_RESULT([yes])
586 glw_lib_path="-L${FETK_GLW_LIBRARY} ";
587 else
588 AC_MSG_RESULT([no])
589 glw_lib_path="";
590 fi
591 if test -n "${FETK_LIBRARY}"; then
592 glw_lib_path="${glw_lib_path} -L${FETK_LIBRARY} ";
593 fi
594
595 dnl # Setup temp LDFLAGS and CPPFLAGS and look for GLw library/headers
596 LDFLAGS_SAVE=${LDFLAGS};
597 CPPFLAGS_SAVE=${CPPFLAGS};
598 LDFLAGS=${glw_lib_path};
599 CPPFLAGS=${glw_inc_path};
600 glw_use="";
601 AC_CHECK_HEADER(GL/GLwDrawA.h,
602 [glw_use="yes";glw_inc="${glw_inc_path}"],
603 [glw_use="";glw_inc=""])
604 if test -z "${glw_use}"; then
605 AC_CHECK_HEADER(GLw/GLwDrawA.h,
606 [glw_use="yes";glw_inc="${glw_inc_path}"],
607 [glw_use="";glw_inc=""])
608 fi
609 if test -n "${glw_use}"; then
610 AC_CHECK_LIB(GLw,GLwDrawingAreaSwapBuffers,
611 [glw_use="yes";glw_lib="${glw_lib_path}-lGLw"],
612 [glw_use="";glw_lib=""],
613 [${glw_lib_path}-lGLw ${glu_lib} ${gl_lib} ${motif_lib} ${x_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${objc_lib} ${math_lib}])
614 fi
615 if test -z "${glw_use}"; then
616 AC_MSG_RESULT([** GLw library OR header missing ...will BUILD **])
617 glw="glw";
618 else
619 AC_MSG_RESULT([** GLw library AND header found ...will USE **])
620 glw="";
621 fi
622
623 dnl # Return LDFLAGS and CPPFLAGS to normal
624 LDFLAGS=${LDFLAGS_SAVE};
625 CPPFLAGS=${CPPFLAGS_SAVE};
626 fi
627
628 dnl # Final decisions on GLW
629 AC_SUBST(glw_inc)
630 AC_SUBST(glw_lib)
631 AC_SUBST(glw)
632 AM_CONDITIONAL(BUILD_GLW, test x$glw = xglw)
633
634 AC_MSG_RESULT([------------ end processing SG configure options ----------])
635
636 AC_MSG_RESULT([---------- begin configuring for MALOC linkage ------------])
637
638 dnl # ------------------------
639 dnl # HANDLE THE MALOC LIBRARY
640 dnl # ------------------------
641
642 dnl # MALOC header location ENV specification
643 AC_MSG_CHECKING([whether your environment defines FETK_INCLUDE])
644 if test -n "${FETK_INCLUDE}"; then
645 AC_MSG_RESULT([yes])
646 maloc_inc_path="-I${FETK_INCLUDE} ";
647 else
648 AC_MSG_RESULT([no])
649 maloc_inc_path="-I${HOME}/include ";
650 fi
651
652 dnl # MALOC library location ENV specification
653 AC_MSG_CHECKING([whether your environment defines FETK_LIBRARY])
654 if test -n "${FETK_LIBRARY}"; then
655 AC_MSG_RESULT([yes])
656 maloc_lib_path="-L${FETK_LIBRARY} ";
657 else
658 AC_MSG_RESULT([no])
659 maloc_lib_path="-L${HOME}/lib ";
660 fi
661
662 dnl # Setup temp LDFLAGS and look for MALOC library/header
663 LDFLAGS_SAVE=${LDFLAGS};
664 CPPFLAGS_SAVE=${CPPFLAGS};
665 LDFLAGS=${maloc_lib_path};
666 CPPFLAGS=${maloc_inc_path};
667 maloc_found="";
668 AC_CHECK_HEADER(maloc/maloc.h,
669 [maloc_found="yes";maloc_inc="${maloc_inc_path}"],
670 [maloc_found="";maloc_inc=""])
671 if test -n "${maloc_found}"; then
672 AC_CHECK_LIB(maloc,maloc_link,
673 [maloc_found="yes";maloc_lib="${maloc_lib_path}-lmaloc"],
674 [maloc_found="";maloc_lib=""],
675 [${maloc_lib_path}-lmaloc ${rl_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${thread_lib} ${math_lib} ${zfence_lib} ${profile_lib}])
676 fi
677 if test -z "${maloc_found}"; then
678 AC_MSG_ERROR([MALOC libraries OR headers missing ...EXITING ON ERROR])
679 else
680 AC_MSG_RESULT([MALOC libraries AND headers were found ...rocking on...])
681 fi
682
683 dnl # Return LDFLAGS and CPPFLAGS to normal
684 LDFLAGS=${LDFLAGS_SAVE};
685 CPPFLAGS=${CPPFLAGS_SAVE};
686 AC_SUBST(maloc_lib)
687 AC_SUBST(maloc_inc)
688
689 dnl # Check whether MALOC actually needs the READLINE library
690 AC_CHECK_LIB(maloc,maloc_needs_rl,
691 [rl_use="yes"],
692 [rl_use=""],
693 [${maloc_lib} ${rl_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${thread_lib} ${math_lib} ${zfence_lib} ${profile_lib}])
694
695 AC_MSG_RESULT([---------- end configuring for MALOC linkage --------------])
696
697 dnl ##########################################################################
698 dnl 11. templates
699 dnl ##########################################################################
700
701 AH_TEMPLATE([HAVE_CYGWIN],
702 [Am I running in a Cygwin/Win32 environment?])
703
704 AH_TEMPLATE([HAVE_EMBED],
705 [Does EMBED macro for embedding rcsid symbols into binaries work?])
706
707 AH_TEMPLATE([HAVE_DEBUG],
708 [Do I compile as a debug version?])
709
710 AH_TEMPLATE([HAVE_X11],
711 [Do I have X?])
712
713 AH_TEMPLATE([HAVE_MOTIF],
714 [Do I have Motif?])
715
716 AH_TOP([
717 /*
718 * ***************************************************************************
719 * SG = < Socket Graphics >
720 * Copyright (C) 1994-- Michael Holst
721 *
722 * This library is free software; you can redistribute it and/or
723 * modify it under the terms of the GNU Lesser General Public
724 * License as published by the Free Software Foundation; either
725 * version 2.1 of the License, or (at your option) any later version.
726 *
727 * This library is distributed in the hope that it will be useful,
728 * but WITHOUT ANY WARRANTY; without even the implied warranty of
729 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
730 * Lesser General Public License for more details.
731 *
732 * You should have received a copy of the GNU Lesser General Public
733 * License along with this library; if not, write to the Free Software
734 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
735 *
736 * rcsid="INTENTIONALLY LEFT BLANK"
737 * ***************************************************************************
738 */
739
740 /*
741 * ***************************************************************************
742 * File: acconfig.h
743 *
744 * Purpose: Generates the main configuration header "sgcf.h" for SG.
745 *
746 * Author: Michael Holst
747 * ***************************************************************************
748 */
749
750 #ifndef _SGCF_H_
751 #define _SGCF_H_
752 ])
753
754 AH_BOTTOM([
755 /*
756 * ***************************************************************************
757 * Undo the damage done by the autoconf tools
758 * ***************************************************************************
759 */
760 #undef HAVE_DLFCN_H
761 #undef HAVE_INTTYPES_H
762 #undef HAVE_MEMORY_H
763 #undef HAVE_STDINT_H
764 #undef HAVE_STDLIB_H
765 #undef HAVE_STRINGS_H
766 #undef HAVE_STRING_H
767 #undef HAVE_SYS_STAT_H
768 #undef HAVE_SYS_TYPES_H
769 #undef HAVE_UNISTD_H
770
771 /*
772 * ***************************************************************************
773 * Handle some additional window system and graphics things manually
774 * ***************************************************************************
775 */
776
777 #if defined(WIN32) || defined(__WATCOMC__)
778 # define HAVE_WIN32
779 # define POLYGON_OFFSET_MISSING 1
780 #endif
781
782 #if defined(NeXT) || defined(__NeXT__)
783 # define HAVE_NEXT
784 #endif
785
786 #if !defined(POLYGON_OFFSET_MISSING)
787 # define HAVE_POLYGON_OFFSET
788 #endif
789
790 /*
791 * ***************************************************************************
792 * Define some RCS tag embedding and debug I/O macros
793 * ***************************************************************************
794 */
795
796 /* Embedded RCS tags ("ident filename" prints module versions in filename) */
797 #if defined(HAVE_EMBED)
798 # define VEMBED(rctag) \
799 VPRIVATE const char* rctag; \
800 static void* use_rcsid=(0 ? &use_rcsid : (void*)&rcsid);
801 #else
802 # define VEMBED(rctag)
803 #endif
804
805 /* Produce additional debugging I/O */
806 #if defined(HAVE_DEBUG)
807 # define VDEBUGIO(str) fprintf(stderr,str)
808 #else
809 # define VDEBUGIO(str)
810 #endif
811
812 #endif /* _SGCF_H_ */
813 ])
814
815 dnl ##########################################################################
816 dnl 12. Test for doxygen and graphviz
817 dnl ##########################################################################
818
819 cwd=`pwd`
820 cd ${srcdir}
821 TOPDIR=`pwd`
822 cd ${cwd}
823
824 AC_ARG_WITH(doxygen, [AC_HELP_STRING([--with-doxygen],[Doxygen path])],
825 with_doxygen=$withval, with_doxygen=no)
826
827 if test "$with_doxygen" = "no"; then
828 AC_PATH_PROG(doxygen_path, doxygen)
829 if test -z "${doxygen_path}"; then
830 AC_MSG_WARN([Unable to find doxygen!])
831 fi
832 else
833 doxygen_path=$with_doxygen
834 fi
835
836 AC_ARG_WITH(dot, [AC_HELP_STRING([--with-dot],[Dot path])],
837 with_dot=$withval, with_dot=no)
838
839 if test "$with_dot" = "no"; then
840 AC_PATH_PROG(dot_path, dot)
841 if test -z "${dot_path}"; then
842 AC_MSG_WARN([Unable to find dot!])
843 fi
844 else
845 dot_path=$with_dot
846 fi
847
848 if test "$dot_path" = ""; then
849 sed -e 's%@have_dot@%'NO'%' $TOPDIR/doc/doxygen/sg.dox.in > $TOPDIR/doc/doxygen/sg.dox.in.temp
850 sed -e 's%@dot_path@%''%' $TOPDIR/doc/doxygen/sg.dox.in.temp > $TOPDIR/doc/doxygen/sg.dox.in.temp.2
851 else
852 sed -e 's%@have_dot@%'YES'%' $TOPDIR/doc/doxygen/sg.dox.in > $TOPDIR/doc/doxygen/sg.dox.in.temp
853 sed -e 's%@dot_path@%'${dot_path}'%' $TOPDIR/doc/doxygen/sg.dox.in.temp > $TOPDIR/doc/doxygen/sg.dox.in.temp.2
854 fi
855
856 sed -e 's%@topdir@%'${TOPDIR}'%' $TOPDIR/doc/doxygen/sg.dox.in.temp.2 > $TOPDIR/doc/doxygen/sg.dox
857 rm -f $TOPDIR/doc/doxygen/sg.dox.in.temp*
858
859 AM_CONDITIONAL(MAKE_DOC, test "$doxygen_path" != "")
860 AC_SUBST(MAKE_DOC)
861 AC_SUBST(doxygen_path)
862
863 dnl ##########################################################################
864 dnl 13. generate the makefiles
865 dnl ##########################################################################
866
867 AC_OUTPUT([
868 Makefile
869 src/Makefile
870
871 src/base/Makefile
872
873 src/gl/Makefile
874 src/glu/Makefile
875 src/glw/Makefile
876 src/ogl/Makefile
877 src/vgl/Makefile
878
879 src/aaa_inc/Makefile
880 src/aaa_inc/sg/Makefile
881 src/aaa_inc/GL/Makefile
882
883 src/aaa_lib/Makefile
884
885 doc/Makefile
886 doc/doxygen/Makefile
887 ])
888