~ubuntu-branches/ubuntu/trusty/libgii/trusty

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Martin Albert
  • Date: 2001-08-27 23:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20010827231732-5kiieyxb3mvj25ur
Tags: upstream-0.8.1
ImportĀ upstreamĀ versionĀ 0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl $Id: configure.in,v 1.9 2001/08/23 12:39:51 soyt Exp $
 
2
dnl Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ(2.13)
 
5
 
 
6
AC_INIT(input/stdin/input.c)
 
7
 
 
8
AM_INIT_AUTOMAKE(libgii,0.8.1,-)
 
9
 
 
10
AM_MAINTAINER_MODE
 
11
AM_DISABLE_STATIC
 
12
 
 
13
dnl ========================================================================
 
14
dnl Set some defaults
 
15
 
 
16
PATHTAG="pAtHTAg"
 
17
TAGLEN="7"
 
18
gii_conffile="libgii.conf"
 
19
ggi_subdir="ggi"
 
20
 
 
21
use_debug="yes"
 
22
use_memdebug="no"
 
23
 
 
24
have_pthreads="no"
 
25
use_pthreads="no"
 
26
use_dlpthreads="yes"
 
27
mutextype="builtin"
 
28
 
 
29
GGDLLIBS=""
 
30
SELECTLIBS=""
 
31
NETLIBS=""
 
32
DEMOS=""
 
33
INPUTSUBDIRS=""
 
34
FILTERSUBDIRS=""
 
35
 
 
36
dnl ========================================================================
 
37
dnl Checks for programs.
 
38
 
 
39
AC_PROG_CC
 
40
AC_LIBTOOL_DLOPEN
 
41
AC_LIBTOOL_WIN32_DLL
 
42
AM_PROG_LIBTOOL
 
43
 
 
44
 
 
45
dnl ========================================================================
 
46
dnl User selectable options
 
47
 
 
48
AC_ARG_ENABLE(memdebug,
 
49
[  --enable-memdebug       include memory usage debugging code in LibGG],
 
50
use_memdebug=$enableval)
 
