Annotation of Amaya/configure.in, revision 1.85
1.1 cvs 1: dnl
2: dnl Process this file with autoconf to produce a configure script.
3: dnl Autoconf script for Amaya and Thot.
1.10 cvs 4: dnl Daniel Veillard and Irene Vatton, 1997
1.1 cvs 5: dnl
6:
7: dnl ***************************************************************
8: dnl
9: dnl GENERIC AUTOCONF STUFF : GUESS INFORMATIONS ON SYSTEM SETUP
10: dnl
11: dnl ***************************************************************
12:
13: AC_PREREQ(2.2)
14: AC_INIT(thotlib/internals/h/constpiv.h)
15: AC_REVISION
16:
17: dnl
1.69 kahan 18: dnl Verify that configure is not being called in the Amaya directory
19: dnl
20: if test -d batch -a -f configure.in ; then
1.70 kahan 21: echo
22: echo "****************************************************************"
1.69 kahan 23: echo ERROR: You must invoke the configure script in a subidrectory
24: echo under the Amaya tree.
25: echo For example:
26: echo " cd Amaya ; mkdir obj ; cd obj ; ../configure [your options] "
1.70 kahan 27: echo "****************************************************************"
28: echo
1.69 kahan 29: exit 1
30: fi
31:
32: dnl
1.1 cvs 33: dnl Checks for platform information
34: dnl
35:
36: AC_CANONICAL_SYSTEM
37: AC_CONFIG_HEADER(config.h)
38:
39: dnl
40: dnl Initializing Automake
41: dnl
42:
43: AC_PROG_MAKE_SET
44: AC_ARG_PROGRAM
45:
46: dnl
47: dnl Checks for programs.
48: dnl
49:
50: AC_PROG_YACC
51: AC_PROG_CC
52: AC_PROG_CPP
53: AC_PROG_LEX
54: AC_PROG_AWK
55: AC_PROG_INSTALL
56: AC_PROG_LN_S
57: AC_PROG_MAKE_SET
58: AC_PROG_RANLIB
59: AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/ucb/bin)
60: AC_PATH_PROG(MV, mv, /bin/mv, $PATH:/bin:/usr/bin:/usr/ucb/bin)
61: AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/ucb/bin)
62: AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir, $PATH:/bin:/usr/bin:/usr/ucb/bin)
63: AC_PATH_PROG(ECHO, echo, /bin/echo, $PATH:/bin:/usr/bin:/usr/ucb/bin)
64: AC_PATH_PROG(CAT, cat, /bin/cat, $PATH:/bin:/usr/bin:/usr/ucb/bin)
65: AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/ucb/bin)
66: AC_PATH_PROG(SED, sed, /bin/sed, $PATH:/bin:/usr/bin:/usr/ucb/bin)
67: AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.6 cvs 68: AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
1.1 cvs 69:
70: dnl
71: dnl Checks for libraries.
72: dnl
73:
74: AC_CHECK_LIB(socket, socket, )
75: AC_CHECK_LIB(inet, connect)
76: AC_CHECK_LIB(nsl, t_accept)
77: AC_CHECK_LIB(dl, dlopen)
78: AC_PATH_X
79: AC_PATH_XTRA
80:
1.41 cvs 81: dnl
82: dnl Check for libXp
83: dnl
1.38 cvs 84:
1.41 cvs 85: for ac_dir in \
86: /usr/X11R6/lib \
87: /usr/X11R5/lib \
88: \
89: /usr/lib/X11R6 \
90: /usr/lib/X11R5 \
91: \
92: /usr/local/X11R6/lib \
93: /usr/local/X11R5/lib \
94: \
95: /usr/local/lib/X11R6 \
96: /usr/local/lib/X11R5 \
97: \
98: /usr/X11/lib \
99: /usr/lib/X11 \
100: /usr/local/X11/lib \
101: /usr/local/lib/X11 \
102: \
103: /usr/X386/lib \
104: /usr/x386/lib \
105: /usr/XFree86/lib/X11 \
106: \
107: /usr/dt/lib \
108: \
109: /usr/lib \
110: /usr/local/lib \
111: /usr/unsupported/lib \
112: /usr/athena/lib \
113: /usr/local/x11r5/lib \
114: /usr/lpp/Xamples/lib \
115: \
116: /usr/lesstif/lib \
117: /usr/local/lesstif/lib\
118: /usr/gnu/lesstif/lib \
119: $HOME/lesstif/lib \
120: ; \
121: do
122: if test -r "$ac_dir/libXp.a" -o -r "$ac_dir/libXp.so"; then
123: echo "\nfound libXp.a\n"
124: X_PRE_LIBS="-lXp ${X_PRE_LIBS}"
125: break
126: fi
127: done
1.1 cvs 128: dnl
1.5 cvs 129: dnl Checks for header files.
130: dnl
131:
132: AC_HEADER_DIRENT
133: AC_HEADER_STDC
134: AC_HEADER_SYS_WAIT
135:
136: AC_CHECK_HEADERS(stdio.h)
137: AC_CHECK_HEADERS(sys/types.h types.h)
138: AC_CHECK_HEADERS(sys/unistd.h unistd.h)
139: AC_CHECK_HEADERS(sys/fcntl.h fcntl.h)
140: AC_CHECK_HEADERS(sys/limits.h limits.h)
141: AC_CHECK_HEADERS(sys/stat.h stat.h)
142: AC_CHECK_HEADERS(sys/file.h)
143: AC_CHECK_HEADERS(sys/ioctl.h)
144: AC_CHECK_HEADERS(sys/time.h time.h)
145: AC_CHECK_HEADERS(sys/systeminfo.h)
1.46 cvs 146: AC_CHECK_HEADERS(sys/string.h strings.h)
1.34 cvs 147: AC_CHECK_HEADERS(sys/syslog.h syslog.h)
1.5 cvs 148: AC_CHECK_HEADERS(sys/socket.h socket.h)
149: AC_CHECK_HEADERS(appkit/appkit.h appkit.h)
1.72 vatton 150: AC_CHECK_HEADERS(apppkit/apppkit.h apppkit.h)
1.5 cvs 151: AC_CHECK_HEADERS(netinet/in.h in.h)
152: AC_CHECK_HEADERS(dn.h)
153: AC_CHECK_HEADERS(sys/ipc.h)
154: AC_CHECK_HEADERS(net/errno.h sys/errno.h errno.h)
155: AC_CHECK_HEADERS(pwd.h)
156: AC_CHECK_HEADERS(grp.h)
157: AC_CHECK_HEADERS(arpa/inet.h inet.h)
158: AC_CHECK_HEADERS(netdb.h)
159: AC_CHECK_HEADERS(manifest.h)
160: AC_CHECK_HEADERS(bsdtypes.h)
161: AC_CHECK_HEADERS(stdefs.h)
162: AC_CHECK_HEADERS(bsdtime.h)
163: AC_CHECK_HEADERS(sys/select.h select.h)
164: AC_CHECK_HEADERS(dnetdb.h)
165: AC_CHECK_HEADERS(libc.h)
166: AC_CHECK_HEADERS(stdlib.h)
167: AC_CHECK_HEADERS(malloc.h)
168: AC_CHECK_HEADERS(memory.h)
169: AC_CHECK_HEADERS(unixlib.h)
170: AC_CHECK_HEADERS(ctype.h)
171: AC_CHECK_HEADERS(cursesX.h curses.h)
172: AC_CHECK_HEADERS(sys/resource.h resource.h)
173: AC_HEADER_DIRENT
174: AC_CHECK_HEADERS(dir.h direct.h) dnl AC_HEADER_DIRENT only checks for some..
175: AC_HEADER_STDC
176: AC_HEADER_SYS_WAIT
177: AC_HEADER_TIME
178: AC_HEADER_STAT
179:
180: dnl
181: dnl Checks for typedefs, structures, and compiler characteristics.
182: dnl
183:
184: AC_C_CONST
185: AC_C_INLINE
186: AC_TYPE_MODE_T
187: AC_TYPE_OFF_T
188: AC_TYPE_SIZE_T
189: AC_HEADER_TIME
190: AC_STRUCT_TM
191: AC_STRUCT_TIMEZONE
192: AC_TYPE_UID_T
193:
194: dnl
195: dnl Checks for library functions.
196: dnl
197:
198: AC_FUNC_ALLOCA
199: AC_TYPE_GETGROUPS
200: AC_PROG_GCC_TRADITIONAL
201: AC_FUNC_MEMCMP
202: AC_FUNC_MMAP
203: AC_TYPE_SIGNAL
204: AC_FUNC_VPRINTF
1.58 cvs 205: AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mkdir mktime putenv select socket strdup strerror strftime strstr strtod strtol uname lstat strcasecmp strncasecmp strchr memcpy)
1.5 cvs 206:
1.75 cheyroul 207:
1.85 ! vatton 208:
! 209: AC_ARG_WITH(GL, [ --with-gl enable Opengl canvas (experimental) ])
! 210: dnl
! 211: dnl GL canvas is disabled by default
! 212: dnl
! 213: dnl needs Opengl, glu, Xft (xfree 4 font server)
! 214: dnl needs GTK
! 215: dnl text WILL need freetype2, ftgl
! 216: dnl GL is for opengl
! 217: dnl Glu is for text drawing (until we switch)
! 218: dnl GLU is for tesselation algortihms (until we extract it from this lib)
! 219: dnl (tesselation is used for polygons with holes in it...)
! 220: dnl gtkgl is for integration of opengl in GTK
! 221: if test "$with_gl" = "" ; then
! 222: if test "$enable_gl" = "yes" ; then
! 223: with_gl="yes"
! 224: else
! 225: with_gl="no"
! 226: fi
! 227: fi
! 228:
1.63 vatton 229: GTK_OPTIONS=
230: AC_ARG_WITH(gtk, [ --with-gtk use GTK instead of Motif])
231: if test "$withval" = "yes" ; then
1.85 ! vatton 232: with_gtk="yes"
! 233: else
! 234: if test "$with_gl" = "yes" ; then
! 235: with_gtk="yes"
! 236: fi
! 237: fi
! 238:
! 239: if test "$with_gtk" = "yes" ; then
1.63 vatton 240: for ac_dir in \
1.65 cvs 241: /usr/lib/glib/include \
1.63 vatton 242: /usr/X11R6/include \
243: \
244: /usr/include/X11R6 \
245: /usr/local/X11R6/include \
246: /usr/local/include/X11R6 \
247: \
248: /usr/X11/include \
249: /usr/include/X11 \
250: /usr/local/X11/include \
251: /usr/local/include/X11 \
252: \
253: /usr/X386/include \
254: /usr/x386/include \
255: /usr/XFree86/include/X11 \
256: /usr/dt/include \
257: /usr/include \
258: /usr/local/include \
259: /usr/local/lib/glib/include \
260: ; \
261: do
262: if test -r "$ac_dir/gdk/gdk.h"; then
263: no_gtk= ac_gtk_includes=$ac_dir
264: break
265: fi
266: done
267:
1.65 cvs 268: GTK_INCLUDES="`gtk-config --cflags`"
1.63 vatton 269: AC_SUBST(GTK_INCLUDES)
1.65 cvs 270: GTK_LIBRARIES="`gtk-config --libs` -lgdk_imlib -ltiff -lgif"
1.63 vatton 271: AC_SUBST(GTK_LIBRARIES)
1.65 cvs 272: GTK_OPTIONS=-D_GTK
1.63 vatton 273: no_motif=yes
1.76 vatton 274: no_graphic=yes
1.63 vatton 275: else
1.5 cvs 276: dnl
1.4 cvs 277: dnl Checking for Motif libraries and includes
278: dnl
279: dnl Borrowed from Lesstif configure.in
280: dnl Lesstif is a Great Project (TM)
281: dnl
282:
283: AC_DEFUN(AC_PATH_MOTIF_DIRECT,
284: [test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
285: test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
286: test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
287: for ac_dir in \
288: /usr/include/Motif1.2 \
289: /usr/Motif1.2/include \
1.71 vatton 290: /sw/Lesstif/Motif2.0/include \
1.4 cvs 291: \
292: /usr/motif/include \
293: \
294: /usr/X11R6/include \
295: /usr/X11R5/include \
296: \
297: /usr/include/X11R6 \
298: /usr/include/X11R5 \
299: \
300: /usr/local/X11R6/include \
301: /usr/local/X11R5/include \
302: \
303: /usr/local/include/X11R6 \
304: /usr/local/include/X11R5 \
305: \
306: /usr/X11/include \
307: /usr/include/X11 \
308: /usr/local/X11/include \
309: /usr/local/include/X11 \
310: \
311: /usr/X386/include \
312: /usr/x386/include \
313: /usr/XFree86/include/X11 \
314: \
315: /usr/dt/include \
316: \
317: /usr/include \
318: /usr/local/include \
319: /usr/unsupported/include \
320: /usr/athena/include \
321: /usr/local/x11r5/include \
322: /usr/lpp/Xamples/include \
1.14 cvs 323: \
324: /usr/lesstif/include \
325: /usr/local/lesstif/include\
326: /usr/gnu/lesstif/include \
327: $HOME/lesstif/include \
1.4 cvs 328: ; \
329: do
330: if test -r "$ac_dir/$motif_direct_test_include"; then
331: no_motif= ac_motif_includes=$ac_dir
332: break
333: fi
334: done
335:
336: # Check for the libraries.
337: # See if we find them without any special options.
338: # Don't add to $LIBS permanently.
339: ac_save_LIBS="$LIBS"
340: LIBS="-l$motif_direct_test_library $LIBS"
341: # First see if replacing the include by lib works.
342: for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
343: /usr/lib/Motif1.2 \
344: /usr/Motif1.2/lib \
1.71 vatton 345: /sw/Lesstif/Motif2.0/lib \
1.4 cvs 346: \
347: /usr/motif/lib \
348: \
349: /usr/X11R6/lib \
350: /usr/X11R5/lib \
351: \
352: /usr/lib/X11R6 \
353: /usr/lib/X11R5 \
354: \
355: /usr/local/X11R6/lib \
356: /usr/local/X11R5/lib \
357: \
358: /usr/local/lib/X11R6 \
359: /usr/local/lib/X11R5 \
360: \
361: /usr/X11/lib \
362: /usr/lib/X11 \
363: /usr/local/X11/lib \
364: \
365: /usr/X386/lib \
366: /usr/x386/lib \
367: /usr/XFree86/lib/X11 \
368: \
369: /usr/lib \
370: /usr/local/lib \
371: /usr/unsupported/lib \
372: /usr/athena/lib \
373: /usr/local/x11r5/lib \
374: /usr/lpp/Xamples/lib \
1.14 cvs 375: \
376: /usr/lesstif/lib \
377: /usr/local/lesstif/lib\
378: /usr/gnu/lesstif/lib \
379: $HOME/lesstif/lib \
1.4 cvs 380: ; \
381: do
1.71 vatton 382: for ac_extension in a so sl la; do
1.4 cvs 383: if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
384: no_motif= ac_motif_libraries=$ac_dir
385: break 2
386: fi
387: done
1.5 cvs 388: done
389: LIBS="$ac_save_LIBS"
390: ])
1.4 cvs 391:
392: AC_DEFUN(AC_PATH_MOTIF,
1.66 vatton 393: [AC_REQUIRE_CPP()
1.4 cvs 394:
395: motif_includes=NONE
396: motif_libraries=NONE
397:
398: AC_MSG_CHECKING(for Motif)
1.63 vatton 399: if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
400: no_motif=
1.4 cvs 401: else
402: AC_CACHE_VAL(ac_cv_path_motif,
403: [# One or both of these vars are not set, and there is no cached value.
1.63 vatton 404: no_motif=yes
1.4 cvs 405: AC_PATH_MOTIF_DIRECT
406:
407: if test "$no_motif" = yes; then
1.63 vatton 408: ac_cv_path_motif="no_motif=yes"
1.4 cvs 409: else
1.63 vatton 410: ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
1.66 vatton 411: fi])
412: eval "$ac_cv_path_motif"
1.63 vatton 413: fi
1.4 cvs 414:
415: if test "$no_motif" = yes; then
416: AC_MSG_RESULT(no)
1.5 cvs 417: MOTIF_INCLUDES=
418: MOTIF_LIBRARIES=
1.4 cvs 419: else
420: test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
421: test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
422: ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
423: AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
1.5 cvs 424: if test "$motif_includes" != "/usr/include" ; then
425: MOTIF_INCLUDES="-I$motif_includes"
426: fi
427: if test "$motif_libraries" != "/usr/lib" ; then
1.64 cvs 428: MOTIF_LIBRARIES="-L$motif_libraries -lXm"
1.19 cvs 429: case "${host}" in
430: *-*sun-solaris* )
431: MOTIF_LIBRARIES="${MOTIF_LIBRARIES} -R$motif_libraries"
432: ;;
1.65 cvs 433: esac
434: else
435: MOTIF_LIBRARIES="-lXm"
1.5 cvs 436: fi
1.4 cvs 437: fi
1.5 cvs 438: AC_SUBST(MOTIF_INCLUDES)
439: AC_SUBST(MOTIF_LIBRARIES)
1.4 cvs 440: ])
441:
442: AC_PATH_MOTIF
1.66 vatton 443: fi
1.4 cvs 444:
1.63 vatton 445: if test "${GCC}" = "yes"; then
446: CPP="${CPP} -x c"
447: fi
448:
1.1 cvs 449: dnl ***************************************************************
450: dnl
1.61 cvs 451: dnl SPECIFIC STUFF : CONFIGURATION OPTIONS FOR AMAYA
1.1 cvs 452: dnl
453: dnl ***************************************************************
454:
1.76 vatton 455: AC_ARG_WITH(graphic-libs, [ --without-graphic-libs doesn't use provided libjpeg, libpng.])
456: if test "$withval" = "no" ; then
1.83 vatton 457: no_graphic=yes
458: fi
459: if test "$withval" = "yes" ; then
460: no_graphic=no
1.76 vatton 461: fi
462:
463: if test "$no_graphic" = yes; then
464: dnl
465: AC_MSG_CHECKING([for libjpeg version = 6b])
466: AC_EGREP_CPP([x 62 *x],
467: [#include <jpeglib.h>
468: x JPEG_LIB_VERSION x],
469: dnl
470: AC_MSG_RESULT([yes])
471: LIBJPEG='-ljpeg'
472: MAKEJPEG=['#'],
473: dnl
474: AC_MSG_RESULT([no])
475: LIBJPEG='../libjpeg.a' dnl LIBJPEG goes into amaya/Makefile.in
476: )
477: dnl
478: dnl
479: AC_MSG_CHECKING([for libpng version = 1.0.x])
480: AC_EGREP_CPP([x \"1.0\..*\" *x],
481: [#include <png.h>
482: x PNG_LIBPNG_VER_STRING x],
483: dnl
484: AC_MSG_RESULT([yes])
485: LIBPNG='-lpng'
486: LIBZ=''
487: MAKEPNG=['#'],
488: dnl
489: AC_MSG_RESULT([no])
490: LIBPNG='../libpng.a'
491: LIBZ='../libz.a'
492: )
493: else
494: LIBJPEG='../libjpeg.a'
495: LIBPNG='../libpng.a'
496: LIBZ='../libz.a'
497: fi
498: dnl
499: AC_SUBST(LIBJPEG)
500: AC_SUBST(LIBPNG)
501: AC_SUBST(LIBZ)
502: AC_SUBST(MAKEJPEG)
503: AC_SUBST(MAKEPNG)
504:
1.68 vatton 505: AMAYA_VER="6.0"
1.1 cvs 506:
507: dnl
1.6 cvs 508: dnl We use a special versoin of cextract patched for alignment
509: dnl to build the signatures of the modules functions located in f subdirs
510: dnl
511: CEXTRACT_VER="1.7"
512: CEXTRACT_FLAGS="+O"
513:
1.3 cvs 514:
515: dnl
1.9 cvs 516: dnl Adjust the some variables depending on the host and compiler
1.61 cvs 517: dnl Thotlib NEED signed chars !!!
1.7 cvs 518: dnl
519:
520: if test "${CC}" = "gcc" ; then
1.44 cvs 521: CFLAGS="${CFLAGS} -W "
1.7 cvs 522: case "${host}" in
523: *-*-irix5* | *-*irix6* )
524: CFLAGS="${CFLAGS} -fsigned-char"
525: ;;
526: esac
1.14 cvs 527: fi
528:
529: if test "$ac_cv_c_const" = "no" ; then
530: CFLAGS="${CFLAGS} -DCONST= "
1.7 cvs 531: fi
532:
533: dnl
1.61 cvs 534: dnl Check for availability of amaya sources
1.1 cvs 535: dnl
536:
537: build_amaya="yes"
538:
539: if test "$with_amaya" = "no" ; then
540: build_amaya="no"
1.45 cvs 541: else
542: if test ! -f $srcdir/amaya/Makefile.in ; then
1.1 cvs 543: AC_MSG_WARN(Amaya browser/editor sources not found, disabling Amaya build !)
544: build_amaya="no"
1.45 cvs 545: fi
1.1 cvs 546: fi
547:
548: dnl
1.50 cvs 549: dnl Check for additionnal packages
1.1 cvs 550: dnl use AC_CONFIG_SUBDIRS to launch configure in the subdir
551: dnl
1.82 vatton 552: AC_ARG_WITH(i18n, [ --without-i18n disable internationalization support ])
1.76 vatton 553: dnl
554: dnl I18N support disabled by default
555: dnl
1.77 kahan 556:
557: if test "$with_i18n" = "" ; then
1.82 vatton 558: if test "$enable_i18n" = "no" ; then
559: with_i18n="no"
560: else
1.77 kahan 561: with_i18n="yes"
562: fi
563:
564: fi
1.76 vatton 565: if test "$with_i18n" = "yes" ; then
566: I18N_OPTIONS=-D_I18N_
567: else
568: with_i18n="no"
569: I18N_OPTIONS=""
570: fi
1.1 cvs 571:
1.75 cheyroul 572: if test "$with_gl" = "yes" ; then
573: AC_MSG_CHECKING([OpenGL])
574: for ac_dir in \
575: /usr/include \
576: /usr/X11R6/include \
577: /usr/local/include \
578: ; \
1.80 cheyroul 579: do if test -r "$ac_dir/GL/gl.h" ; then
1.75 cheyroul 580: gl_inc="yes"
1.80 cheyroul 581: GL_INC_I="$ac_dir"
582: if test "$ac_dir" != "/usr/include" ; then
583: GL_INCLUDES="-I$ac_dir"
584: fi
1.75 cheyroul 585: break
586: fi
1.80 cheyroul 587: done
588: AC_MSG_CHECKING([GLU])
1.75 cheyroul 589: for ac_dir in \
590: /usr/include/GL \
591: /usr/include \
592: /usr/X11R6/include/GL \
593: /usr/X11R6/include \
594: /usr/local/include \
595: /usr/local/include/GL \
596: ; \
597: do if test -r "$ac_dir/glu.h" ; then
598: glu_inc="yes"
1.80 cheyroul 599: GL_INC_II="$ac_dir"
600: if test "$ac_dir" != "/usr/include" ; then
601: if test "$ac_dir" != "$GL_INC_I" ; then
602: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
603: fi
604: fi
1.75 cheyroul 605: break
606: fi
607: done
1.80 cheyroul 608: AC_MSG_CHECKING([GTKGLAREA])
1.75 cheyroul 609: for ac_dir in \
610: /usr/include/GL \
611: /usr/include \
612: /usr/X11R6/include/GL \
613: /usr/X11R6/include \
614: /usr/local/include \
615: /usr/local/include/GL \
616: ; \
617: do if test -r "$ac_dir/gtkgl/gtkglarea.h" ; then
618: gtkgl_inc="yes"
1.80 cheyroul 619: if test "$ac_dir" != "/usr/include" ; then
620: if test "$ac_dir" != "$GL_INC_II" ; then
621: if test "$ac_dir" != "$GL_INC_I" ; then
622: GL_INCLUDES="$GL_INCLUDES -I$ac_dir"
623: fi
624: fi
625: fi
1.75 cheyroul 626: break
627: fi
628: done
1.80 cheyroul 629: AC_MSG_CHECKING([freetype])
630: for ac_dir in \
631: /usr/include \
632: /usr/X11R6/include \
633: /usr/local/include \
634: ; \
635: do if test -r "$ac_dir/ft2build.h" ; then
636: freetype_inc="yes"
637: GL_INCLUDES="$GL_INCLUDES `freetype-config --cflags`"
638: break
639: fi
640: done
1.75 cheyroul 641: if test "$gl_inc" = "" ; then
642: AC_MSG_WARN(Opengl headers (gl.h) not found !!)
643: AC_MSG_WARN(Disabling opengl build !)
644: with_gl="no"
645: GL_OPTIONS=
646: GL_INCLUDES=
647: GL_LIBRARIES=
1.81 cheyroul 648: exit 1;
1.75 cheyroul 649: fi
650: if test "$glu_inc" = "" ; then
651: AC_MSG_WARN(Glu headers (glu.h) not found !!)
652: AC_MSG_WARN(Disabling opengl build !)
1.81 cheyroul 653:
1.75 cheyroul 654: with_gl="no"
655: GL_OPTIONS=
656: GL_INCLUDES=
657: GL_LIBRARIES=
1.81 cheyroul 658: exit 1;
1.75 cheyroul 659: fi
660: if test "$gtkgl_inc" = "" ; then
661: AC_MSG_WARN(Gtkglarea headers (gktglarea.h) not found !!)
662: AC_MSG_WARN(Disabling opengl build !)
663: with_gl="no"
664: GL_OPTIONS=
665: GL_INCLUDES=
666: GL_LIBRARIES=
1.81 cheyroul 667: exit 1;
1.75 cheyroul 668: fi
1.80 cheyroul 669: if test "$freetype_inc" = "" ; then
670: AC_MSG_WARN(Freetype 2 headers (ft2build.h) not found !!)
671: AC_MSG_WARN(Disabling opengl build !)
672: with_gl="no"
673: GL_OPTIONS=
674: GL_INCLUDES=
675: GL_LIBRARIES=
1.81 cheyroul 676: exit 1;
1.80 cheyroul 677: fi
1.75 cheyroul 678: if test "$gl_inc" = "yes" ; then
1.79 cheyroul 679: if test "$glu_inc" = "yes" ; then
680: if test "$gtkgl_inc" = "yes" ; then
1.80 cheyroul 681: if test "$freetype_inc" = "yes" ; then
682: GL_LIBRARIES=" -lXmu -lXft -lfreetype -lGL -lGLU -lgtkgl "
1.79 cheyroul 683: GL_OPTIONS=-D_GL
684: no_motif=yes
1.80 cheyroul 685: fi
1.75 cheyroul 686: fi
687: fi
688: fi
689: AC_SUBST(GL_INCLUDES)
690: AC_SUBST(GL_LIBRARIES)
691: fi
1.76 vatton 692:
693: AC_ARG_ENABLE(svg, [ --disable-svg remove SVG support ])
694: AC_ARG_ENABLE(annot, [ --disable-annot remove Annotations support ])
695: AC_ARG_ENABLE(generic-xml, [ --disable-generic-xml remove Generic XML support ])
696: AC_ARG_ENABLE(annot-threads, [ --disable-annot-threads remove annotation threads ])
697:
1.75 cheyroul 698: dnl
1.21 cvs 699: dnl plugins support is disabled by default
1.8 cvs 700: dnl
1.13 cvs 701:
702: if test "$with_plugin" = "" ; then
1.21 cvs 703: if test "$enable_plugin" = "yes" ; then
1.55 kahan 704: with_plugin="yes"
1.21 cvs 705: else
1.17 cvs 706: with_plugin="no"
707: fi
1.10 cvs 708: fi
1.1 cvs 709:
1.8 cvs 710: dnl
1.68 vatton 711: dnl svg is enabled by default
1.26 cvs 712: dnl
1.68 vatton 713: if test "$with_svg" = "" ; then
714: if test "$enable_svg" = "no" ; then
715: with_svg="no"
1.49 cvs 716: else
1.68 vatton 717: with_svg="yes"
1.26 cvs 718: fi
719: fi
720:
721: dnl
1.56 kahan 722: dnl annotations is enabled by default
1.47 cvs 723: dnl
724: if test "$with_annot" = "" ; then
1.56 kahan 725: if test "$enable_annot" = "no" ; then
726: with_annot="no"
727: else
1.54 cvs 728: with_annot="yes"
1.47 cvs 729: fi
730: fi
731:
1.70 kahan 732: dnl
733: dnl Generic XML support enabled by default
734: dnl
735: if test "$with_generic_xml" = "" ; then
736: if test "$enable_generic_xml" = "no" ; then
737: with_generic_xml="no"
738: GENERIC_XML_OPTIONS=
739: else
740: with_generic_xml="yes"
741: GENERIC_XML_OPTIONS=-DXML_GENERIC
742: fi
743: fi
744:
745: dnl
1.73 kahan 746: dnl Annotation thread support enabled by default
1.70 kahan 747: dnl
1.84 kahan 748: dnl if test "$with_annot_threads" = "" ; then
749: dnl if test "$enable_annot_threads" = "no" ; then
750: dnl with_annot_threads="no"
751: dnl ANNOT_THREAD_OPTIONS=
752: dnl else
753: dnl with_annot_threads="yes"
754: dnl ANNOT_THREAD_OPTIONS=-DANNOT_ON_ANNOT
755: dnl fi
756: dnl fi
1.70 kahan 757:
1.19 cvs 758: if test "$build_amaya" = "yes" ; then
1.43 cvs 759: if test ! -f $srcdir/../libwww/Makefile.in ; then
1.50 cvs 760: AC_MSG_WARN(libwww sources not found !!)
761: AC_MSG_WARN(Disabling Amaya build !)
762: build_amaya="no"
1.1 cvs 763: fi
1.8 cvs 764:
765: if test ! -f $srcdir/amaya/MathML.S ; then
1.10 cvs 766: if test "$with_math" = "yes" ; then
1.8 cvs 767: AC_MSG_WARN(MathML sources not found !!)
1.26 cvs 768: AC_MSG_WARN(Disabling Math build !)
1.10 cvs 769: with_math="no"
770: MATH_OPTIONS=
1.8 cvs 771: fi
772: fi
1.26 cvs 773:
1.68 vatton 774: if test ! -f $srcdir/amaya/SVG.S ; then
775: if test "$with_svg" = "yes" ; then
776: AC_MSG_WARN(SVG sources not found !!)
777: AC_MSG_WARN(Disabling SVG build !)
778: with_svg="no"
779: SVG_OPTIONS=
1.26 cvs 780: fi
781: fi
782:
1.48 cvs 783: if test ! -f $srcdir/annotlib/Makefile.in ; then
1.47 cvs 784: if test "$with_annot" = "yes" ; then
785: AC_MSG_WARN(Annotation makefile not found !!)
786: AC_MSG_WARN(Disabling Annotations build !)
787: with_annot="no"
788: fi
789: fi
1.55 kahan 790:
1.84 kahan 791: dnl if test "$with_annot" = "no" -a "$with_annot_threads" = "yes" ; then
792: dnl AC_MSG_WARN(You must select the annotation support to have threads)
793: dnl AC_MSG_WARN(Disabling annotation thread support)
794: dnl with_annot_threads="no"
795: dnl ANNOT_THREAD_OPTIONS=
796: dnl fi
1.70 kahan 797:
1.55 kahan 798: if test "$with_plugin" = "yes" ; then
799: AC_MSG_WARN(The plugin library isn't supported anymore in Amaya !!)
800: AC_MSG_WARN(Disabling plugin build !)
801: with_plugin="no"
802: fi
803:
1.1 cvs 804: fi
805:
806: dnl
807: dnl The options for each library or binary
808: dnl
809:
1.75 cheyroul 810: THOT_OPTIONS="$GTK_OPTIONS $I18N_OPTIONS $GL_OPTIONS"
811: AMAYA_OPTIONS="$MATH_OPTIONS $SVG_OPTIONS $GTK_OPTIONS $GENERIC_XML_OPTIONS $I18N_OPTIONS $ANNOT_THREAD_OPTIONS $GL_OPTIONS"
1.58 cvs 812: #PLUGIN_OPTIONS="-DPLUGIN_TRACE -DXP_UNIX"
1.70 kahan 813: AMAYA_ANNOT_OPTIONS="$ANNOT_THREAD_OPTIONS"
1.1 cvs 814: IMGLIBS="-ljpeg -lpng -lz"
1.3 cvs 815: EXTRA_LIBS=
1.1 cvs 816:
817: dnl
818: dnl Set up the PATHs needed
819: dnl
820:
821: API="\$(THOTDIR)/thotlib/include"
822: VAR="\$(THOTDIR)/thotlib/internals/var"
823: INCL="\$(THOTDIR)/thotlib/internals/h"
824: FUNC="\$(THOTDIR)/thotlib/internals/f"
1.58 cvs 825: if test "${LIBPNG}" = "../libpng.a" ; then
1.52 cvs 826: #there is a modified header file we need
1.1 cvs 827: PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
1.58 cvs 828: fi
829: if test "${LIBJPEG}" = "../libjpeg.a" ; then
830: #there is a modified header file we need
831: JPEGINCL="-I\$(THOTDIR)/libjpeg"
832: fi
1.1 cvs 833:
834: dnl
835: dnl Set up the include variables.
836: dnl
837:
1.61 cvs 838: THOTINCLUDES="-I${API} -I${VAR} -I${INCL} -I${FUNC} ${JPEGINCL} ${PNGINCL}"
1.58 cvs 839: APIINCLUDES=-I${API}
840:
841: if test "${VPATHOPT}" = "" ; then
1.1 cvs 842: VPATHOPT="VPATH"
843: fi
844:
845: dnl
846: dnl Exports the current values of the variables.
847: dnl
848:
849: AC_SUBST(AMAYA_VER)
1.6 cvs 850: AC_SUBST(CEXTRACT_VER)
851: AC_SUBST(CEXTRACT_FLAGS)
1.1 cvs 852:
853: AC_SUBST(THOTINCLUDES)
854: AC_SUBST(APIINCLUDES)
855: AC_SUBST(VPATHOPT)
856:
1.63 vatton 857: AC_SUBST(GTK_OPTIONS)
1.1 cvs 858: AC_SUBST(THOT_OPTIONS)
859: AC_SUBST(AMAYA_OPTIONS)
860: AC_SUBST(PLUGIN_OPTIONS)
1.48 cvs 861: AC_SUBST(AMAYA_ANNOT_OPTIONS)
1.1 cvs 862: AC_SUBST(IMGLIBS)
1.3 cvs 863: AC_SUBST(EXTRA_LIBS)
1.1 cvs 864:
865: dnl
1.48 cvs 866: dnl Include the option Makefile.xxx fragment according to the configure options
1.1 cvs 867: dnl
868:
869: if test "$with_plugin" = "yes" ; then
1.50 cvs 870: AC_SUBST_FILE(plugin_frag)
1.1 cvs 871: plugin_frag=$srcdir/pluginlib/Makefile.plugin
872: else
873: AC_SUBST_FILE(plugin_frag)
874: plugin_frag=/dev/null
875: fi
876:
877: AC_SUBST_FILE(www_frag)
1.49 cvs 878: www_frag=$srcdir/amaya/Makefile.libwww
1.1 cvs 879:
1.50 cvs 880: if test "$with_math" = "no" ; then
1.10 cvs 881: AC_SUBST_FILE(math_frag)
1.50 cvs 882: math_frag=/dev/null
1.8 cvs 883: else
1.10 cvs 884: AC_SUBST_FILE(math_frag)
1.50 cvs 885: math_frag=$srcdir/amaya/Makefile.math
1.8 cvs 886: fi
887:
1.68 vatton 888: if test "$with_svg" = "no" ; then
889: AC_SUBST_FILE(svg_frag)
890: svg_frag=/dev/null
1.26 cvs 891: else
1.68 vatton 892: AC_SUBST_FILE(svg_frag)
893: svg_frag=$srcdir/amaya/Makefile.svg
1.26 cvs 894: fi
895:
1.47 cvs 896: if test "$with_annot" = "yes" ; then
897: AC_SUBST_FILE(annot_frag)
1.48 cvs 898: annot_frag=$srcdir/annotlib/Makefile.annot
1.47 cvs 899: else
900: AC_SUBST_FILE(annot_frag)
901: annot_frag=/dev/null
902: fi
903:
1.16 cvs 904:
1.1 cvs 905: dnl ***************************************************************
906: dnl
907: dnl FINAL STEP : PRODUCE ALL THE MAKEFILES AND CONFIG FILES
908: dnl
909: dnl ***************************************************************
910:
911: EXTRA_MAKEFILE_IN=
1.2 cvs 912: make_output="Makefile Options.orig:Options.in tools/Makefile \
1.1 cvs 913: libjpeg/Makefile libpng/Makefile libpng/zlib/Makefile \
1.2 cvs 914: tools/mkdep/Makefile \
1.1 cvs 915: tools/cextract-1.7/Makefile thotlib/Makefile \
1.5 cvs 916: thotlib/include/Makefile batch/Makefile tablelib/Makefile"
1.1 cvs 917:
918: if test "$build_amaya" = "yes" ; then
1.2 cvs 919:
1.19 cvs 920: make_output="$make_output amaya/Makefile pluginlib/Makefile"
1.2 cvs 921: EXTRA_MAKEFILE_IN="$srcdir/amaya/Makefile.in \
1.27 cvs 922: $srcdir/amaya/Makefile.libwww"
923:
924: if test "$$with_plugin" = "yes" ; then
925: make_output="$make_output pluginlib/Makefile"
926: EXTRA_MAKEFILE_IN="$srcdir/pluginlib/Makefile.in \
1.2 cvs 927: $srcdir/pluginlib/Makefile.plugin"
1.27 cvs 928: fi
1.2 cvs 929:
1.48 cvs 930: if test "$with_annot" = "yes" ; then
931: make_output="$make_output annotlib/Makefile"
932: EXTRA_MAKEFILE_IN="$srcdir/annotlib/Makefile.in"
933: fi
1.1 cvs 934: fi
935:
936: AC_SUBST(EXTRA_MAKEFILE_IN)
1.6 cvs 937: AC_OUTPUT($make_output , [
938: dnl
939: dnl This fragment of shell code is executed after the
940: dnl Makefile(s) dump ...
941: dnl
942:
943: echo timestamp > stamp-h
944:
945: dnl
946: dnl Check for an upgrade in the Options numbers
947: dnl
948:
949: if test -f Options ; then
950: oldversion=`grep Version Options`
951: newversion=`grep Version Options.orig`
952: if test "$oldversion" != "$newversion" ; then
953: echo WARNING : Options files have changed, old options saved to Options.old
954: cp Options Options.old
955: cp Options.orig Options
956: exit 1
957: fi
958: fi
959: ])
1.1 cvs 960:
961: if test "$build_amaya" = "yes" ; then
1.50 cvs 962: echo Amaya configured with libWWW
963: if test "$with_plugin" = "yes" ; then
964: echo Amaya configured with Plugins support
1.8 cvs 965: fi
1.10 cvs 966: if test "$with_math" = "yes" ; then
967: echo Amaya configured with Math support
1.26 cvs 968: fi
1.68 vatton 969: if test "$with_svg" = "yes" ; then
970: echo Amaya configured with SVG support
1.47 cvs 971: fi
972: if test "$with_annot" = "yes" ; then
973: echo Amaya configured with Annotations support
1.70 kahan 974: fi
1.84 kahan 975: dnl if test "$with_annot_threads" = "yes" ; then
976: dnl echo Amaya configured with Annotation threads support
977: dnl fi
1.70 kahan 978: if test "$with_generic_xml" = "yes" ; then
979: echo Amaya configured with generic XML suppport
980: fi
981: if test "$with_i18n" = "yes" ; then
1.82 vatton 982: echo Amaya configured with internationalization suppport
1.75 cheyroul 983: fi
984: if test "$with_gl" = "yes" ; then
985: echo Amaya configured with Opengl Canvas Rendering \(experimental\)
1.1 cvs 986: fi
1.5 cvs 987: fi
988:
989: if test "$no_motif" = yes ; then
1.67 vatton 990: echo "Amaya configured with GTK"
1.76 vatton 991: echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
1.67 vatton 992: else
1.76 vatton 993: if test "$no_motif" = yes ; then
994: echo "Amaya configured without static graphic libraries (libjpeg, libpng)"
995: fi
1.67 vatton 996: if test "$no_motif" = yes ; then
1.5 cvs 997: echo "Motif seems not installed on this machine"
1.61 cvs 998: echo "Amaya need Motif 1.2 or 2.0"
1.5 cvs 999: else
1000: if test "$motif_includes" = "" ; then
1001: echo "Motif includes were not found"
1.61 cvs 1002: echo "Amaya might not compile"
1.5 cvs 1003: echo "Edit your Option file"
1004: else
1005: if test "$motif_libraries" = "" ; then
1006: echo "Motif libraries were not found"
1.61 cvs 1007: echo "Amaya might not compile"
1.5 cvs 1008: echo "Edit your Option file"
1.67 vatton 1009: fi
1.5 cvs 1010: fi
1011: fi
1.1 cvs 1012: fi
1013:
1.78 vatton 1014: echo "Now type \"make\" (GNU make preferably) to build the binaries"
1.48 cvs 1015:
1016:
1017:
1.5 cvs 1018:
Webmaster