1 dnl IR toolkit for tcl/tk
2 dnl (c) Index Data 1996
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.18 1996-07-26 09:15:09 adam Exp $
7 dnl ------ Substitutions
18 dnl ------ Preliminary settings
20 AC_PREFIX_PROGRAM(tclsh)
22 if test "$ac_cv_header_stdc" = no; then
23 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
25 dnl ------ look for YAZ/XTImOSI
26 AC_MSG_CHECKING(for YAZ directory)
27 AC_ARG_WITH(yazdir,[ --with-yazdir Yaz directory], [YAZDIR=$withval])
28 if test "$YAZDIR" = "yes"; then
30 elif test "$YAZDIR" = ""; then
31 for i in ../yaz* ../yaz; do
37 if test ! -d $YAZDIR; then
38 AC_MSG_WARN(YAZ directory ${YAZDIR} doesn't exist)
40 AC_MSG_RESULT($YAZDIR)
42 AC_MSG_CHECKING(for MOSI)
43 AC_ARG_WITH(mosidir, [ --with-mosidir MOSI directory], [MOSIDIR=$withval])
44 if test "$MOSIDIR" = "yes"; then
45 MOSIDIR="../xtimosi/src"
46 elif test "$MOSIDIR" = ""; then
47 MOSIDIR="../xtimosi/src"
49 if test -r ${YAZDIR}/lib/librfc.a; then
52 MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
53 MOSIINC='-I$(MOSIDIR)'
58 MOSILIB='# $(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
59 MOSIINC='# -I$(MOSIDIR)'
62 AC_MSG_RESULT($MOSITELL)
63 dnl ------ look for Tcl
64 if test "x$prefix" = xNONE; then
69 if test -r ${tryprefix}/lib/tclConfig.sh; then
70 AC_MSG_CHECKING(for Tcl)
71 source ${tryprefix}/lib/tclConfig.sh
72 TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}"
73 TCLINC=-I${TCL_PREFIX}/include
75 AC_MSG_RESULT($TCL_VERSION)
79 AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
80 if test "$tk_checkSocket" = 1; then
81 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
83 if test "$checkBoth" = 1; then
85 LIBS="$LIBS -lsocket -lnsl"
86 AC_CHECK_FUNC(accept, , [LIBS=$tk_oldLibs])
88 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
89 AC_MSG_CHECKING(for Tcl)
91 for i in "" 7.4 7.5; do
92 if test -r ${tryprefix}/lib/libtcl${i}.a; then
96 if test "$TCL_VERSION" = nope; then
97 AC_MSG_WARN(Didn't find Tcl)
99 TCLINC=" # -I.. Tcl/Tk include path"
101 if test "$TCL_VERSION" = ""; then
104 AC_MSG_RESULT($TCL_VERSION)
106 TCL_LIB_SPEC=${tryprefix}/lib/libtcl${TCL_VERSION}.a
107 TCLINC=-I${tryprefix}/include
109 TCLLIB="${TCL_LIB_SPEC} ${LIBS} -lm"
111 dnl ------ look for Tk
112 if test -r ${tryprefix}/lib/tkConfig.sh; then
113 AC_MSG_CHECKING(for Tk)
114 source ${tryprefix}/lib/tkConfig.sh
115 AC_MSG_RESULT($TK_VERSION)
116 TKINC=${TK_XINCLUDES}
117 TKLIB="${TK_PREFIX}/lib/${TK_LIB_FILE} ${TCL_LIB_SPEC} ${TK_LIBS}"
119 AC_MSG_CHECKING(for Tk)
121 for i in "" 4.0 4.1; do
122 if test -r ${tryprefix}/lib/libtk${i}.a; then
126 if test "$TK_VERSION" = nope; then
127 AC_MSG_WARN(Didn't find Tk)
130 TKLIB=${tryprefix}/lib/libtk${TK_VERSION}.a
131 if test "$TK_VERSION" = ""; then
134 AC_MSG_RESULT($TK_VERSION)
137 TKLIB=${tryprefix}/lib/libtk${TK_VERSION}.a
140 if test "$no_x" = ""; then
141 if test "$x_includes" = ""; then
142 AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
144 if test ! -r $x_includes/X11/Intrinsic.h; then
145 not_really_there="yes"
149 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
150 echo checking for X11 header files
151 XINCLUDES="# no special path needed"
152 AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
153 if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include"
155 if test -r $i/X11/Intrinsic.h; then
161 if test "$x_includes" != ""; then
162 XINCLUDES=-I$x_includes
164 XINCLUDES="# no special path needed"
167 if test "$XINCLUDES" = nope; then
168 echo "Warning: couldn't find any X11 include files."
169 XINCLUDES="# no include files found"
171 if test "$no_x" = yes; then
173 if test "$XLIBSW" = nope; then
174 dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
176 if test -r $i/libX11.a; then
182 if test "$x_libraries" = ""; then
185 XLIBSW="-L$x_libraries -lX11"
188 if test "$XLIBSW" = nope ; then
189 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
191 if test "$XLIBSW" = nope ; then
192 echo "Warning: couldn't find the X11 library archive. Using -lX11."
196 TKLIB="${TKLIB} ${XLIBSW} ${TCLLIB}"