File: configure.in

package info (click to toggle)
xpuzzles 5.4.3-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 3,576 kB
  • ctags: 3,879
  • sloc: ansic: 34,831; makefile: 1,815; sh: 1,526
file content (438 lines) | stat: -rw-r--r-- 12,207 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
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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
dnl Process this file with autoconf to produce a configure script.
dnl configure.in for xpuzzles.
AC_INIT()

dnl Checks for programs.
AC_ARG_WITH(gcc,
[  --with-gcc              use GCC to compile])
dnl AC_ARG_WITH(debug,
dnl [  --with-debug            compile with -g, if no optimize])

test -n "$CC" && cc_specified=yes
case ${with_gcc} in
  yes ) CC=gcc ;;
dnl yes ) CC=g++ ;;
  no  ) CC=cc ;;
  *   ) AC_PROG_CC;;
dnl  *   ) AC_PROG_CXX ;;
esac

dnl case ${with_debug} in
dnl   yes ) CFLAGS="${CFLAGS} -g" ;;
dnl   no ) CFLAGS="${CFLAGS} -O" ;;
dnl esac

if test "${CC}" = "gcc" ; then
  CFLAGS="${CFLAGS} -Wall"
fi

AC_PROG_LN_S
AC_PROG_CPP
AC_AIX
AC_PROG_INSTALL
dnl Optional features.
dnl add copious amounts of debugging with gcc

dnl Checks for header files.
dnl AC_HEADER_STDC /* If its not ansi, its not going to go */
dnl AC_CHECK_HEADERS(poll.h sys/poll.h)
AC_CHECK_HEADERS(fcntl.h sys/select.h sys/time.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.
dnl AC_CHECK_FUNCS(select)

dnl Now we handle the various system dependant problems
dnl that aren't addressed in the X header files, or things dealing
dnl with utility quirks on some systems.
AC_CANONICAL_HOST
canonical=$host
case "${canonical}" in

  *-*-aix* )
    case "${canonical}" in
      *-*-aix2* | *-*-aix3.0* | *-*-aix3.1* )
        AC_DEFINE(LESS_THAN_AIX3_2)
      ;;
    esac
  ;;

  *-*-freebsd* | *-*-netbsd* | *-*-openbsd* )
  ;;

  *-*-hpux* )
    if test "${CC}" = "cc" ; then
      CFLAGS="${CFLAGS} -Aa -z -D_HPUX_SOURCE"
      GPROF_CFLAGS="${GPROF_CFLAGS} -Aa -z -D_HPUX_SOURCE"
    fi
  ;;

  *-*-irix5* | *-*-irix6* )
    if test "${CC}" = "cc" ; then
      CFLAGS="${CFLAGS} -fullwarn"
    fi
  ;;

  *-*-linux* )
    CFLAGS="${CFLAGS} -ansi -pedantic"
    AC_DEFINE(linux)
    AC_DEFINE(_POSIX_SOURCE)
    AC_DEFINE(_BSD_SOURCE)
    AC_DEFINE(_GNU_SOURCE)
  ;;

  *-*-solaris2* )
    AC_DEFINE(SYSV)
    AC_DEFINE(SVR4)
    LIBS="${LIBS} -lsocket -lnsl -lposix4"
  ;;

esac

dnl X Window System files.
AC_PATH_XTRA
if test "$no_x" = yes; then
  XLIBS=NONE
else
  if test -n "${x_includes}"; then
    XWIDGETINC="-I${x_includes} ${XWIDGETINC}"
    XMWIDGETINC="-I${x_includes} ${XMWIDGETINC}"
  fi
  XLIBS="${x_libraries}"
  if test -n "${x_libraries}"; then
    XWIDGETLIBPATHS="-L${x_libraries} ${XWIDGETLIBPATHS}"
    XMWIDGETLIBPATHS="-L${x_libraries} ${XMWIDGETLIBPATHS}"
  fi
  LIBS="${X_PRE_LIBS} -lXt -lX11 ${X_EXTRA_LIBS} ${LIBS}"
dnl AC_DEFINE(X11) /* If there is no X, its not going to go */
fi

dnl Xm MOTIF Motif motif

