-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
393 lines (345 loc) · 8.77 KB
/
configure.in
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
#! /bin/sh
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/mosaic.h)
AC_CONFIG_HEADER(config.h)
AC_DEFINE(PRERELEASE)
AC_DEFINE(XMOSAIC)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_PROG(AR, ar, ar)
AC_MSG_CHECKING(for machine dependent stuff)
echo ""
dnl Get system information and then set some flags based on that info
AC_CANONICAL_HOST
machine=''
case "${host}" in
*-linux* )
machine=linux
AC_DEFINE(LINUX)
LIBS="-L/usr/X11R6/lib ${LIBS}"
;;
alpha-*-* )
machine=alpha
;;
*-bsdi* )
;;
*-dec-ultrix* )
machine=dec
AC_DEFINE(BROKEN_MOTIF)
;;
*-dg-dgux* )
machine=dgux
AC_DEFINE(DGUX)
AC_DEFINE(SVR4)
;;
*-hp-hpux* )
machine=hp
AC_DEFINE(_HPUX_SOURCE)
syslibs=-Aa
;;
*-ibm-aix* )
machine=ibm
AC_DEFINE(_BSD)
;;
*-sgi-irix5* )
machine=sgi
AC_DEFINE(MO_IRIX5)
;;
sparc-sun-solaris23 | m68*-sun-solaris23 )
machine=solaris
AC_DEFINE(SVR4)
AC_DEFINE(SOLARIS23)
;;
sparc-sun-solaris24 | m68-sun-solaris24 )
machine=solaris
AC_DEFINE(SVR4)
AC_DEFINE(SOLARIS24)
;;
i[345]86-sun-solaris-2* )
machine=solaris
AC_DEFINE(SVR4)
AC_DEFINE(SOLARIS24X86)
;;
*-sun-sunos* )
machine=sun
AC_DEFINE(SUN)
AC_DEFINE(SVR4)
AC_DEFINE(BROKEN_MOTIF)
;;
*-next-* )
machine=next
AC_DEFINE(NEXT)
;;
esac
dnl Checks for header files.
AC_PATH_X
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h)
dnl Check for regular libs
AC_CHECK_LIB(m, pow)
AC_CHECK_LIB(nsl, gethostname)
AC_CHECK_LIB(gen, regex)
AC_CHECK_LIB(socket, getsockopt)
AC_CHECK_LIB(PW, Freeend)
AC_CHECK_LIB(ipc, ipc_chains)
dnl Checks for X11 libraries.
AC_CHECK_LIB(X11, XSendEvent)
AC_CHECK_LIB(Xpm, _XpmFreeXpmImage)
AC_CHECK_LIB(ICE, IceProcessMessages)
AC_CHECK_LIB(SM, SmcCloseConnection)
AC_CHECK_LIB(Xext, XShapeQueryExtension)
AC_CHECK_LIB(Xt, XtAppMainLoop)
AC_CHECK_LIB(Xmu, _XEditResCheckMessages)
AC_CHECK_LIB(Xm, XmCreatePushButton, [
AC_DEFINE(MOTIF)
LIBS="-lXm ${LIBS}"
])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS(gethostname gethostbyname mkdir socket strftime strstr uname)
dnl Now we try to set up all the external software mosaic uses
dnl as smartly as possible.
AC_MSG_CHECKING(for external software)
echo ""
AC_MSG_CHECKING(for jpeg software)
AC_ARG_WITH(jpegdir,
[ --with-jpegdir=DIR the directory where the built jpeg library resides ],
[
dnl We got a dir make sure we got the header and library
if test -d ${withval} ; then
if test -r ${withval}/libjpeg.a ; then
LIBS="${withval}/libjpeg.a ${LIBS}"
else
if test -r ${withval}/lib/libjpeg.a ; then
LIBS="${withval}/lib/libjpeg.a ${LIBS}"
else
AC_MSG_ERROR(Could not find libjpeg.a in ${withval})
fi
fi
if test -r ${withval}/jpeglib.h ; then
CPPFLAGS="${CPPFLAGS} -I${withval}"
else
if test -r ${withval}/include/jpeglib.h ; then
CPPFLAGS="${CPPFLAGS} -I${withval}/include"
else
AC_MSG_ERROR(Could not find jpeglib.h in ${withval})
fi
fi
else
AC_MSG_RESULT(not)
AC_MSG_ERROR(Couldn't find the specified jpeg dir: ${withval})
fi
dnl Now we think we got it so lets check
AC_TRY_LINK([#include<stdio.h>
#include "jpeglib.h"],
[jpeg_read_raw_data(NULL, NULL, 0)],
[AC_DEFINE(HAVE_JPEG)
AC_MSG_RESULT(found)],
[AC_MSG_RESULT(not found)
AC_MSG_ERROR(Couldn't find jpeg stuff in ${withval})])
],
[
echo ""
echo "Uh oh, you didn't include jpeg. Doing this will greatly"
echo "increase your surfing pleasure. You can get it from these places:"
echo "ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6a.tar.gz"
echo "ftp://ftp.cs.wisc.edu/pub/ghost/jpegsrc.v6a.tar.gz"
echo ""
echo "If you go get it and build it, putting it into mosaic"
echo "is as simple as doing this: "
echo "./configure --with-jpegdir=/dir/where/you/installed/jpeg"
echo ""
echo "or take a look at the config script and edit the jpegdir field."
echo "Then you just run:"
echo "./config"
echo ""
echo "Would you like to configure to stop now so you can go get jpeg?"
echo "(yes or no)"
read ans
case "${ans}" in
"y" | "ye" | "yes")
exit
;;
esac
])
dnl Before we check for png lets make sure we can find libz
AC_MSG_CHECKING(for libz)
dnl We need libz after libpng in the link line but we have to check it
dnl before we check libpng, this variable does the magic
lib_save=${LIBS}
AC_ARG_WITH(zdir,
[ --with-zdir=DIR the directory where the built z library resides ],
[
dnl We got a dir make sure we got the library
if test -d ${withval} ; then
if test -r ${withval}/libz.a ; then
LIBS="${withval}/libz.a ${LIBS}"
libz="${withval}/libz.a"
else
if test -r ${withval}/lib/libz.a ; then
LIBS="${withval}/lib/libz.a ${LIBS}"
libz="${withval}/lib/libz.a"
else
AC_MSG_ERROR(Could not find libz.a in ${withval})
fi
fi
else
AC_MSG_ERROR(Couldn't find the specified zlib dir: ${withval})
fi
dnl Now we think we got it so lets check
AC_TRY_LINK([#include<stdio.h>],
[inflate();],
[AC_DEFINE(HAVE_PNG)
AC_MSG_RESULT(got it)
have_z="yes"],
[AC_MSG_RESULT(not found)
AC_MSG_ERROR(Couldn't find png stuff in ${withval})])
],
[
AC_MSG_RESULT(not)
])
LIBS=${lib_save}
if test "${have_z}" = "yes" ; then
AC_MSG_CHECKING(for png)
AC_ARG_WITH(pngdir,
[ --with-pngdir=DIR the directory where the built png library resides ],
[
dnl We got a dir make sure we got the header and library
if test -d ${withval} ; then
if test -r ${withval}/libpng.a ; then
LIBS="${withval}/libpng.a ${libz} ${LIBS}"
else
if test -r ${withval}/lib/libpng.a ; then
LIBS="${withval}/lib/libpng.a ${libz} ${LIBS}"
else
AC_MSG_ERROR(Could not find libpng.a in ${withval})
fi
fi
if test -r ${withval}/png.h ; then
CPPFLAGS="$CPPFLAGS -I${withval}"
else
if test -r ${withval}/include/png.h ; then
CPPFLAGS="$CPPFLAGS -I${withval}/include"
else
AC_MSG_ERROR(Could not find png.h in ${withval})
fi
fi
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Couldn't find the specified png dir: ${withval})
fi
dnl Now we think we got it so lets check
AC_TRY_LINK([#include<stdio.h>
#include "png.h"],
[png_read_data(NULL, NULL, 0)],
[AC_DEFINE(HAVE_PNG)
AC_MSG_RESULT(got it)
have_png="yes"],
[AC_MSG_RESULT(not found)
AC_MSG_ERROR(Couldn't find png stuff in ${withval})])
],
[
AC_MSG_RESULT(not found)
have_png='no'
])
else
have_png='no'
fi
if test "${have_png}" = "no" ; then
echo ""
echo "Uh oh, you didn't include png. This will allow Mosaic to "
echo "view png images. You can get it here:"
echo "ftp://ftp.uu.net/graphics/png/src"
echo "Before you run out and get it you will also need libz which can be"
echo "found in the same place."
echo ""
echo "If you go get and build these things, putting png support into mosaic"
echo "is as simple as doing this: "
echo "./configure --with-pngdir=/where/you/installed/png --with-zdir=/where/you/installed/zlib"
echo ""
echo "Or you can just fill in the appropriate fields in the config script"
echo "and to this:"
echo "./config"
echo ""
echo "Would you like to configure to stop now so you can go get png/zlib?"
echo "(yes or no)"
read ans
case "${ans}" in
"y" | "ye" | "yes")
exit
;;
esac
fi
dnl AC_ARG_WITH(waisdir,
dnl [ --with-waisdir=DIR the directory where the built wais library resides dnl ],
dnl [ ],
dnl [ ])
dnl AC_ARG_WITH(hdfdir,
dnl [ --with-hdfdir=DIR the directory where the built hdf library resides ],
dnl [ ],
dnl [ ])
dnl dtm support switches
AC_ARG_ENABLE(dtm,
[ --enable-dtm Used to enable dtm support ],
[
if test "${withval}" = "yes" ; then
dtmdirs='libdtm libnet'
else
dtmdirs=''
fi
],
[ dtmdirs='' ])
dnl Figure out what version of Motif we have (XMosaic sucks)
dnl AC_TRY_LINK(
dnl [
dnl ],
dnl [
dnl ],
dnl [
dnl It worked
dnl AC_DEFINE(MOTIF2_0)
dnl ],
dnl [
AC_TRY_LINK(
[
#include<XmStrDefs.h>
],
[
int dummy=XmNpositionIndex;
],
[
AC_DEFINE(MOTIF1_2)
],
[
AC_DEFINE(MOTIF1_1)
])
dnl ])
AC_SUBST(dtmdirs)
for i in libwww2 libhtmlw src libnut libXmx libdtm libnet
do
cd ${i}
if test -f Makefile ; then
cp Makefile Makefile.bak
echo "cp Makefile Makefile.bak"
fi
cd ..
done
AC_OUTPUT(Makefile src/Makefile libhtmlw/Makefile libnut/Makefile libwww2/Makefile libXmx/Makefile)