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
|
dnl
dnl
AC_INIT
AM_INIT_AUTOMAKE(gpsd, 1.96)
AC_PREFIX_PROGRAM(gcc)
AM_CONFIG_HEADER(config.h)
AC_LANG([C])
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LIBTOOL
CFLAGS="$CFLAGS -Wall -Werror"
AC_CHECK_HEADERS(termio.h sys/param.h termios.h sys/termios.h sys/select.h strings.h path.h sys/filio.h sys/time.h)
dnl
dnl Locate Net Libraries
dnl
AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl")
AC_SUBST(LIBNSL)
dnl
AC_CHECK_LIB(socket, socket, LIBSOCKET="-lsocket")
AC_SUBST(LIBSOCKET)
dnl
dnl
dnl
dnl Locate Libraries
dnl
AC_MSG_CHECKING(whether to force -lm switch)
AC_TRY_LINK([#include <math.h>],
{ double foo; foo = sin(1.234); },
link_libm=0, link_libm=1)
if test $link_libm = 1; then
AC_MSG_RESULT(yes)
LIBM="-lm"
AC_SUBST(LIBM)
else
AC_MSG_RESULT(no)
fi
dnl
AC_CHECK_LIB(c, open, LIBC="-lc")
AC_SUBST(LIBC)
dnl
AC_CHECK_LIB(gen, regcmp, LIBGEN="-lgen")
AC_SUBST(LIBGEN)
dnl
dnl
dnl
dnl
dnl Check for X stuff
dnl
dnl
dnl Check X options
dnl
if test "$with_x" = no; then
AC_MSG_WARN([Some of this software requires the X window system to compile and run.
Please do not use the configure option '--without-x'.])
fi
if test "$with_motif" = no; then
AC_MSG_WARN([Some of this software requires Motif to compile and run.
Please do not use the configure option '--without-motif'.])
fi
dnl
dnl
dnl Check for X libraries
dnl
if test "$with_x" != no; then
ice_save_LIBS="$LIBS"
ice_save_CFLAGS="$CFLAGS"
ice_save_CPPFLAGS="$CPPFLAGS"
ice_save_LDFLAGS="$LDFLAGS"
dnl
AC_PATH_XTRA
ICE_FIND_MOTIF
ICE_FIND_ATHENA
ICE_FIND_XPM
dnl
dnl Autoconf bug fix: Sun CC 3.0 requires `-R lib', g++ requires `-Rlib'.
changequote(,)dnl
case "$CXX" in
*CC) X_LIBS="`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`"
esac
changequote([,])dnl
dnl
dnl
dnl
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
dnl
dnl Check for X library
dnl
X11_LIBS=""
AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X may be fatal. Let the user fix this.
AC_MSG_WARN([The X11 library '-lX11' could not be found.
Please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
fi
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(X_PRE_LIBS)
dnl
dnl
dnl Check for -lXintl library. Lutz Kittler <kittler@sse-erfurt.de> says
dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'.
dnl Guenther Roehrich <guenther@studbox.uni-stuttgart.de> says that
dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'.
dnl
AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",,
${X_PRE_LIBS} ${X11_LIBS})
dnl
dnl
dnl Check for -lipc library. SCO unix is said to want that.
dnl
AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",,
${X_PRE_LIBS} ${X11_LIBS})
dnl
dnl
dnl Check for X toolkit libraries
dnl
XT_LIBS=""
AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",,
${X_PRE_LIBS} ${X11_LIBS})
if test "$XT_LIBS" = ""; then
dnl Not having Xt is fatal. Let the user fix this.
AC_MSG_WARN([The X toolkit library '-lXt' could not be found.
Please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
fi
AC_SUBST(XT_LIBS)
dnl
dnl
dnl Check for Xaw libraries
dnl
XAW_LIBS=""
AC_CHECK_LIB(Xaw, XawInitializeWidgetSet, XAW_LIBS="-lXaw",,
${X_PRE_LIBS} ${X11_LIBS})
if test "$XAW_LIBS" = ""; then
dnl Not having Xaw is fatal. Let the user fix this.
AC_MSG_WARN([The Xaw library '-lXaw' could not be found.
Please use the configure options '--x-includes=DIR'
and '--x-libraries=DIR' to specify the X location.
See the file 'config.log' for further diagnostics.])
fi
AC_SUBST(XAW_LIBS)
dnl
dnl
dnl Check for X extension libraries
dnl
dnl
XEXT_LIBS=""
AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",,
${X_PRE_LIBS} ${X11_LIBS})
AC_SUBST(XEXT_LIBS)
dnl
dnl
dnl
dnl
dnl Check for Xpm library and headers
dnl
XPM_LIBS=""
AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage,
XPM_LIBS="-lXpm"
AC_DEFINE([HAVE_XPM],1,[Xpm available]),,${X_PRE_LIBS} ${X11_LIBS})
if test "$XPM_LIBS" != ""; then
AC_CHECK_HEADERS(X11/xpm.h xpm.h)
fi
AC_SUBST(XPM_LIBS)
dnl
dnl
dnl Check for Motif widget libraries
dnl
dnl
XM_LIBS=""
XP_LIBS=""
if test "$motif_includes" != "no" && test "$motif_libraries" != "no"
then
dnl Motif 2.1 wants `-lXp' (X11R6.3 print server)
AC_CHECK_LIB(Xp, XpSelectInput,
XP_LIBS="-lXp"
AC_DEFINE([HAVE_XP],1,[Xp available]),,
${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, XmCreateOptionMenu,
XM_LIBS="-lXm"
AC_DEFINE([HAVE_MOTIF],1,[Motif available]),,
${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
fi
if test "$XM_LIBS" = ""; then
dnl Without Motif, we won't get far. Let the user fix this.
AC_MSG_WARN([The Motif library '-lXm' could not be found.
Please use the configure options '--with-motif-includes=DIR'
and '--with-motif-libraries=DIR' to specify the Xm location.
See the file 'config.log' for further diagnostics.])
MISSING_MOTIF="# "
AC_SUBST(MISSING_MOTIF)
fi
AC_SUBST(XP_LIBS)
AC_SUBST(XM_LIBS)
dnl
dnl
dnl
dnl
LIBS="$ice_save_LIBS"
CFLAGS="$ice_save_CFLAGS"
CPPFLAGS="$ice_save_CPPFLAGS"
LDFLAGS="$ice_save_LDFLAGS"
fi
AC_C_BIGENDIAN
AC_DEFINE(EARTHMATE_ENABLE, 1, [Earthmate support])
AC_OUTPUT(Makefile gpsd.spec)
(echo "# Generated from gpsd.spec.in, do not handhack!"; cat gpsd.spec) >gpsd.tmp.$$
mv gpsd.tmp.$$ gpsd.spec
|