8556f11e8642e1de6ca63f62938031c440049939
[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.2 1995-06-21 15:16:43 adam Exp $
5 AC_INIT(README)
6 AC_PROG_CC
7 AC_PROG_RANLIB
8 AC_PROG_INSTALL
9 checkBoth=0
10 AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
11 if test "$tk_checkSocket" = 1; then
12     AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
13 fi
14 if test "$checkBoth" = 1; then
15     tk_oldLibs=$LIBS
16     LIBS="$LIBS -lsocket -lnsl"
17     AC_CHECK_FUNC(accept, tk_checkNsl=0, [LIBS=$tk_oldLibs])
18 fi
19 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
20 AC_STDC_HEADERS
21 AC_SUBST(TCLLIB)
22 AC_CHECK_LIB(m, sin)
23 tclFound=0
24 AC_CHECK_LIB(tcl, Tcl_Eval, tclFound=1)
25 if test "$tclFound" = 1; then
26     TCLLIB=-ltcl
27 else
28     TCLLIB=/usr/local/lib/libtcl.a
29 fi
30 AC_SUBST(TKLIB)
31 tkFound=0
32 AC_CHECK_LIB(tk, Tk_MainLoop, tkFound=1,, -ltcl)
33 if test "$tkFound" = 1; then
34     TKLIB=-ltk
35 else
36     TKLIB=/usr/local/lib/libtk.a
37 fi
38 AC_SUBST(YAZDIR)
39 AC_SUBST(MOSI)
40 AC_SUBST(MOSILIB)
41 AC_SUBST(MOSIDIR)
42 AC_MSG_CHECKING(for Yaz directory)
43 AC_ARG_WITH(yazdir,[  --with-yazdir           Yaz directory], [YAZDIR=$withval])
44 if test "$YAZDIR" = "yes"; then
45         YAZDIR="../yaz"
46 elif test "$YAZDIR" = ""; then
47         YAZDIR="../yaz"
48         if test -d "../yaz-1.0b"; then
49                 YAZDIR="../yaz-1.0b"
50         fi
51 fi
52 AC_MSG_RESULT($YAZDIR)
53 if test ! -d $YAZDIR; then
54         AC_MSG_WARN(Yaz directory doesnt exist)
55 fi
56 AC_MSG_CHECKING(for MOSI)
57 AC_ARG_WITH(mosidir, [  --with-mosidir          MOSI directory], [MOSIDIR=$withval])
58 if test "$MOSIDIR" = "yes"; then
59         MOSIDIR="../xtimosi/src"
60 elif test "$MOSIDIR" = ""; then
61         MOSIDIR="../xtimosi/src"
62 fi
63 if test -r ${YAZDIR}/lib/librfc.a; then
64         MOSI=1
65         MOSIDIR=$MOSIDIR
66         MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
67         MOSITELL=yes
68 else
69         MOSI=0
70         MOSIDIR=$MOSIDIR
71         MOSILIB=''
72         MOSITELL=no
73 fi
74 AC_MSG_RESULT($MOSITELL)
75 AC_SUBST(XINCLUDE)
76 AC_SUBST(XLIB)
77 AC_FIND_X
78 if test "x$x_includes" != x; then
79         XINCLUDE=-I$x_includes
80 else
81         XINCLUDE=""
82 fi
83 if test "x$x_libraries" != x; then
84         XLIB=-L$x_libraries
85 else
86         XLIB=""
87 fi
88 AC_OUTPUT(Makefile)