First work on request queue.
[ir-tcl-moved-to-github.git] / configure.in
1 dnl IR toolkit for tcl/tk
2 dnl (c) Index Data 1995
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.7 1995-07-28 10:28:37 adam Exp $
5 AC_INIT(ir-tcl.h)
6 CC=${CC-cc}
7 AC_SUBST(CC)
8 AC_PROG_RANLIB
9 AC_PROG_INSTALL
10 checkBoth=0
11 AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
12 if test "$tk_checkSocket" = 1; then
13     AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
14 fi
15 if test "$checkBoth" = 1; then
16     tk_oldLibs=$LIBS
17     LIBS="$LIBS -lsocket -lnsl"
18     AC_CHECK_FUNC(accept, , [LIBS=$tk_oldLibs])
19 fi
20 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
21 AC_STDC_HEADERS
22 AC_SUBST(TCLLIB)
23 AC_CHECK_LIB(tcl, Tcl_Eval, tclFound=1, tclFound=0, -lm)
24 if test "$tclFound" = 1; then
25     TCLLIB=-ltcl
26 else
27     TCLLIB=/usr/local/lib/libtcl.a
28 fi
29 AC_SUBST(YAZDIR)
30 AC_SUBST(MOSI)
31 AC_SUBST(MOSILIB)
32 AC_SUBST(MOSIDIR)
33 AC_MSG_CHECKING(for YAZ directory)
34 AC_ARG_WITH(yazdir,[  --with-yazdir           Yaz directory], [YAZDIR=$withval])
35 if test "$YAZDIR" = "yes"; then
36         YAZDIR="../yaz-1.0b"
37 elif test "$YAZDIR" = ""; then
38         YAZDIR="../yaz"
39         for i in ../yaz-1.0b ../yaz-1.0b2 ../yaz-1.0b3 ../yaz-1.0b4 ../yaz-1.0 ../yaz; do
40             if test -d $i; then
41                 YAZDIR=$i
42             fi
43         done
44 fi
45 AC_MSG_RESULT($YAZDIR)
46 if test ! -d $YAZDIR; then
47         AC_MSG_WARN(YAZ directory doesnt exist)
48 fi
49 AC_MSG_CHECKING(for MOSI)
50 AC_ARG_WITH(mosidir, [  --with-mosidir          MOSI directory], [MOSIDIR=$withval])
51 if test "$MOSIDIR" = "yes"; then
52         MOSIDIR="../xtimosi/src"
53 elif test "$MOSIDIR" = ""; then
54         MOSIDIR="../xtimosi/src"
55 fi
56 if test -r ${YAZDIR}/lib/librfc.a; then
57         MOSI=1
58         MOSIDIR=$MOSIDIR
59         MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
60         MOSITELL=yes
61 else
62         MOSI=0
63         MOSIDIR=$MOSIDIR
64         MOSILIB=''
65         MOSITELL=no
66 fi
67 AC_MSG_RESULT($MOSITELL)
68 AC_PATH_X
69 not_really_there=""
70 if test "$no_x" = ""; then
71     if test "$x_includes" = ""; then
72         AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
73     else
74         if test ! -r $x_includes/X11/Intrinsic.h; then
75             not_really_there="yes"
76         fi
77     fi
78 fi
79 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
80     echo checking for X11 header files
81     XINCLUDES="# no special path needed"
82     AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
83     if test "$XINCLUDES" = nope; then
84         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"
85         for i in $dirs ; do
86             if test -r $i/X11/Intrinsic.h; then
87                 XINCLUDES=" -I$i"
88             fi
89         done
90     fi
91 else
92     if test "$x_includes" != ""; then
93         XINCLUDES=-I$x_includes
94     else
95         XINCLUDES="# no special path needed"
96     fi
97 fi
98 if test "$XINCLUDES" = nope; then
99   echo "Warning:  couldn't find any X11 include files."
100   XINCLUDES="# no include files found"
101 fi
102 AC_SUBST(XINCLUDES)
103 if test "$no_x" = yes; then
104     XLIBSW=nope
105     if test "$XLIBSW" = nope; then
106         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"
107         for i in $dirs ; do
108             if test -r $i/libX11.a; then
109                 XLIBSW="-L$i -lX11"
110             fi
111         done
112     fi
113 else
114     if test "$x_libraries" = ""; then
115         XLIBSW=-lX11
116     else
117         XLIBSW="-L$x_libraries -lX11"
118     fi
119 fi
120 if test "$XLIBSW" = nope ; then
121     AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
122 fi
123 if test "$XLIBSW" = nope ; then
124     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
125     XLIBSW=-lX11
126 fi
127 AC_SUBST(XLIBSW)
128 AC_SUBST(TKLIB)
129 AC_CHECK_LIB(tk, main, tkFound=1, tkFound=0, $TCLLIB $XLIBSW -lm)
130 if test "$tkFound" = 1; then
131     TKLIB=-ltk
132 else
133     TKLIB=/usr/local/lib/libtk.a
134 fi
135 AC_OUTPUT(Makefile)