51
 
 
52
AC_ARG_ENABLE(filter_mouse,
 
53
[  --disable-filter-mouse  don't build the mouse filterlib],
 
54
build_mouse_filter=$enableval)
 
55
AC_ARG_ENABLE(filter_keytrans,
 
56
[  --disable-filter-keytrans
 
57
                          don't build the key translation filterlib],
 
58
build_keytrans_filter=$enableval)
 
59
AC_ARG_ENABLE(filter_save,
 
60
[  --disable-filter-save   don't build the save filterlib],
 
61
build_save_filter=$enableval)
 
62
AC_ARG_ENABLE(filter_tcp,
 
63
[  --disable-filter-tcp    don't build the tcp filterlib],
 
64
build_tcp_filter=$enableval)
 
65
AC_ARG_ENABLE(null,
 
66
[  --disable-null          don't build the null inputlib (discouraged - this
 
67
                            is REQUIRED by LibGGI)],
 
68
build_null_input=$enableval)
 
69
AC_ARG_ENABLE(file,
 
70
[  --disable-file          don't build the file inputlib],
 
71
build_file_input=$enableval)
 
72
AC_ARG_ENABLE(tcp,
 
73
[  --disable-tcp           don't build the tcp inputlib],
 
74
build_tcp_input=$enableval)
 
75
AC_ARG_ENABLE(stdin,
 
76
[  --disable-stdin         don't build the stdin inputlib],
 
77
build_stdin_input=$enableval)
 
78
AC_ARG_ENABLE(x,
 
79
[  --disable-x             don't build the x inputlib],
 
80
build_x_input=$enableval)
 
81
AC_ARG_ENABLE(xwin,
 
82
[  --disable-xwin          don't build the xwin inputlib],
 
83
build_xwin_input=$enableval)
 
84
AC_ARG_ENABLE(mouse,
 
85
[  --disable-mouse         don't build the mouse inputlib],
 
86
build_mouse_input=$enableval)
 
87
AC_ARG_ENABLE(linux_mouse,
 
88
[  --disable-linux-mouse   don't build the linux-mouse inputlib],
 
89
build_linux_mouse_input=$enableval)
 
90
AC_ARG_ENABLE(linux_kbd,
 
91
[  --disable-linux-kbd     don't build the linux-kbd inputlib],
 
92
build_linux_kbd_input=$enableval)
 
93
AC_ARG_ENABLE(linux_joy,
 
94
[  --disable-linux-joy     don't build the linux-joy inputlib],
 
95
build_linux_joy_input=$enableval)
 
96
AC_ARG_ENABLE(linux_evdev,
 
97
[  --disable-linux-evdev   don't build the linux-evdev inputlib],
 
98
build_linux_evdev_input=$enableval)
 
99
AC_ARG_ENABLE(spaceorb,
 
100
[  --disable-spaceorb      don't build the spaceorb inputlib],
 
101
build_spaceorb_input=$enableval)
 
102
AC_ARG_ENABLE(vgl,
 
103
[  --disable-vgl           don't build the vgl inputlib],
 
104
build_vgl_input=$enableval)
 
105
AC_ARG_ENABLE(directx,
 
106
[  --disable-directx       don't build the directx inputlib],
 
107
build_directx_input=$enableval)
 
108
AC_ARG_ENABLE(pcjoy,
 
109
[  --enable-pcjoy          build the pcjoy inputlib],
 
110
build_pcjoy_input=$enableval)
 
111
AC_ARG_ENABLE(lk201,
 
112
[  --enable-lk201          build the lk201 DEC serial terminal inputlib],
 
113
build_lk201_input=$enableval)
 
114
 
 
115
AC_ARG_ENABLE(mutexes,
 
116
[  --enable-mutexes=TYPE   force the kind of mutexes to use
 
117
                            (builtin, pthread or dynpthread)],
 
118
mutextype="$enableval")
 
119
AC_ARG_ENABLE(debug,
 
120
[  --disable-debug         build without run-time debugging (speed freaks)],
 
121
use_debug=$enableval)
 
122
 
 
123
GGI_EXTRA_PATHS
 
124
 
 
125
dnl font-lock-mode prettyfier '
 
126
dnl ========================================================================
 
127
dnl Checks for libraries.
 
128
 
 
129
AC_CHECK_LIB(vgl, VGLInit, foo=bar, build_vgl_target="no")
 
130
 
 
131
 
 
132
dnl ========================================================================
 
133
dnl Checks for header files.
 
134
 
 
135
AC_HEADER_STDC
 
136
AC_HEADER_TIME
 
137
AC_CHECK_HEADERS(sys/time.h unistd.h fcntl.h signal.h sched.h sys/types.h \
 
138
        sys/stat.h sys/ioctl.h pthread.h asm/io.h sys/io.h \
 
139
        linux/keyboard.h sys/kd.h sys/vt.h linux/kd.h linux/vt.h \
 
140
        linux/joystick.h linux/input.h linux/kdev_t.h linux/major.h \
 
141
        sys/un.h sys/socket.h netinet/in.h arpa/inet.h netdb.h \
 
142
        termios.h malloc.h vgl.h \
 
143
        windows.h dinput.h \
 
144
        )
 
145
 
 
146
 
 
147
dnl ========================================================================
 
148
dnl Checks for typedefs, structures, and compiler characteristics.
 
149
 
 
150
AC_C_CONST
 
151
AC_TYPE_SIZE_T
 
152
AC_STRUCT_ST_RDEV
 
153
AC_C_INLINE
 
154
dnl Hack for cross-compiling to win32
 
155
if test "$CC" = "i386-mingw32-gcc"; then
 
156
  ac_cv_c_bigendian=no
 
157
else
 
158
  AC_C_BIGENDIAN
 
159
fi
 
160
AC_CHECK_SIZEOF(char, 1)
 
161
AC_CHECK_SIZEOF(short, 2)
 
162
AC_CHECK_SIZEOF(int, 4)
 
163
AC_CHECK_SIZEOF(long, 4)
 
164
AC_CHECK_SIZEOF(long long, 8)
 
165
dnl Not supported by new libtool
 
166
dnl AM_SYS_SYMBOL_UNDERSCORE
 
167
 
 
168
if test "x$cross_compiling" = "xyes"; then
 
169
  AC_MSG_WARN([
 
170
  You are using a cross-compiler, please set the SIZEOF_* defines in config.h
 
171
  properly before compiling this package. Also check that the typedefs and
 
172
  defines in include/ggi/system.h are correct.
 
173
])
 
174
fi
 
175
 
 
176
if test "$ac_cv_header_sys_time_h" = "yes"; then
 
177
  TIMEVAL_INCLUDE='#include <sys/time.h>'
 
178
else
 
179
  TIMEVAL_INCLUDE='#include <time.h>'
 
180
fi
 
181
 
 
182
if test "$ac_cv_sizeof_int" = "1"; then
 
183
  GGI_8="int"
 
184
elif test "$ac_cv_sizeof_char" = "1"; then
 
185
  GGI_8="char"
 
186
elif test "$ac_cv_sizeof_short" = "1"; then
 
187
  GGI_8="short"
 
188
else
 
189
  AC_MSG_ERROR(No 8-bit datatype on this system???)
 
190
fi
 
191
 
 
192
if test "$ac_cv_sizeof_int" = "2"; then
 
193
  GGI_16="int"
 
194
elif test "$ac_cv_sizeof_char" = "2"; then
 
195
  GGI_16="char"
 
196
elif test "$ac_cv_sizeof_short" = "2"; then
 
197
  GGI_16="short"
 
198
elif test "$ac_cv_sizeof_long" = "2"; then
 
199
  GGI_16="long"
 
200
else
 
201
  AC_MSG_ERROR(No 16-bit datatype on this system???)
 
202
fi
 
203
 
 
204
if test "$ac_cv_sizeof_int" = "4"; then
 
205
  GGI_32="int"
 
206
elif test "$ac_cv_sizeof_long" = "4"; then
 
207
  GGI_32="long"
 
208
elif test "$ac_cv_sizeof_char" = "4"; then
 
209
  GGI_32="char"
 
210
elif test "$ac_cv_sizeof_short" = "4"; then
 
211
  GGI_32="short"
 
212
elif test "$ac_cv_sizeof_long_LONG" = "4"; then
 
213
  GGI_32="long long"
 
214
else
 
215
  AC_MSG_ERROR(No 32-bit datatype on this system???)
 
216
fi
 
217
 
 
218
if test "x$ac_cv_c_bigendian" = "xyes"; then 
 
219
  GGI_ENDIAN="#define GGI_BIG_ENDIAN            1"
 
220
else
 
221
  GGI_ENDIAN="#define GGI_LITTLE_ENDIAN         1"
 
222
fi
 
223
 
 
224
AC_MSG_CHECKING([for TIOCMSET in termios.h or sys/ioctl.h])
 
225
AC_EGREP_CPP(giitiocmset,
 
226
[#include <sys/ioctl.h>
 
227
#include <termios.h>
 
228
#ifdef TIOCMSET
 
229
  giitiocmset
 
230
#endif
 
231
], HAVE_TIOCMSET=yes; AC_DEFINE(HAVE_TIOCMSET), HAVE_TIOCMSET=no)
 
232
AC_MSG_RESULT($HAVE_TIOCMSET)
 
233
 
 
234
GGI_DLLEXT
 
235
 
 
236
 
 
237
dnl ========================================================================
 
238
dnl Checks for library functions.
 
239
 
 
240
dnl Must undefine select here :-(
 
241
unset ac_cv_func_select
 
242
AC_CHECK_FUNCS(select pipe dlopen fcntl signal sigaction readlink sched_yield \
 
243
        inet_aton)
 
244
 
 
245
dnl Functions of the form func(num), func(pointer) or func(pointer,pointer)
 
246
dnl should go here instead of above.
 
247
 
 
248
AC_CHECK_WINFUNCS(gettimeofday strdup nanosleep usleep _exit \
 
249
        Sleep GetSystemTime)
 
250
 
 
251
 
 
252
USLEEP_INCLUDE1=""
 
253
if test "x$ac_cv_func_usleep" = "xyes"; then
 
254
  GG_USLEEP="#define ggUSleep(val)      usleep((unsigned int)(val))"
 
255
  if test "x$ac_cv_header_unistd_h" = "xyes"; then
 
256
    USLEEP_INCLUDE1="#include <unistd.h>"
 
257
  fi
 
258
  AC_DEFINE(GG_USLEEP_DEFINED)
 
259
elif test "x$ac_cv_func_Sleep" = "xyes"; then
 
260
  GG_USLEEP="#define ggUSleep(val)      Sleep((unsigned int)((val)/1000))"
 
261
  if test "x$ac_cv_header_windows_h" = "xyes"; then
 
262
    USLEEP_INCLUDE1="#include <windows.h>"
 
263
  fi
 
264
  AC_DEFINE(GG_USLEEP_DEFINED)
 
265
elif test "x$ac_cv_func_select" = "xyes"; then
 
266
  GG_USLEEP="#define ggUSleep(val) do {struct timeval tv; \
 
267
tv.tv_sec=(val)/1000000; tv.tv_usec=(val)%1000000; \
 
268
select(0, NULL, NULL, NULL, &tv);} while(0);"
 
269
  if test "x$ac_cv_header_sys_types_h" = "xyes"; then
 
270
    USLEEP_INCLUDE1="#include <sys/types.h>"
 
271
  fi
 
272
  if test "x$ac_cv_header_unistd_h" = "xyes"; then
 
273
    USLEEP_INCLUDE2="#include <unistd.h>"
 
274
  fi
 
275
  AC_DEFINE(GG_USLEEP_DEFINED)
 
276
else
 
277
  GG_USLEEP="void ggUSleep(unsigned int);"
 
278
fi
 
279
 
 
280
if test "x$ac_cv_func_gettimeofday" = "xyes"; then
 
281
  GG_CURTIME="#define ggCurTime(tv)     gettimeofday((tv), NULL)"
 
282
  AC_DEFINE(GG_CURTIME_DEFINED)
 
283
elif test "x$ac_cv_func_GetSystemTime" = "xyes"; then
 
284
  GG_CURTIME="#define ggCurTime(tv)     do{ SYSTEMTIME stim; \
 
285
        GetSystemTime(&stim); \
 
286
        (tv)->tv_sec = stim.wSecond; \
 
287
        (tv)->tv_usec = stim.wMilliseconds*1000; }while(0)"
 
288
  AC_DEFINE(GG_CURTIME_DEFINED)
 
289
else
 
290
  GG_CURTIME="void ggCurTime(struct timeval *);"
 
291
fi
 
292
 
 
293
if test "x$ac_cv_func_select" = "xno"; then
 
294
  AC_MSG_CHECKING([for select in -lwsock32])
 
295
  SAVELIBS="$LIBS"
 
296
  LIBS="$LIBS -lwsock32"
 
297
  AC_TRY_LINK([
 
298
#include <winsock.h>
 
299
],[
 
300
select(1, NULL, NULL, NULL, NULL);
 
301
],
 
302
    SELECTLIBS="$SELECTLIBS -lwsock32"
 
303
    NETLIBS="$NETLIBS -lwsock32"
 
304
    ac_cv_func_select=yes
 
305
    AC_MSG_RESULT(yes),
 
306
    AC_MSG_RESULT(no))
 
307
  LIBS="$SAVELIBS"
 
308
fi
 
309
 
 
310
if test "x$ac_cv_func_nanosleep" = "xno"; then
 
311
  AC_CHECK_LIB(rt, nanosleep,
 
312
        GGDLLIBS="$GGDLLIBS -lrt"
 
313
        AC_DEFINE(HAVE_NANOSLEEP)
 
314
        ,
 
315
        AC_CHECK_LIB(posix4, nanosleep,
 
316
                GGDLLIBS="$GGDLLIBS -lposix4"
 
317
                AC_DEFINE(HAVE_NANOSLEEP)
 
318
        )
 
319
  )
 
320
fi
 
321
 
 
322
if test "x$ac_cv_func_sched_yield" = "xno"; then
 
323
   AC_CHECK_LIB(posix4, sched_yield,
 
324
        GGDLLIBS="$GGDLLIBS -lposix4"
 
325
        AC_DEFINE(HAVE_SCHED_YIELD))
 
326
fi
 
327
 
 
328
if test "x$ac_cv_func_dlopen" = "xno"; then
 
329
  AC_CHECK_LIB(dl, dlopen, GGDLLIBS="$GGDLLIBS -ldl")
 
330
fi
 
331
 
 
332
if test "$mutextype" != "builtin"; then
 
333
  AC_MSG_CHECKING(for pthread_mutex_init in -lpthread)
 
334
  if test "x$ac_cv_header_pthread_h" = "xyes"; then
 
335
    TMP_SAVE_LIBS="$LIBS"
 
336
    LIBS="$LIBS -lpthread"
 
337
    AC_TRY_RUN([
 
338
#define __C_ASM_H /* fix for retarded Digital Unix headers */
 
339
#include <pthread.h>
 
340
pthread_mutex_t mtex;
 
341
int main(void) {
 
342
if (pthread_mutex_init(&mtex, NULL) == 0) return 0;
 
343
return 1;
 
344
}
 
345
],
 
346
      AC_MSG_RESULT(yes)
 
347
      if test "$mutextype" != "dynpthread"; then
 
348
        AC_MSG_CHECKING(if this system is known to have broken pthread mutexes)
 
349
        if test `uname -s` = "Linux"; then
 
350
          AC_MSG_RESULT(yes)
 
351
          if test "$mutextype" != "pthread"; then
 
352
            mutextype=dynpthread
 
353
          fi
 
354
        else
 
355
          AC_MSG_RESULT(no)
 
356
        fi
 
357
      fi
 
358
      if test "$mutextype" != "dynpthread"; then
 
359
        mutextype=pthread
 
360
        GGDLLIBS="$GGDLLIBS -lpthread"
 
361
      fi
 
362
     ,
 
363
      AC_MSG_RESULT(no)
 
364
      AC_MSG_CHECKING(for pthread_mutex_init in -lc_r)
 
365
      LIBS="$TMP_SAVE_LIBS -lc_r"
 
366
      AC_TRY_RUN([
 
367
#include <pthread.h>
 
368
pthread_mutex_t mtex;
 
369
int main(void) {
 
370
if (pthread_mutex_init(&mtex, NULL) == 0) return 0;
 
371
return 1;
 
372
}
 
373
],
 
374
        AC_MSG_RESULT(yes) 
 
375
        if test "$mutextype" != "dynpthread"; then
 
376
          mutextype=pthread
 
377
          GGDLLIBS="$GGDLLIBS -lc_r"
 
378
        fi
 
379
       ,
 
380
        AC_MSG_RESULT(no)
 
381
        mutextype=builtin
 
382
       ,
 
383
        AC_MSG_RESULT(no)
 
384
        mutextype=builtin
 
385
      )
 
386
     ,
 
387
      AC_MSG_RESULT(no)
 
388
      mutextype=builtin
 
389
    )
 
390
    LIBS="$TMP_SAVE_LIBS"
 
391
  else
 
392
    AC_MSG_RESULT(no)
 
393
    mutextype=builtin
 
394
  fi
 
395
fi
 
396
 
 
397
AC_MSG_CHECKING(what kind of mutexes to use)
 
398
AM_CONDITIONAL(PTLOCK, test "$mutextype" = "pthread")
 
399
AM_CONDITIONAL(DLPTLOCK, test "$mutextype" = "dynpthread")
 
400
AM_CONDITIONAL(BUILTINLOCK, test "$mutextype" = "builtin")
 
401
AC_MSG_RESULT($mutextype)
 
402
 
 
403
 
 
404
dnl ========================================================================
 
405
dnl Checks for target-specific libraries and headers
 
406
 
 
407
AC_PATH_XTRA
 
408
 
 
409
dnl ========================================================================
 
410
dnl Check for inputlibs
 
411
 
 
412
AC_MSG_CHECKING(if we should build the mhub program)
 
413
if test "x$ac_cv_header_unistd_h" = "xyes" \
 
414
        -a "x$ac_cv_func_fcntl" = "xyes" \
 
415
        -a "x$ac_cv_func_signal" = "xyes"; then
 
416
  DEMOS="$DEMOS mhub"
 
417
  AC_MSG_RESULT(yes)
 
418
else
 
419
  AC_MSG_RESULT(no)
 
420
fi
 
421
 
 
422
AC_MSG_CHECKING(if we should build the xsendbut program)
 
423
if test "x$no_x" != "xyes"; then
 
424
  DEMOS="$DEMOS xsendbut"
 
425
  AC_MSG_RESULT(yes)
 
426
else
 
427
  AC_MSG_RESULT(no)
 
428
fi
 
429
 
 
430
 
 
431
AC_MSG_CHECKING(if we should build null inputlib)
 
432
if test "x$build_null_input" != "xno"; then
 
433
  INPUTSUBDIRS="$INPUTSUBDIRS null"
 
434
  AC_MSG_RESULT(yes)
 
435
else
 
436
  AC_MSG_RESULT(no)
 
437
fi
 
438
 
 
439
AC_MSG_CHECKING(if we should build file inputlib)
 
440
if test "x$build_file_input" != "xno"; then
 
441
  INPUTSUBDIRS="$INPUTSUBDIRS file"
 
442
  AC_MSG_RESULT(yes)
 
443
else
 
444
  AC_MSG_RESULT(no)
 
445
fi
 
446
 
 
447
AC_MSG_CHECKING(if we should build tcp inputlib)
 
448
if test "x$build_tcp_input" != "xno"; then
 
449
  INPUTSUBDIRS="$INPUTSUBDIRS tcp"
 
450
  AC_MSG_RESULT(yes)
 
451
else
 
452
  AC_MSG_RESULT(no)
 
453
fi
 
454
 
 
455
AC_MSG_CHECKING(if we should build stdio inputlib)
 
456
if test "x$build_stdio_input" != "xno" -a \
 
457
        "x$ac_cv_header_unistd_h" = "xyes"; then
 
458
  INPUTSUBDIRS="$INPUTSUBDIRS stdin"
 
459
  AC_MSG_RESULT(yes)
 
460
else
 
461
  AC_MSG_RESULT(no)
 
462
fi
 
463
 
 
464
AC_MSG_CHECKING(if we should build x inputlib)
 
465
if test "x$build_x_input" != "xno" -a "x$no_x" != "xyes"; then
 
466
  INPUTSUBDIRS="$INPUTSUBDIRS x"
 
467
  AC_MSG_RESULT(yes)
 
468
else
 
469
  AC_MSG_RESULT(no)
 
470
fi
 
471
 
 
472
AC_MSG_CHECKING(if we should build xwin inputlib)
 
473
if test "x$build_xwin_input" != "xno" -a "x$no_x" != "xyes"; then
 
474
  INPUTSUBDIRS="$INPUTSUBDIRS xwin"
 
475
  AC_MSG_RESULT(yes)
 
476
else
 
477
  AC_MSG_RESULT(no)
 
478
fi
 
479
 
 
480
AC_MSG_CHECKING(if we should build mouse inputlib)
 
481
if test "x$build_mouse_input" != "xno" -a \
 
482
        "x$ac_cv_header_unistd_h" = "xyes"; then
 
483
  INPUTSUBDIRS="$INPUTSUBDIRS mouse"
 
484
  AC_MSG_RESULT(yes)
 
485
else
 
486
  AC_MSG_RESULT(no)
 
487
fi
 
488
 
 
489
AC_MSG_CHECKING(if we should build linux-mouse inputlib)
 
490
if test "x$build_linux_mouse_input" != "xno" -a \
 
491
        "x$ac_cv_header_sys_ioctl_h" = "xyes" -a \
 
492
        "x$ac_cv_header_termios_h" = "xyes"; then
 
493
  INPUTSUBDIRS="$INPUTSUBDIRS linux_mouse"
 
494
  AC_MSG_RESULT(yes)
 
495
else
 
496
  AC_MSG_RESULT(no)
 
497
fi
 
498
 
 
499
AC_MSG_CHECKING(if we should build linux-kbd inputlib)
 
500
if test "x$build_linux_kbd_input" != "xno" -a \
 
501
        "x$ac_cv_header_linux_keyboard_h" = "xyes"; then
 
502
  INPUTSUBDIRS="$INPUTSUBDIRS linux_kbd"
 
503
  AC_MSG_RESULT(yes)
 
504
else
 
505
  AC_MSG_RESULT(no)
 
506
fi
 
507
 
 
508
AC_MSG_CHECKING(if we should build linux-joy inputlib)
 
509
if test "x$build_linux_joy_input" != "xno" -a \
 
510
        "x$ac_cv_header_linux_joystick_h" = "xyes"; then
 
511
  AC_EGREP_CPP(wonkdummy,
 
512
     [#include <linux/joystick.h>
 
513
#ifdef JSIOCGVERSION
 
514
      wonkdummy
 
515
#endif
 
516
],  INPUTSUBDIRS="$INPUTSUBDIRS linux_joy"
 
517
    AC_MSG_RESULT(yes),
 
518
    AC_MSG_RESULT(no))
 
519
else
 
520
  AC_MSG_RESULT(no)
 
521
fi
 
522
 
 
523
AC_MSG_CHECKING(if we should build linux-evdev inputlib)
 
524
if test "x$build_linux_evdev_input" != "xno" -a \
 
525
        "x$ac_cv_header_linux_input_h" = "xyes"; then
 
526
  INPUTSUBDIRS="$INPUTSUBDIRS linux_evdev"
 
527
  AC_MSG_RESULT(yes)
 
528
else
 
529
  AC_MSG_RESULT(no)
 
530
fi
 
531
 
 
532
AC_MSG_CHECKING(if we should build spaceorb inputlib)
 
533
if test "x$build_spaceorb_input" != "xno" -a \
 
534
        "x$ac_cv_header_sys_ioctl_h" = "xyes" -a \
 
535
        "x$ac_cv_header_termios_h" = "xyes"; then
 
536
  INPUTSUBDIRS="$INPUTSUBDIRS spaceorb"
 
537
  AC_MSG_RESULT(yes)
 
538
else
 
539
  AC_MSG_RESULT(no)
 
540
fi
 
541
 
 
542
AC_MSG_CHECKING(if we should build vgl inputlib)
 
543
if test "x$build_vgl_input" != "xno" -a \
 
544
        "x$ac_cv_header_vgl_h" = "xyes"; then
 
545
  INPUTSUBDIRS="$INPUTSUBDIRS vgl"
 
546
  AC_MSG_RESULT(yes)
 
547
else
 
548
  AC_MSG_RESULT(no)
 
549
fi
 
550
 
 
551
AC_MSG_CHECKING(if we should build directx inputlib)
 
552
if test "x$build_directx_input" != "xno" -a \
 
553
        "x$ac_cv_header_dinput_h" = "xyes"; then
 
554
  INPUTSUBDIRS="$INPUTSUBDIRS directx"
 
555
  AC_MSG_RESULT(yes)
 
556
else
 
557
  AC_MSG_RESULT(no)
 
558
fi
 
559
 
 
560
AC_MSG_CHECKING(if we should build pcjoy inputlib)
 
561
if test "x$build_pcjoy_input" = "xyes" -a \
 
562
        "x$ac_cv_header_unistd_h" = "xyes" -a \
 
563
        "x$ac_cv_header_asm_io_h" = "xyes"; then
 
564
  INPUTSUBDIRS="$INPUTSUBDIRS pcjoy"
 
565
  AC_MSG_RESULT(yes)
 
566
else
 
567
  AC_MSG_RESULT(no)
 
568
fi
 
569
 
 
570
AC_MSG_CHECKING(if we should build lk201 inputlib)
 
571
if test "x$build_lk201_input" = "xyes" -a \
 
572
        "x$ac_cv_header_unistd_h" = "xyes" -a \
 
573
        "x$ac_cv_header_termios_h" = "xyes"; then
 
574
  INPUTSUBDIRS="$INPUTSUBDIRS lk201"
 
575
  AC_MSG_RESULT(yes)
 
576
else
 
577
  AC_MSG_RESULT(no)
 
578
fi
 
579
 
 
580
dnl ========================================================================
 
581
dnl Check for filterlibs
 
582
 
 
583
AC_MSG_CHECKING(if we should build mouse emulation filterlib)
 
584
FILTERSUBDIRS="$FILTERSUBDIRS mouse"
 
585
AC_MSG_RESULT(yes)
 
586
 
 
587
AC_MSG_CHECKING(if we should build key translation filterlib)
 
588
FILTERSUBDIRS="$FILTERSUBDIRS keytrans"
 
589
AC_MSG_RESULT(yes)
 
590
 
 
591
AC_MSG_CHECKING(if we should build save filterlib)
 
592
FILTERSUBDIRS="$FILTERSUBDIRS save"
 
593
AC_MSG_RESULT(yes)
 
594
 
 
595
AC_MSG_CHECKING(if we should build tcp filterlib)
 
596
if test "x$build_tcp_filter" != "xno"; then
 
597
  FILTERSUBDIRS="$FILTERSUBDIRS tcp"
 
598
  AC_MSG_RESULT(yes)
 
599
else
 
600
  AC_MSG_RESULT(no)
 
601
fi
 
602
 
 
603
 
 
604
dnl ========================================================================
 
605
dnl System specific things
 
606
 
 
607
if test "x$USE_SYMBOL_UNDERSCORE" = "xyes"; then
 
608
  AC_DEFINE(SYMBOL_UNDERSCORE)
 
609
fi
 
610
 
 
611
AM_CONDITIONAL(MEMDEBUG, test "$use_memdebug" = "yes")
 
612
if test "$use_memdebug" = "yes"; then
 
613
  AC_CHECK_LIB(c, __malloc_hook, AC_DEFINE(HAVE_MALLOC_HOOK))
 
614
fi
 
615
 
 
616
 
 
617
dnl ========================================================================
 
618
dnl Finally add some flags
 
619
 
 
620
dnl _THREAD_SAFE is used instead of _REENTRANT on some systems
 
621
CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
 
622
 
 
623
if test "x$use_debug" = "xyes"; then
 
624
  AC_DEFINE(DEBUG)
 
625
  if test "$ac_cv_prog_gcc" = "yes"; then
 
626
    CFLAGS="$CFLAGS -g -Wall"
 
627
  fi
 
628
fi
 
629
 
 
630
dnl ========================================================================
 
631
dnl Write output
 
632
 
 
633
AC_SUBST(TIMEVAL_INCLUDE)
 
634
AC_SUBST(USLEEP_INCLUDE1)
 
635
AC_SUBST(USLEEP_INCLUDE2)
 
636
AC_SUBST(GGI_8)
 
637
AC_SUBST(GGI_16)
 
638
AC_SUBST(GGI_32)
 
639
AC_SUBST(GGI_ENDIAN)
 
640
AC_SUBST(GG_USLEEP)
 
641
AC_SUBST(GG_CURTIME)
 
642
 
 
643
AC_SUBST(INPUTSUBDIRS)
 
644
AC_SUBST(FILTERSUBDIRS)
 
645
AC_SUBST(DEMOS)
 
646
 
 
647
AC_SUBST(GGDLLIBS)
 
648
AC_SUBST(SELECTLIBS)
 
649
AC_SUBST(NETLIBS)
 
650
 
 
651
dnl Bah! autoconf hasn't set prefix to it's default value yet!
 
652
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
653
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
654
 
 
655
dnl Use static_* to substitute into files where values shouldn't
 
656
dnl dynamicly change.  Makefiles need to be able to dynamicly change
 
657
dnl paths between build and install and shouldn't use these static_*.
 
658
dnl Files that will be installed must always show the final location where
 
659
dnl they will reside and should use these static_* values.
 
660
dnl Ensure that all static_* are fully expanded.
 
661
 
 
662
eval static_libdir="$libdir"
 
663
old_val=""
 
664
until test "$static_libdir" = "$old_val"; do
 
665
        old_val="$static_libdir"
 
666
        eval static_libdir="$static_libdir"
 
667
done
 
668
 
 
669
eval static_sysconfdir="$sysconfdir"
 
670
old_val=""
 
671
until test "$static_sysconfdir" = "$old_val"; do
 
672
      old_val="$static_sysconfdir"
 
673
      eval static_sysconfdir="$static_sysconfdir"
 
674
done
 
675
 
 
676
AC_SUBST(ggi_subdir)
 
677
AC_SUBST(static_libdir)
 
678
AC_SUBST(static_sysconfdir)
 
679
AC_DEFINE_UNQUOTED(GIITAGLEN,$TAGLEN)
 
680
AC_DEFINE_UNQUOTED(GIIPATHTAG,"$PATHTAG")
 
681
AC_DEFINE_UNQUOTED(GIICONFFILE,"$gii_conffile")
 
682
AC_DEFINE_UNQUOTED(GIICONFDIR,"$PATHTAG$static_sysconfdir/$ggi_subdir")
 
683
 
 
684
AM_CONFIG_HEADER(config.h)
 
685
 
 
686
AC_OUTPUT(
 
687
Makefile
 
688
gg/Makefile
 
689
gii/Makefile
 
690
input/Makefile
 
691
input/null/Makefile
 
692
input/file/Makefile
 
693
input/tcp/Makefile
 
694
input/stdin/Makefile
 
695
input/x/Makefile
 
696
input/xwin/Makefile
 
697
input/mouse/Makefile
 
698
input/linux_mouse/Makefile
 
699
input/linux_kbd/Makefile
 
700
input/linux_joy/Makefile
 
701
input/linux_evdev/Makefile
 
702
input/spaceorb/Makefile
 
703
input/vgl/Makefile
 
704
input/directx/Makefile
 
705
input/fdselect/Makefile
 
706
input/pcjoy/Makefile
 
707
input/lk201/Makefile
 
708
filter/Makefile
 
709
filter/mouse/Makefile
 
710
filter/keytrans/Makefile
 
711
filter/save/Makefile
 
712
filter/tcp/Makefile
 
713
demos/Makefile
 
714
include/Makefile
 
715
include/ggi/system.h
 
716
include/ggi/Makefile
 
717
include/ggi/input/Makefile
 
718
include/ggi/internal/Makefile
 
719
doc/Makefile
 
720
doc/man/Makefile
 
721
m4/Makefile
 
722
libgii.conf
 
723
dist/Makefile
 
724
dist/rpm/Makefile
 
725
dist/rpm/libgii.spec
 
726
)