Removed lines and list as synonyms of list in MARC extractron.
[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.9 1995-08-28 12:21:21 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 elif test -r /usr/local/lib/libtcl7.4.a; then
27     TCLLIB=/usr/local/lib/libtcl7.4.a
28 else
29     TCLLIB=/usr/local/lib/libtcl.a
30 fi
31 AC_SUBST(YAZDIR)
32 AC_SUBST(MOSI)
33 AC_SUBST(MOSILIB)
34 AC_SUBST(MOSIDIR)
35 AC_MSG_CHECKING(for YAZ directory)
36 AC_ARG_WITH(yazdir,[  --with-yazdir           Yaz directory], [YAZDIR=$withval])
37 if test "$YAZDIR" = "yes"; then
38         YAZDIR="../yaz-1.0b3"
39 elif test "$YAZDIR" = ""; then
40         YAZDIR="../yaz"
41         for i in ../yaz-1.0b3 ../yaz-1.0b4 ../yaz-1.0 ../yaz; do
42             if test -d $i; then
43                 YAZDIR=$i
44             fi
45         done
46 fi
47 AC_MSG_RESULT($YAZDIR)
48 if test ! -d $YAZDIR; then
49         AC_MSG_WARN(YAZ directory doesnt exist)
50 fi
51 AC_MSG_CHECKING(for MOSI)
52 AC_ARG_WITH(mosidir, [  --with-mosidir          MOSI directory], [MOSIDIR=$withval])
53 if test "$MOSIDIR" = "yes"; then
54         MOSIDIR="../xtimosi/src"
55 elif test "$MOSIDIR" = ""; then
56         MOSIDIR="../xtimosi/src"
57 fi
58 if test -r ${YAZDIR}/lib/librfc.a; then
59         MOSI=1
60         MOSIDIR=$MOSIDIR
61         MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
62         MOSITELL=yes
63 else
64         MOSI=0
65         MOSIDIR=$MOSIDIR
66         MOSILIB=''
67         MOSITELL=no
68 fi
69 AC_MSG_RESULT($MOSITELL)
70 AC_PATH_X
71 not_really_there=""
72 if test "$no_x" = ""; then
73     if test "$x_includes" = ""; then
74         AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
75     else
76         if test ! -r $x_includes/X11/Intrinsic.h; then
77             not_really_there="yes"
78         fi
79     fi
80 fi
81 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
82     echo checking for X11 header files
83     XINCLUDES="# no special path needed"
84     AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
85     if test "$XINCLUDES" = nope; then
86         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"
87         for i in $dirs ; do
88             if test -r $i/X11/Intrinsic.h; then
89                 XINCLUDES=" -I$i"
90             fi
91         done
92     fi
93 else
94     if test "$x_includes" != ""; then
95         XINCLUDES=-I$x_includes
96     else
97         XINCLUDES="# no special path needed"
98     fi
99 fi
100 if test "$XINCLUDES" = nope; then
101   echo "Warning:  couldn't find any X11 include files."
102   XINCLUDES="# no include files found"
103 fi
104 AC_SUBST(XINCLUDES)
105 if test "$no_x" = yes; then
106     XLIBSW=nope
107     if test "$XLIBSW" = nope; then
108         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"
109         for i in $dirs ; do
110             if test -r $i/libX11.a; then
111                 XLIBSW="-L$i -lX11"
112             fi
113         done
114     fi
115 else
116     if test "$x_libraries" = ""; then
117         XLIBSW=-lX11
118     else
119         XLIBSW="-L$x_libraries -lX11"
120     fi
121 fi
122 if test "$XLIBSW" = nope ; then
123     AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
124 fi
125 if test "$XLIBSW" = nope ; then
126     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
127     XLIBSW=-lX11
128 fi
129 AC_SUBST(XLIBSW)
130 AC_SUBST(TKLIB)
131 AC_CHECK_LIB(tk, main, tkFound=1, tkFound=0, $TCLLIB $XLIBSW -lm)
132 if test "$tkFound" = 1; then
133     TKLIB=-ltk
134 elif test -r /usr/local/lib/libtk4.0.a; then
135     TKLIB=/usr/local/lib/libtk4.0.a
136 else
137     TKLIB=/usr/local/lib/libtk.a
138 fi
139 AC_OUTPUT(Makefile)