File: configure.in

package info (click to toggle)
floater 1.2b1-6
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,612 kB
  • ctags: 1,822
  • sloc: ansic: 16,755; tcl: 4,034; sh: 1,291; makefile: 129
file content (293 lines) | stat: -rwxr-xr-x 8,594 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Copyright (c) 1996 Geoff Pike. 
# All rights reserved. 

# A version of this software is expected to be released under the GNU 
# Public License.  However, this version is very preliminary and is to 
# be modified and redistributed only with prior consent of Geoff Pike. 

# Floater is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

# This software is provided "as is" and comes with absolutely no 
# warranties.  Geoff Pike is not liable for damages under any 
# circumstances.  Support is not provided.  Use at your own risk. 

dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tk installation
dnl	to configure the system for the local environment.

AC_INIT(floater.h)

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

AC_CANONICAL_SYSTEM

#--------------------------------------------------------------------
# Look for include files we need.
#--------------------------------------------------------------------
AC_HAVE_HEADERS(stdlib.h malloc.h string.h)

#--------------------------------------------------------------------
# See if we have a random() library call.  If not, define USE_RAND
#--------------------------------------------------------------------
AC_MSG_CHECKING(for random)
AC_TRY_LINK([#include <stdlib.h>], [random();], have_random=1, have_random=0)
if test "$have_random" = 1 ; then
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
    AC_DEFINE(USE_RAND)
fi

#--------------------------------------------------------------------
#	Check for the existence of various libraries.  The order here
#	is important, so that then end up in the right order in the
#	command line generated by Make.
#--------------------------------------------------------------------
LIBS=""
AC_HAVE_LIBRARY(Xbsd, [LIBS="$LIBS -lXbsd"])
AC_HAVE_LIBRARY(socket, [LIBS="$LIBS -lsocket"])
AC_HAVE_LIBRARY(nsl, [LIBS="$LIBS -lnsl"])
AC_HAVE_LIBRARY(dnet_stub, [LIBS="$LIBS -ldnet_stub"])
AC_SUBST(LIBS)

#--------------------------------------------------------------------
# Find curses
#--------------------------------------------------------------------
AC_ARG_WITH(curses,        --with-curses=path Specify a path for 
curses/ncurses, curses=$withval, curses="none")

CURSES_INCLUDES=""
CURSES_LIB=""

if test "$curses" = "no" ; then
    AC_DEFINE(GUI_ONLY)
elif test "$curses" != "none" ; then
    # a path was given.  first look for ncurses
    if test -d "$curses/include/ncurses" ; then
	CURSES_INCLUDES="-I$curses/include/ncurses"
	if test -r $curses/lib/libncurses.a -o -r $curses/lib/libncurses.so ; then
	    CURSES_LIB="-L$curses/lib -lncurses"
	elif test -r $curses/lib/ncurses/libncurses.a -o -r $curses/lib/ncurses/libncurses.so ; then
	    CURSES_LIB="-L$curses/lib/ncurses -lncurses"
	else
	    AC_MSG_ERROR([can't find libncurses in $curses/lib.  Try running 
configure again with the --with-curses flag])
	fi
    fi

    # a path was given but ncurses wasn't there -- look for curses
    if test -z "$CURSES_INCLUDES" ; then
	if test -r $curses/include/curses.h ; then
	    CURSES_INCLUDES="-I$curses/include"
	fi
	if test -r $curses/lib/libcurses.a -o -r $curses/lib/libcurses.so ; then
	    CURSES_LIB="-L$curses/lib -lcurses"
	fi
    fi
fi

if test "$curses" != "no" -a -z "$CURSES_INCLUDES" ; then
    # we want to uses curses but haven't found the header files
    # yet.  Keep looking...
    AC_CHECK_HEADER(curses.h, , AC_MSG_ERROR([can't find curses.h.  Try 
running configure again with the --with-curses flag]))
fi

if test "$curses" != "no" -a -z "$CURSES_LIB" ; then
    # we want to uses curses but haven't found the library yet.
    AC_CHECK_LIB(ncurses, initscr, CURSES_LIB="-lncurses")
    if test -z "$CURSES_LIB" ; then
	AC_CHECK_LIB(curses, initscr, CURSES_LIB="-lcurses",
		     AC_MSG_ERROR([can't find libcurses.  Try running configure again with 
the --with-curses flag]))
    fi
fi

AC_SUBST(CURSES_INCLUDES)
AC_SUBST(CURSES_LIB)

#--------------------------------------------------------------------
# Find X11 header files and libraries
#--------------------------------------------------------------------
AC_PATH_X

X_INCLUDES="-I$x_includes"
X_LIB="-L$x_libraries -lX11"
AC_SUBST(X_INCLUDES)
AC_SUBST(X_LIB)

#--------------------------------------------------------------------
# Find Tcl/Tk
#--------------------------------------------------------------------

AC_ARG_WITH(tcl,	--with-tcl=path Specify a path for Tcl, tcl=$withval, 
tcl="none")

TCL_INCLUDES="no"

if test "$tcl" = "none" ; then
    AC_CHECK_HEADER(tcl.h, TCL_INCLUDES="")
fi

if test "$TCL_INCLUDES" = "no" ; then
    AC_MSG_CHECKING(for tcl.h)
    places="$tcl/include \
            ../tcl8.0/generic \
            /usr/include \
            /usr/local/include \
            /usr/contrib/include \
            $prefix/include \
            $x_includes"

    for place in $places ; do
        if test -r $place/tcl.h ; then
	    TCL_INCLUDES="-I$place"
            AC_MSG_RESULT($TCL_INCLUDES)
            break
        fi
    done
fi

if test "$TCL_INCLUDES" = "no" ; then
    AC_MSG_RESULT(nope)
    AC_MSG_ERROR([Can't find tcl.h.  Try the --with-tcl option.])
fi

TCL_LIB="no"

if test "$tcl" = "none" ; then
    AC_CHECK_LIB(tcl8.0, Tcl_Init, TCL_LIB="-ltcl8.0")
    if test "$TCL_LIB" = "no" ; then
	AC_CHECK_LIB(tcl80, Tcl_Init, TCL_LIB="-ltcl80")
    fi
fi

if test "$TCL_LIB" = "no" ; then
    AC_MSG_CHECKING(for libtcl)
    places="$tcl/lib \
	    ../tcl8.0/unix \
            /usr/local/lib \
            /usr/lib \
            /usr/contrib/lib \
            $prefix/lib \
            $x_libraries"
    
    for place in $places; do
	if test -r $place/libtcl8.0.so -o -r $place/libtcl8.0.so.1.0 -o -r $place/libtcl8.0.a ; then
	    AC_MSG_RESULT($place/libtcl8.0)
	    TCL_LIB="-L$place -ltcl8.0"
	elif test -r $place/libtcl80.so -o -r $place/libtcl80.so.1.0 -o -r $place/libtcl80.a ; then
	    AC_MSG_RESULT($place/libtcl80)
	    TCL_LIB="-L$place -ltcl80"
	fi

        if test "$TCL_LIB" != "no" ; then
            break
        fi
    done
fi

if test "$TCL_LIB" = "no" ; then
    AC_MSG_RESULT(nope)
    AC_MSG_ERROR([Can't find libtcl.  Try the --with-tcl option.])
fi

AC_ARG_WITH(tk,	--with-tk=path Specify a path for Tk, tk=$withval, tk="none")

TK_INCLUDES="no"

if test "$tk" = "none" ; then
    AC_CHECK_HEADER(tk.h, TK_INCLUDES="")
fi

if test "$TK_INCLUDES" = "no" ; then
    AC_MSG_CHECKING(for tk.h)
    places="$tk/include \
            ../tk8.0/generic \
            /usr/include \
            /usr/local/include \
            /usr/contrib/include \
            $prefix/include \
            $x_includes"

    for place in $places; do
        if test -r $place/tk.h ; then
	    TK_INCLUDES="-I$place"
            AC_MSG_RESULT($TK_INCLUDES)
            break
        fi
    done
fi

if test "$TK_INCLUDES" = "no" ; then
    AC_MSG_RESULT(nope)
    AC_MSG_ERROR([Can't find tk.h.  Try the --with-tk option.])
fi

TK_LIB="no"

if test "$tk" = "none" ; then
    AC_CHECK_LIB(tk8.0, Tk_Init, TK_LIB="-ltk8.0")
    if test "$TK_LIB" = "no" ; then
	AC_CHECK_LIB(tk80, Tk_Init, TK_LIB="-ltk80")
    fi
fi

if test "$TK_LIB" = "no" ; then
    AC_MSG_CHECKING(for libtk)
    places="$tk/lib \
	    ../tk8.0/unix \
            /usr/local/lib \
            /usr/lib \
            /usr/contrib/lib \
            $prefix/lib \
            $x_libraries"
    
    for place in $places; do
	if test -r $place/libtk80.so -o -r $place/libtk80.so.1.0 -o -r $place/libtk80.a ; then
	    AC_MSG_RESULT($place/libtk80)
	    TK_LIB="-L$place -ltk80"
	elif test -r $place/libtk8.0.so -o -r $place/libtk8.0.so.1.0 -o -r $place/libtk8.0.a ; then
	    AC_MSG_RESULT($place/libtk8.0)
	    TK_LIB="-L$place -ltk8.0"
	fi

        if test "$TK_LIB" != "no" ; then
            break
        fi
    done
fi


if test "$TK_LIB" = "no" ; then
    AC_MSG_RESULT(nope)
    AC_MSG_ERROR([Can't find libtk.  Try the --with-tk option.])
fi

AC_SUBST(TCL_INCLUDES)
AC_SUBST(TCL_LIB)
AC_SUBST(TK_INCLUDES)
AC_SUBST(TK_LIB)

#------------------------------------------------------------
# other system dependent things
#------------------------------------------------------------

# XXX this (combined with the hp-specific line below) is a lame hack:
LIBS="$LIBS -ldl"

case "$target" in 
  hppa*-hp-hpux9*)
    # XXX should really check directly in the curses lib for this
    AC_DEFINE(NO_HALFDELAY)
    
    #XXX
    LIBS=`echo $LIBS | sed -e 's/-ldl/-ldld/'`
    ;;
esac

AC_OUTPUT(Makefile)