AC_DEFUN(AC_PATH_MOTIF_DIRECT,
[test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
  for ac_dir in               \
    /usr/include/Motif1.2     \
    /usr/Motif1.2/include     \
                              \
    /usr/motif/include        \
                              \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X11/include          \
    /usr/include/X11          \
    /usr/local/X11/include    \
    /usr/local/include/X11    \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/dt/include           \
                              \
    /usr/local/include        \
    /usr/include              \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
    ; \
  do
    if test -r "$ac_dir/$motif_direct_test_include"; then
      no_motif= ac_motif_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$motif_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
    /usr/lib/Motif1.2     \
    /usr/Motif1.2/lib     \
                          \
    /usr/motif/lib        \
                          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X11/lib          \
    /usr/lib/X11          \
    /usr/local/X11/lib    \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
      no_motif= ac_motif_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN(AC_PATH_MOTIF,
[AC_REQUIRE_CPP()dnl

motif_includes=NONE
motif_libraries=NONE

AC_MSG_CHECKING(for Motif)
AC_ARG_WITH(motif, [  --with-motif            enable Motif tests])
if test "x$with_motif" = xno; then
  no_motif=yes
else
  if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
    no_motif=
  else
AC_CACHE_VAL(ac_cv_path_motif,
[# One or both of these vars are not set, and there is no cached value.
no_motif=yes
AC_PATH_MOTIF_DIRECT

if test "$no_motif" = yes; then
  ac_cv_path_motif="no_motif=yes"
else
  ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_motif"
fi # with_motif != no

if test "$no_motif" = yes; then
  AC_MSG_RESULT(no)
  XMWIDGET=""
  INSTALL_XMWIDGET=""
  UNINSTALL_XMWIDGET=""
else
  XMWIDGETLIBS="-lXm ${LIBS}"
  XMWIDGET="xmpanex"
  INSTALL_XMWIDGET="install_xmpanex"
  UNINSTALL_XMWIDGET="uninstall_xmpanex"
  test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
  test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
  ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
  AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
fi
])

AC_PATH_MOTIF

if test "x$motif_libraries" != x ; then
  XMWIDGETLIBPATHS="-L$motif_libraries ${XMWIDGETLIBPATHS}"
fi
if test "x$motif_includes" != x ; then
  XMWIDGETINC="${XMWIDGETINC} -I$motif_includes"
fi

dnl Xmu EDITRES Editres editres

AC_DEFUN(AC_PATH_EDITRES_DIRECT,
[test -z "$editres_direct_test_library" && editres_direct_test_library=Xmu
test -z "$editres_direct_test_function" && editres_direct_test_function=_XEditResCheckMessages
test -z "$editres_direct_test_include" && editres_direct_test_include=X11/Xmu/Editres.h
  for ac_dir in               \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
    /usr/X11/include          \
                              \
    /usr/include/X11          \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11/include    \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include      \
                              \
    /usr/local/include        \
    /usr/include              \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
                              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    ; \
  do
    if test -r "$ac_dir/$editres_direct_test_include"; then
      no_editres= ac_editres_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$editres_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_editres_includes" | sed s/include/lib/` \
                          \
    /usr/X11/lib          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    /lib/usr/lib/X11      \
                          \
    /usr/openwin/lib      \
    /usr/openwin/share/lib \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${editres_direct_test_library}.$ac_extension; then
      no_editres= ac_editres_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN(AC_PATH_EDITRES,
[AC_REQUIRE_CPP()dnl

editres_includes=NONE
editres_libraries=NONE

AC_MSG_CHECKING(for Editres)
AC_ARG_WITH(editres, [  --with-editres          debugger for xmlock])
if test "x$with_editres" = xno; then
  no_editres=yes
else
  if test "x$editres_includes" != xNONE && test "x$editres_libraries" != xNONE; then
    no_editres=
  else
AC_CACHE_VAL(ac_cv_path_editres,
[# One or both of these vars are not set, and there is no cached value.
no_editres=yes
AC_PATH_EDITRES_DIRECT

if test "$no_editres" = yes; then
  ac_cv_path_editres="no_editres=yes"
else
  ac_cv_path_editres="no_editres= ac_editres_includes=$ac_editres_includes ac_editres_libraries=$ac_editres_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_editres"
fi # with_editres != no

if test "$no_editres" = yes; then
  AC_MSG_RESULT(no)
else
  AC_DEFINE(USE_XMU)
  XMWIDGETLIBS="-lXmu ${XMWIDGETLIBS}"
  test "x$editres_includes" = xNONE && editres_includes=$ac_editres_includes
  test "x$editres_libraries" = xNONE && editres_libraries=$ac_editres_libraries
  ac_cv_path_editres="no_editres= ac_editres_includes=$editres_includes ac_editres_libraries=$editres_libraries"
  AC_MSG_RESULT([libraries $editres_libraries, headers $editres_includes])
fi
])

dnl AC_PATH_EDITRES

if test "x$editres_libraries" != x ; then
  XWIDGETLIBPATHS="-L$editres_libraries ${XWIDGETLIBPATHS}"
fi
if test "x$editres_includes" != x ; then
  XMWIDGETINC="${XMWIDGETINC} -I$editres_includes"
fi

dnl

AC_CHECK_FUNC(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
AC_CHECK_FUNC(usleep, AC_DEFINE(HAVE_USLEEP)))

XWIDGETLIBS="${XWIDGETLIBPATHS} ${LIBS} -lm"
XMWIDGETLIBS="${XMWIDGETLIBPATHS} ${XMWIDGETLIBS}"
AC_SUBST(XWIDGETINC)
AC_SUBST(XMWIDGETINC)
AC_SUBST(XLIBS)
AC_SUBST(XWIDGETLIBS)
AC_SUBST(XMWIDGETLIBS)
AC_SUBST(XMWIDGET)
AC_SUBST(INSTALL_XMWIDGET)
AC_SUBST(UNINSTALL_XMWIDGET)
AC_SUBST(LINT)

dnl AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)