~ubuntu-branches/ubuntu/utopic/vice/utopic-proposed

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2014-05-10 21:08:23 UTC
  • mfrom: (17.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140510210823-v5aojvy1pv1sg132
Tags: 2.4.dfsg+2.4.6-1ubuntu1
Use autotools-dev to update config.{sub,guess} for new arches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl
2
 
dnl This file is part of VICE, the Versatile Commodore Emulator.
3
 
dnl See README for copyright notice.
4
 
dnl
5
 
dnl Process this file with GNU autoconf to produce a configure script.
6
 
dnl
7
 
 
8
 
AC_INIT(src/maincpu.c)
9
 
 
10
 
dnl Command-line options
11
 
VICE_ARG_INIT()
12
 
 
13
 
VICE_VERSION_MAJOR=2
14
 
VICE_VERSION_MINOR=4
15
 
VICE_VERSION_BUILD=0
16
 
 
17
 
VICE_ARG_WITH_LIST(xaw3d,         [  --with-xaw3d            use Xaw3d library instead of plain Xaw])
18
 
VICE_ARG_WITH_LIST(readline,      [  --without-readline      do not try to use the system's readline library])
19
 
VICE_ARG_WITH_LIST(midas,         [  --with-midas            use MIDAS sound system instead of Allegro for audio])
20
 
VICE_ARG_WITH_LIST(arts,          [  --with-arts             use aRts sound system])
21
 
VICE_ARG_WITH_LIST(pulse,         [  --without-pulse         do not use PulseAudio sound system])
22
 
VICE_ARG_WITH_LIST(alsa,          [  --without-alsa          do not use the ALSA sound system])
23
 
VICE_ARG_WITH_LIST(oss,           [  --without-oss           do not use the OSS sound system])
24
 
VICE_ARG_WITH_LIST(sdlsound,      [  --with-sdlsound         use SDL sound system])
25
 
VICE_ARG_WITH_LIST(resid,         [  --without-resid         do not use the reSID engine])
26
 
VICE_ARG_WITH_LIST(residfp,       [  --without-residfp       do not use the reSID-fp engine])
27
 
VICE_ARG_WITH_LIST(png,           [  --without-png           do not use the PNG screenshot system])
28
 
VICE_ARG_WITH_LIST(zlib,          [  --without-zlib          do not use the zlib support])
29
 
VICE_ARG_WITH_LIST(picasso96,     [  --with-picasso96        use Amiga P96 grafix system instead of cgx])
30
 
VICE_ARG_WITH_LIST(cocoa,         [  --with-cocoa            enables native Cocoa UI on Macs])
31
 
VICE_ARG_ENABLE_LIST(textfield,   [  --disable-textfield     disable enhanced text field widget])
32
 
VICE_ARG_ENABLE_LIST(fullscreen,  [  --disable-fullscreen    disable XFree86 fullscreen detection])
33
 
VICE_ARG_ENABLE_LIST(gnomeui,     [  --enable-gnomeui        enables GNOME UI support])
34
 
VICE_ARG_ENABLE_LIST(sdlui,       [  --enable-sdlui          enables SDL UI support])
35
 
VICE_ARG_ENABLE_LIST(gp2x,        [  --enable-gp2x           enables GP2X support])
36
 
VICE_ARG_ENABLE_LIST(wiz,         [  --enable-wiz            enables WIZ support])
37
 
VICE_ARG_ENABLE_LIST(dingoo,      [  --enable-dingoo         enables native Dingoo support])
38
 
VICE_ARG_ENABLE_LIST(dingux,      [  --enable-dingux         enables Dingux (Dingoo Linux) support])
39
 
VICE_ARG_ENABLE_LIST(nls,         [  --disable-nls           disables national language support])
40
 
VICE_ARG_ENABLE_LIST(realdevice,  [  --disable-realdevice    disables access to real peripheral devices (CBM4Linux/OpenCBM)])
41
 
VICE_ARG_ENABLE_LIST(ffmpeg,      [  --disable-ffmpeg        disable FFmpeg library support])
42
 
VICE_ARG_ENABLE_LIST(quicktime,   [  --enable-quicktime      enables Apple QuickTime support])
43
 
VICE_ARG_ENABLE_LIST(ethernet,    [  --enable-ethernet       enables The Final Ethernet emulation])
44
 
VICE_ARG_ENABLE_LIST(ipv6,        [  --disable-ipv6          disables the checking for IPv6 compatibility])
45
 
VICE_ARG_ENABLE_LIST(parsid,      [  --enable-parsid         enables ParSID support])
46
 
VICE_ARG_ENABLE_LIST(bundle,      [  --disable-bundle        do not use application bundles on Macs])
47
 
VICE_ARG_ENABLE_LIST(memmap,      [  --enable-memmap         enable the memmap feature])
48
 
VICE_ARG_ENABLE_LIST(editline,    [  --disable-editline      disable history in Cocoa UI's console])
49
 
VICE_ARG_ENABLE_LIST(lame,        [  --disable-lame          disable MP3 export with LAME])
50
 
VICE_ARG_ENABLE_LIST(static-lame, [  --enable-static-lame    enable static LAME linking])
51
 
VICE_ARG_ENABLE_LIST(rs232,       [  --disable-rs232         disable RS232 support])
52
 
VICE_ARG_ENABLE_LIST(midi,        [  --disable-midi          disable MIDI support])
53
 
VICE_ARG_ENABLE_LIST(embedded,    [  --enable-embedded       enable embedding of emulation data files])
54
 
VICE_ARG_ENABLE_LIST(hidmgr,      [  --disable-hidmgr        disable IOHIDManager joystick support on Mac])
55
 
VICE_ARG_ENABLE_LIST(hidutils,    [  --disable-hidutils      disable HID Uitlities joystick support on Mac])
56
 
VICE_ARG_ENABLE_LIST(debug,       [  --enable-debug          enable debug source options])
57
 
VICE_ARG_ENABLE_LIST(debug-code,  [  --enable-debug-code     enable debugging code])
58
 
 
59
 
dnl register ReSID(-fp) options here to pass arg checks
60
 
VICE_ARG_ENABLE_LIST(inline,      [  --enable-inline         enable inlining of functions [default=yes]])
61
 
VICE_ARG_ENABLE_LIST(arch,        [  --enable-arch[[=arch]]    enable architecture specific compilation [[default=yes]]], [], [enable_arch=yes])
62
 
VICE_ARG_ENABLE_LIST(sse,         [  --enable-sse            enable the use of SSE [[default=yes]]])
63
 
VICE_ARG_ENABLE_LIST(no-pic,      [  --enable-no-pic         enable the use of the no-pic switch [[default=yes]]])
64
 
 
65
 
dnl check for invalid options
66
 
VICE_ARG_LIST_CHECK()
67
 
 
68
 
dnl check for conflicting ui options
69
 
vice_ui_list="--enable-gnomeui --enable-sdlui --with-cocoa --enable-gp2x --enable-wiz"
70
 
vice_ui_1=none
71
 
vice_ui_2=none
72
 
 
73
 
for command_option in $@
74
 
do
75
 
  for vice_ui in $vice_ui_list
76
 
  do
77
 
    if test x"$command_option" = x"$vice_ui"; then
78
 
      if test x"$vice_ui_1" = "xnone"; then
79
 
        vice_ui_1=$vice_ui
80
 
      else
81
 
        vice_ui_2=$vice_ui
82
 
      fi
83
 
    fi
84
 
  done
85
 
done
86
 
 
87
 
if test x"$vice_ui_1" != "xnone" -a x"$vice_ui_2" != "xnone"; then
88
 
  AC_MSG_ERROR([conflicting UI options: $vice_ui_1 $vice_ui_2])
89
 
fi
90
 
 
91
 
if test x"$enable_dingoo" = "xyes" -a x"$enable_dingux" = "xyes"; then
92
 
  AC_MSG_ERROR([conflicting UI options: --enable-dingoo --enable-dingux])
93
 
fi
94
 
 
95
 
AC_SUBST(VICE_VERSION_MAJOR)
96
 
AC_SUBST(VICE_VERSION_MINOR)
97
 
AC_SUBST(VICE_VERSION_BUILD)
98
 
 
99
 
if test x"$VICE_VERSION_BUILD" = "x" -o x"$VICE_VERSION_BUILD" = "x0" ; then
100
 
  VICE_VERSION=$VICE_VERSION_MAJOR"."$VICE_VERSION_MINOR
101
 
else
102
 
  VICE_VERSION=$VICE_VERSION_MAJOR"."$VICE_VERSION_MINOR"."$VICE_VERSION_BUILD
103
 
  AC_DEFINE(UNSTABLE,,[Define if this version is unstable.])
104
 
fi
105
 
AC_SUBST(VICE_VERSION)
106
 
 
107
 
AM_INIT_AUTOMAKE(vice, $VICE_VERSION)
108
 
AM_CONFIG_HEADER(src/config.h)
109
 
 
110
 
if test x"$VICE_VERSION_BUILD" = "x" -o x"$VICE_VERSION_BUILD" = "x0" ; then
111
 
  VERSION_RC=$VICE_VERSION_MAJOR","$VICE_VERSION_MINOR",0,0"
112
 
else
113
 
  VERSION_RC=$VICE_VERSION_MAJOR","$VICE_VERSION_MINOR","$VICE_VERSION_BUILD",0"
114
 
fi
115
 
AC_SUBST(VERSION_RC)
116
 
 
117
 
AC_DEFINE(VERSION_RC,"$VERSION_RC",[Win32 Version string.])
118
 
 
119
 
is_unix=no
120
 
is_unix_gp2x=no
121
 
is_unix_wiz=no
122
 
is_unix_dingux=no
123
 
is_unix_x11=no
124
 
is_unix_macosx=no
125
 
is_dos=no
126
 
is_win32=no
127
 
is_win32_x11=no
128
 
is_os2=no
129
 
is_beos=no
130
 
is_beos_x11=no
131
 
is_amiga=no
132
 
 
133
 
dnl Try to find out which system we are on...
134
 
AC_CANONICAL_HOST
135
 
 
136
 
if test x"$enable_memmap" = "xyes"; then
137
 
  AC_DEFINE(FEATURE_CPUMEMHISTORY,,[Use the memmap feature.])
138
 
fi
139
 
 
140
 
dnl check for debug build
141
 
if test x"$enable_debug" = "xyes"; then
142
 
  DEBUGBUILD=1
143
 
else
144
 
  DEBUGBUILD=0
145
 
fi
146
 
 
147
 
AC_SUBST(DEBUGBUILD)
148
 
 
149
 
dnl check whether to build debug code
150
 
if test x"$enable_debug_code" = "xyes"; then
151
 
  AC_DEFINE(DEBUG,,[Enable debugging code])
152
 
fi
153
 
 
154
 
if test x"$enable_gnomeui" = "xyes" ; then
155
 
  AC_DEFINE(USE_GNOMEUI,,[Use GNOME UI.])
156
 
fi
157
 
 
158
 
AM_CONDITIONAL(GNOMEUI, test x"$enable_gnomeui" = "xyes")
159
 
 
160
 
if test x"$with_cocoa" = "xyes" ; then
161
 
  AC_DEFINE(MACOSX_COCOA,,[Use Cocoa on Macs.])
162
 
fi
163
 
 
164
 
AM_CONDITIONAL(MACOSX_COCOA, test x"$with_cocoa" = "xyes")
165
 
 
166
 
if test x"$enable_textfield" != "xno"; then
167
 
  AC_DEFINE(ENABLE_TEXTFIELD,,[Enable support for the TextField widget.])
168
 
  echo "using TextField widget."
169
 
else
170
 
  echo "using ugly Athena text widget."
171
 
fi
172
 
 
173
 
user_cflags=$CFLAGS
174
 
AC_PROG_CC
175
 
 
176
 
dnl --- setup Objective-C ---
177
 
OBJC="${CC}"
178
 
if test -z "x${OBJCFLAGS}"; then
179
 
  OBJCFLAGS="${CFLAGS}"
180
 
fi
181
 
OBJCDEPMODE="depmode=${CC}"
182
 
AC_SUBST(OBJC)
183
 
AC_SUBST(OBJCFLAGS)
184
 
dnl AC_SUBST(OBJCDEPMODE)
185
 
_AM_DEPENDENCIES([OBJC])
186
 
 
187
 
if test x"$host_os" = "xminixvmd"; then
188
 
  AR="\$(top_srcdir)/src/arch/unix/minix/minix-ar.sh"
189
 
  AC_DEFINE(MINIXVMD,,[are we compiling under Minix-Vmd])
190
 
  CFLAGS="$CFLAGS -I/usr/include/bsdcompat"
191
 
fi
192
 
 
193
 
if test x"$host_os" = "xminix"; then
194
 
  AC_DEFINE(MINIX_SUPPORT,,[do we need minix support])
195
 
  CFLAGS="$CFLAGS -D_MINIX -D_POSIX_SOURCE"
196
 
  MINIX_RELEASE=`uname -r`
197
 
  MINIX_VERSION=`uname -v`
198
 
  if test x"$MINIX_RELEASE" != "x3"; then
199
 
    AC_MSG_ERROR([VICE works only on minix 3 and up])
200
 
  fi
201
 
  case "$MINIX_VERSION" in
202
 
    1.3*)
203
 
      AC_DEFINE(MINIX_HAS_RECV_SEND,,[Define if this version of minix has the recv and send prototypes])
204
 
      ;;
205
 
  esac  
206
 
  AM_CONDITIONAL(MINIX_SUPPORT, true)
207
 
else
208
 
  AM_CONDITIONAL(MINIX_SUPPORT, false)
209
 
fi
210
 
 
211
 
if test x"$host_os" = "xcygwin32" -o x"$host_os" = "xcygwin"; then
212
 
  if test x"$with_x" = "xyes"; then
213
 
    host_os=cygwin-x11
214
 
    is_win32_x11=yes
215
 
  fi
216
 
fi
217
 
 
218
 
if test x"$host_os" = "xbeos"; then
219
 
  if test x"$with_x" = "xyes"; then
220
 
    host_os=x11beos
221
 
    is_beos_x11=yes
222
 
    is_unix=yes
223
 
  fi
224
 
fi
225
 
 
226
 
dnl disable toolchain checking for ppc-beos
227
 
if test x"$host_os" = "xbeos" -a x"$host_cpu" = "xpowerpc"; then
228
 
  toolchain_check=no
229
 
fi
230
 
 
231
 
dnl Enable the SDL UI by default for syllable.
232
 
if test x"$host_os" = "xsyllable"; then
233
 
  enable_sdlui=yes
234
 
fi
235
 
 
236
 
dnl Disable nls for the SDL UI
237
 
if test x"$enable_sdlui" = "xyes"; then
238
 
  enable_nls=no
239
 
fi
240
 
 
241
 
 
242
 
if test "x$CC" = "xgcc"; then
243
 
  GCC=yes
244
 
fi
245
 
 
246
 
dnl test for openwatcom CC for library conversion
247
 
if test x"$CC" = "xowcc"; then
248
 
  CFLAGS="$CFLAGS -O2"
249
 
  AM_CONDITIONAL(OWCC, true)
250
 
  AC_DEFINE(WATCOM_COMPILE,,[owcc is being used.])
251
 
else
252
 
  AM_CONDITIONAL(OWCC, false)
253
 
fi
254
 
 
255
 
if test x"$enable_arch" = "xno"; then
256
 
  march=""
257
 
  ENABLE_ARCH=no
258
 
else
259
 
  if test x"$enable_arch" = "xyes"; then
260
 
    AC_MSG_CHECKING([if the compiler supports -march=native])
261
 
    ORIG_CFLAGS=$CFLAGS
262
 
    CFLAGS="$CFLAGS -march=native"
263
 
    AC_TRY_COMPILE([],
264
 
                   [int test;],
265
 
                   [ AC_MSG_RESULT(yes)
266
 
                     ENABLE_ARCH=yes
267
 
                     march="-march=native" ],
268
 
                   [ AC_MSG_RESULT(no)
269
 
                     ENABLE_ARCH=no
270
 
                     march="" ])
271
 
    CFLAGS=$ORIG_CFLAGS
272
 
  else
273
 
    AC_MSG_CHECKING([if the compiler supports -march=$enable_arch])
274
 
    ORIG_CFLAGS=$CFLAGS
275
 
    CFLAGS="$CFLAGS -march=$enable_arch"
276
 
    AC_TRY_COMPILE([],
277
 
                   [int test;],
278
 
                   [ AC_MSG_RESULT(yes)
279
 
                     ENABLE_ARCH=yes
280
 
                     march="-march=$enable_arch" ],
281
 
                   [ AC_MSG_RESULT(no)
282
 
                     ENABLE_ARCH=no
283
 
                     march="" ])
284
 
    CFLAGS=$ORIG_CFLAGS
285
 
  fi
286
 
fi
287
 
 
288
 
AC_SUBST(ENABLE_ARCH)
289
 
 
290
 
dnl Check for needed external programs.
291
 
AC_PROG_CPP
292
 
AC_CHECK_PROG(AR, ar, ar, ar)
293
 
AC_CHECK_TOOL(RANLIB, ranlib, :)
294
 
AC_CHECK_TOOL(STRIP, strip, :)
295
 
AC_PROG_INSTALL
296
 
AC_PROG_LN_S
297
 
AC_PROG_YACC
298
 
AM_PROG_LEX
299
 
AM_PROG_AS
300
 
 
301
 
AC_CHECK_PROGS(MAKEINFO, makeinfo, no)
302
 
 
303
 
AC_CHECK_PROGS(TEXI2DVI, texi2dvi, no)
304
 
AC_CHECK_PROGS(PDFTEX, pdftex, no)
305
 
if test x"$TEXI2DVI" = "xno" -o x"$PDFTEX" = "xno"; then
306
 
  AM_CONDITIONAL(BUILD_PDF, false)
307
 
else
308
 
  AM_CONDITIONAL(BUILD_PDF, true)
309
 
fi
310
 
 
311
 
AC_CHECK_PROGS(DOS2UNIX, dos2unix, dos2unix)
312
 
 
313
 
dnl Setup crosscompiling.
314
 
if test x"$host_vendor" = "xgo32" -o x"$host_vendor" = "xmsdos" -o x"$host_os" = "xmsdosdjgpp"; then
315
 
 
316
 
  dnl Some GCC cross-compilers are installed with a different name
317
 
  dnl instead of using the GCC architecture targeting features.
318
 
  dnl Check for the most common ones.
319
 
 
320
 
  dnl This is used by subsequent tests.
321
 
  ac_cv_prog_gcc=yes
322
 
  GCC=yes
323
 
 
324
 
  is_dos=yes
325
 
 
326
 
  if test x"$with_midas" = "xyes" ; then
327
 
      AC_DEFINE(USE_MIDAS_SOUND,,
328
 
                [Use MIDAS Sound System instead of the Allegro library.])
329
 
      LIBMIDAS="-lmidas"
330
 
      echo "configuring support for MIDAS Sound System"
331
 
  else
332
 
      LIBMIDAS=""
333
 
      echo "using Allegro sound driver"
334
 
  fi
335
 
 
336
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
337
 
 
338
 
  dnl We always have a joystick and mouse on MSDOS.
339
 
  AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
340
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
341
 
  AC_DEFINE(HAS_SINGLE_CANVAS,,[Is only one canvas supported?])
342
 
  AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
343
 
  AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
344
 
 
345
 
  if test x"$enable_parsid" = "xyes"; then
346
 
    AC_DEFINE(HAVE_PARSID,,[Support for ParSID.])
347
 
  fi
348
 
 
349
 
  dnl disable resid
350
 
  with_resid=no
351
 
 
352
 
elif test x"$host_os" = "xamigaos" -o x"$host_os" = "xamigaos4" -o x"$host_os" = "xamithlon" -o x"$host_os" = "xaros" -o x"$host_os" = "xmorphos" -o x"$host_os" = "xwarpos" -o x"$host_os" = "xpowerup"; then
353
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, true)
354
 
 
355
 
  if test x"$enable_sdlui" != "xyes"; then
356
 
      if test x"$enable_rs232" != "xno"; then
357
 
        AC_DEFINE(HAVE_RS232,,[Enable RS232 emulation.])
358
 
      fi
359
 
      AC_DEFINE(HAVE_RAWDRIVE,,[Support for block device disk image access.])
360
 
      AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
361
 
      AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
362
 
  fi
363
 
 
364
 
  AC_DEFINE(AMIGA_SUPPORT,,[Should we enable Amigaos support.])
365
 
 
366
 
  is_amigaos4=yes
367
 
  is_amigaos3=no
368
 
  is_amiga_aros=no
369
 
  is_amiga_morphos=no
370
 
  openpci_present=no
371
 
 
372
 
  if test x"$host_os" = "xmorphos"; then
373
 
    AC_DEFINE(AMIGA_MORPHOS,,[Should we enable Amiga Morphos support.])
374
 
    CFLAGS="$CFLAGS -noixemul"
375
 
    AC_DEFINE(HAVE_HTONL,,[Define to 1 if you have the htonl function.])
376
 
    AC_DEFINE(HAVE_HTONS,,[Define to 1 if you have the htons function.])
377
 
    AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
378
 
    AC_CHECK_HEADERS(proto/openpci.h, openpci_present=yes,,)
379
 
    if test x"$enable_sdlui" != "xyes"; then
380
 
        AC_DEFINE(HAVE_XVIDEO,,[Enable XVideo (overlay) support.])
381
 
    fi
382
 
    if test x"$openpci_present" = "xyes"; then
383
 
      AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
384
 
      AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
385
 
    fi
386
 
    is_amiga_morphos=yes
387
 
    is_amigaos4=no
388
 
  fi
389
 
 
390
 
  if test x"$host_os" = "xaros"; then
391
 
    AC_DEFINE(AMIGA_AROS,,[Should we enable AROS support.])
392
 
    AC_DEFINE(HAVE_HTONL,,[Define to 1 if you have the htonl function.])
393
 
    AC_DEFINE(HAVE_HTONS,,[Define to 1 if you have the htons function.])
394
 
    AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
395
 
    AC_CHECK_HEADERS(aros/_timeval.h)
396
 
    AC_MSG_CHECKING(if common library bases are auto resolved)
397
 
    aros_common_resolve=no
398
 
    AC_TRY_LINK([#include <proto/asl.h>],
399
 
                [AbortAslRequest(0)],
400
 
                aros_common_resolve=yes)
401
 
    if test x"$aros_common_resolve" = "xyes"; then
402
 
       AC_MSG_RESULT(yes)
403
 
       AC_DEFINE(WORKING_AROS_AUTO,,[Define to 1 if aros can handle auto resolving of library bases.])
404
 
    else
405
 
       AC_MSG_RESULT(no)
406
 
    fi
407
 
    is_amigaos4=no
408
 
    is_amiga_aros=yes
409
 
  fi
410
 
 
411
 
  if test x"$host_os" = "xamigaos" -a x"$host_cpu" = "xm68k"; then
412
 
    CFLAGS="$CFLAGS -mc68020 -noixemul"
413
 
    AC_DEFINE(AMIGA_M68K,,[Should we enable M68K AmigaOS support.])
414
 
    AC_DEFINE(HAVE_HTONL,,[Define to 1 if you have the htonl function.])
415
 
    AC_DEFINE(HAVE_HTONS,,[Define to 1 if you have the htons function.])
416
 
    AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
417
 
    AC_CHECK_HEADERS(proto/openpci.h, openpci_present=yes,,)
418
 
    if test x"$openpci_present" = "xyes"; then
419
 
      AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
420
 
      AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
421
 
    fi
422
 
    is_amigaos4=no
423
 
    is_amigaos3=yes
424
 
  fi
425
 
 
426
 
  if test x"$is_amigaos4" = "xyes"; then
427
 
    AC_DEFINE(AMIGA_OS4,,[Should we enable AmigaOS4 support.])
428
 
    AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
429
 
    AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
430
 
    with_picasso96=yes
431
 
    LIBS="$LIBS -lsupc++ -lgcc_eh"
432
 
  fi
433
 
 
434
 
  is_amiga=yes
435
 
 
436
 
  CFLAGS="$CFLAGS -finline-functions"
437
 
 
438
 
  if test x"$enable_sdlui" = "xyes" -a x"is_amigaos4" = "xyes"; then
439
 
    LIBS="$LIBS -lunix"
440
 
  fi
441
 
 
442
 
elif test x"$host_os" = "xcygwin32" -o x"$host_os" = "xcygwin" -o x"$host_os" = "xmingw32" -o x"$host_os" = "xmingw32msvc"; then
443
 
 
444
 
  dnl This is used by subsequent tests.
445
 
  ac_cv_prog_gcc=yes
446
 
  GCC=yes
447
 
 
448
 
  is_win32=yes
449
 
 
450
 
  AC_CHECK_HEADERS([commctrl.h shlobj.h winioctl.h], [], [], [#include <windows.h>])
451
 
 
452
 
  AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
453
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
454
 
  AC_DEFINE(HAVE_HTONL,,[Define to 1 if you have the htonl function.])
455
 
  AC_DEFINE(HAVE_HTONS,,[Define to 1 if you have the htons function.])
456
 
  AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
457
 
  AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
458
 
  AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
459
 
  if test x"$enable_parsid" = "xyes"; then
460
 
    AC_DEFINE(HAVE_PARSID,,[Support for ParSID.])
461
 
  fi
462
 
  if test x"$enable_midi" != "xno"; then
463
 
    AC_DEFINE(HAVE_MIDI,,[Enable support for MIDI.])
464
 
  fi
465
 
  AC_DEFINE(HAVE_TFE,,[Support for The final Ethernet.])
466
 
  if test x"$enable_rs232" != "xno"; then
467
 
    AC_DEFINE(HAVE_RS232,,[Enable RS232 emulation.])
468
 
  fi
469
 
 
470
 
  if test x"$enable_sdlui" != "xyes"; then
471
 
    AC_TRY_LINK([#include <windows.h>],
472
 
                [LARGE_INTEGER li; return (int) li.QuadPart],
473
 
                AC_DEFINE(HAS_LONGLONG_INTEGER,,
474
 
                  [Support 64bit integer for Win32 performance counter]),)
475
 
    AC_TRY_LINK([#include <windows.h>],
476
 
                [HGLOBAL hGlobal; UnlockResource(hGlobal); return 0],
477
 
                AC_DEFINE(HAS_UNLOCKRESOURCE,,[Do we have UnlockResource()?]),)
478
 
  fi
479
 
 
480
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
481
 
 
482
 
  dinput_header_no_lib="no"
483
 
 
484
 
  dnl don't use dinput for owcc
485
 
  if test x"$CC" != "xowcc"; then
486
 
    AC_CHECK_HEADER(dinput.h,
487
 
                [ AC_DEFINE(HAVE_DINPUT,,[Use DirectInput joystick driver]) ]
488
 
                [ AC_MSG_CHECKING(for -ldinput) ]
489
 
                [SAVELIBS="$LIBS"] [ LIBS="-ldinput $LIBS" ]
490
 
                [ AC_LINK_IFELSE([
491
 
                                 AC_LANG_PROGRAM([#include <dinput.h>],[return DirectInputCreateA(0,0,0,0);])
492
 
                                 ],
493
 
                              [ AC_DEFINE(HAVE_DINPUT_LIB, [], [dinput.lib or libdinput.a are present]) ]
494
 
                                [ AC_MSG_RESULT(yes) ],
495
 
                              [ dinput_header_no_lib="yes" ]
496
 
                              [ LIBS="$SAVELIBS" ]
497
 
                              [ AC_MSG_RESULT(no) ]
498
 
                )]
499
 
                 )
500
 
  fi
501
 
elif test x"$host_os" = "xbeos"; then
502
 
 
503
 
  dnl This is used by subsequent tests.
504
 
  ac_cv_prog_gcc=yes
505
 
  GCC=yes
506
 
 
507
 
  is_beos=yes
508
 
 
509
 
  if test x"$enable_sdlui" != "xyes"; then
510
 
    AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
511
 
    AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
512
 
  fi
513
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
514
 
 
515
 
elif test x"$host_os" = "xgp2x" -o x"$host_os" = "xlinux-gp2x" -o x"$host_vendor" = "xgp2x" -o "$host_os" = "xopen2x" -o x"$host_os" = "xlinux-open2x" -o x"$host_vendor" = "xopen2x" -o x"$enable_gp2x" = "xyes"; then
516
 
 
517
 
  dnl This is used by subsequent tests.
518
 
  ac_cv_prog_gcc=yes
519
 
  GCC=yes
520
 
 
521
 
  is_unix=yes
522
 
  is_unix_gp2x=yes
523
 
 
524
 
  CFLAGS="$CFLAGS -fomit-frame-pointer -mcpu=arm920t -msoft-float"
525
 
 
526
 
  if test x"$enable_sdlui" != "xyes"; then
527
 
    AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
528
 
    AC_DEFINE(DEBUG_ZFILE,,[Use debugging of the zfile])
529
 
    AC_DEFINE(GP2X,,[Enable GP2X compilation])
530
 
  else
531
 
    AC_DEFINE(GP2X_SDL,,[Enable SDL GP2X compilation])
532
 
  fi
533
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
534
 
elif test x"$enable_dingoo" = "xyes"; then
535
 
  dnl This is used by subsequent tests.
536
 
  ac_cv_prog_gcc=yes
537
 
  GCC=yes
538
 
  is_unix=no
539
 
  is_unix_dingoo=no
540
 
  CFLAGS="-G0 -O3 -I$DINGOO_SDK/include -I$DINGOO_SDK/src/SDL/include -I$DINGOO_SDK/src -I$DINGOO_SDK/src/SDL/src"
541
 
  CFLAGS="$CFLAGS -I$MIPSTOOLS/mipsel-linux-include -msplit-addresses -mips32"
542
 
  CFLAGS="$CFLAGS -mno-abicalls -fno-pic -finline-functions -fomit-frame-pointer"
543
 
  CFLAGS="$CFLAGS -msoft-float -fno-exceptions -D_DEBUG -DMPU_JZ4740"
544
 
  CFLAGS="$CFLAGS -fcommon -falign-loops -falign-jumps -falign-labels"
545
 
  CFLAGS="$CFLAGS -fdelayed-branch"
546
 
  LIBS="-Wl,-z,muldefs -static -nodefaultlibs -nostdlib -Wl,--script,$DINGOO_SDK/lib/dingoo.xn -L$DINGOO_SDK/lib -lm -lSDL -lfgl -lsml -lc -ljz4740 -lgcc"
547
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
548
 
  AC_DEFINE(DINGOO_NATIVE,,[Enable native DINGOO compilation])
549
 
  AC_DEFINE(DINGOO,,[Enable DINGOO compilation])
550
 
  with_png="no"
551
 
  dynlib_support="no"
552
 
  with_resid=no
553
 
  with_residfp=no
554
 
  enable_sdlui=yes
555
 
  enable_embedded=yes
556
 
elif test x"$host_os" = "xwiz" -o x"$host_os" = "xlinux-wiz" -o x"$host_vendor" = "xwiz" -o x"$enable_wiz" = "xyes"; then
557
 
 
558
 
  dnl This is used by subsequent tests.
559
 
  ac_cv_prog_gcc=yes
560
 
  GCC=yes
561
 
 
562
 
  is_unix=yes
563
 
  is_unix_wiz=yes
564
 
 
565
 
  CFLAGS="$CFLAGS -fomit-frame-pointer -msoft-float"
566
 
 
567
 
  if test x"$enable_sdlui" != "xyes"; then
568
 
    AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
569
 
    AC_DEFINE(DEBUG_ZFILE,,[Use debugging of the zfile])
570
 
    AC_DEFINE(WIZ,,[Enable WIZ compilation])
571
 
  else
572
 
    AC_DEFINE(WIZ_SDL,,[Enable SDL WIZ compilation])
573
 
  fi
574
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
575
 
elif test x"$host_os" = "xdingux" -o x"$host_os" = "xdingoo" -o x"$host_os" = "xlinux-uclibc-dingux" -o x"$host_os" = "xlinux-uclibc-dingoo" -o x"$host_vendor" = "xdingux" -o x"$host_vendor" = "xdingoo" -o x"$enable_dingux" = "xyes"; then
576
 
 
577
 
  dnl This is used by subsequent tests.
578
 
  ac_cv_prog_gcc=yes
579
 
  GCC=yes
580
 
 
581
 
  is_unix=yes
582
 
  is_unix_dingux=yes
583
 
 
584
 
  CFLAGS="$CFLAGS -fexpensive-optimizations -fomit-frame-pointer -frename-registers"
585
 
 
586
 
  if test x"$enable_sdlui" != "xyes"; then
587
 
    AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
588
 
    AC_DEFINE(DEBUG_ZFILE,,[Use debugging of the zfile])
589
 
    AC_DEFINE(DINGUX,,[Enable DINGUX compilation])
590
 
  else
591
 
    AC_DEFINE(DINGUX_SDL,,[Enable SDL DINGUX compilation])
592
 
  fi
593
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
594
 
else
595
 
 
596
 
dnl Check for host os with version attached. Typically on UN*X like systems.
597
 
case "$host_os" in
598
 
 
599
 
dnl Mac OS X Host
600
 
darwin*)
601
 
 
602
 
  is_unix=yes
603
 
  is_unix_macosx=yes
604
 
 
605
 
  dnl disable toolchain checking for macosx
606
 
  toolchain_check=no
607
 
 
608
 
  if test x"$with_cocoa" = "xyes" ; then
609
 
    is_unix_x11=no
610
 
  else
611
 
    is_unix_x11=yes
612
 
  fi
613
 
 
614
 
  if test -z "$user_cflags" ; then
615
 
    if test x"$GCC" = "xyes" ; then
616
 
      warnings_cxx="-Wall -Winline"
617
 
      warnings_c="-Wstrict-prototypes $warnings_cxx"
618
 
      optimization_c="-O3 $march"
619
 
      optimization_cxx="-fno-exceptions $optimization_c"
620
 
      if test x"$ac_cv_prog_cc_g" = "xyes" ; then
621
 
        CFLAGS="-g $optimization_c $warnings_c"
622
 
        CXXFLAGS="-g $optimization_cxx $warnings_cxx"
623
 
      else
624
 
        CFLAGS="$optimization_c $warnings_c"
625
 
        CXXFLAGS="$optimization_cxx $warnings_cxx"
626
 
      fi 
627
 
    fi
628
 
  fi
629
 
 
630
 
  if test "$GCC" = yes -a "$enable_no_pic" != "no" ; then
631
 
    CFLAGS="$CFLAGS -mdynamic-no-pic"
632
 
    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
633
 
  fi
634
 
 
635
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, true)
636
 
  if test x"$enable_rs232" != "xno"; then
637
 
    AC_DEFINE(HAVE_RS232,,[Enable RS232 emulation.])
638
 
  fi
639
 
 
640
 
  AC_DEFINE(HAVE_RAWDRIVE,,[Support for block device disk image access.])
641
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
642
 
 
643
 
  AC_DEFINE(MACOSX_SUPPORT,,[Enable Mac OS X specific code.])
644
 
  if test "x$enable_bundle" != "xno" -o "x$enable_sdlui" = "xyes"; then
645
 
    echo "enabled Mac application bundles"
646
 
    AC_DEFINE(MACOSX_BUNDLE,,[Enable Mac OS X application bundles.])
647
 
  else
648
 
    echo "disabled Mac application bundles"
649
 
  fi
650
 
  ;;
651
 
 
652
 
dnl All other UN*X systems
653
 
*)
654
 
 
655
 
  dnl special handling of sco unixware 7.x
656
 
  case "$host_os" in
657
 
    sco3.2v7*)
658
 
      LIBS="-lxti -lsocket -lnsl $LIBS"
659
 
      ;;
660
 
  esac
661
 
 
662
 
  case "$host" in
663
 
    *x11beos*)
664
 
      LIBS="$LIBS -lbe -ltracker -ldevice -lgame"
665
 
      ;;
666
 
    alpha*-*-linux*)
667
 
      if test x"$CC" = "xccc"; then
668
 
        echo "Using Compaq C Compiler cflags."
669
 
        CFLAGS="-w0 -g3 -migrate -fast -inline speed -unroll 0 -arch host -tune host"
670
 
        AC_DEFINE(__DECALPHA__,1,[define when using the alpha compaq compiler])
671
 
      fi
672
 
      ;;
673
 
 
674
 
    sparc-*-sunos4*)
675
 
      if test x"$CC" = "xcc"; then
676
 
        echo "Using Sun C Compiler cflags."
677
 
        CFLAGS="-O -xCC"
678
 
      fi
679
 
      ;;
680
 
 
681
 
    *-sgi-irix*)
682
 
      if test x"$CC" = "xcc"; then
683
 
        echo "Using SGI C Compiler cflags."
684
 
        CFLAGS="-O2 -woff all"
685
 
      fi
686
 
      ;;
687
 
 
688
 
    alpha*-dec-osf*)
689
 
      if test x"$CC" = "xcc"; then
690
 
        echo "Using Tru64 C Compiler cflags."
691
 
        CFLAGS="-fast -O2 -std -g3 -non_shared"
692
 
      fi
693
 
      ;;
694
 
  esac
695
 
 
696
 
  is_unix=yes
697
 
  is_unix_x11=yes
698
 
 
699
 
  if test -z "$user_cflags" ; then
700
 
 
701
 
    dnl Check for the type of compiler first.
702
 
    if test x"$GCC" = "xyes" ; then
703
 
 
704
 
      warnings_cxx="-Wall -Wno-inline"
705
 
      if test x"$enable_gnomeui" != "xyes" ; then
706
 
          warnings_c="-Wstrict-prototypes $warnings_cxx"
707
 
      else
708
 
          dnl "-Wstrict-prototypes" gives zillions of warnings in gtk headers
709
 
          dnl warnings_gnome="-DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED"
710
 
          warnings_c="$warnings_gnome $warnings_cxx"
711
 
      fi
712
 
 
713
 
      dnl Set appropriate optimization options (better than the default -g -O)
714
 
      dnl if using GCC.
715
 
      dnl If the user has specified her own `CFLAGS', we do not override them.
716
 
 
717
 
      optimization_c="-O3 $march"
718
 
      optimization_cxx="-fno-exceptions $optimization_c"
719
 
      dnl Use -g if available.
720
 
      if test x"$ac_cv_prog_cc_g" = "xyes" ; then
721
 
         CFLAGS="-g $optimization_c $warnings_c"
722
 
         CXXFLAGS="-g $optimization_cxx $warnings_cxx"
723
 
      else
724
 
         CFLAGS="$optimization_c $warnings_c"
725
 
         CXXFLAGS="$optimization_cxx $warnings_cxx"
726
 
      fi
727
 
 
728
 
      dnl Check whether the options are OK.
729
 
      AC_PROG_CC
730
 
 
731
 
    fi
732
 
 
733
 
    dnl (If not on GCC, just keep the defaults, which are very conservative).
734
 
 
735
 
  fi
736
 
 
737
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, true)
738
 
 
739
 
  AC_DEFINE(HAVE_RAWDRIVE,,[Support for block device disk image access.])
740
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
741
 
  if test x"$is_beos_x11" != "xyes"; then
742
 
    if test x"$enable_midi" != "xno"; then
743
 
      AC_DEFINE(HAVE_MIDI,,[Enable support for MIDI.])
744
 
    fi
745
 
    if test x"$enable_rs232" != "xno"; then
746
 
      AC_DEFINE(HAVE_RS232,,[Enable RS232 emulation.])
747
 
    fi
748
 
  fi
749
 
 
750
 
  AC_CHECK_HEADER(linux/hardsid.h,
751
 
      [ AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.]) ],)
752
 
 
753
 
  ;;
754
 
esac
755
 
fi
756
 
 
757
 
dnl This enables the embedded data files feature, which should
758
 
dnl only be used for developing new ports or for ports for which
759
 
dnl the loading of the datafiles is hard/impossible.
760
 
if test x"$enable_embedded" = "xyes"; then
761
 
  AC_DEFINE(USE_EMBEDDED,,[Use embedded data files.])
762
 
  AM_CONDITIONAL(EMBEDDED, true)
763
 
else
764
 
  AM_CONDITIONAL(EMBEDDED, false)
765
 
fi
766
 
 
767
 
AM_CONDITIONAL(USE_MIDAS_SOUND, test x"$with_midas" = "xyes")
768
 
 
769
 
dnl check for texi to amigaguide program
770
 
AC_CHECK_PROGS(MAKEGUIDE, makeguide, no)
771
 
if test x"$MAKEGUIDE" != "xno"; then
772
 
  AM_CONDITIONAL(BUILD_AMIGAGUIDE, true)
773
 
else
774
 
  if test x"$MAKEINFO" != "xno"; then
775
 
    AC_MSG_CHECKING([if the makeinfo supports amigaguide])
776
 
    agresult=`$MAKEINFO --help 2>&1 | grep amiga`
777
 
    if test x"$agresult" != "x"; then
778
 
      AC_MSG_RESULT([yes])
779
 
      MAKEGUIDE=$MAKEINFO
780
 
      AM_CONDITIONAL(BUILD_AMIGAGUIDE, true)
781
 
    else
782
 
      AC_MSG_RESULT([no])
783
 
      AM_CONDITIONAL(BUILD_AMIGAGUIDE, false)
784
 
    fi
785
 
  else
786
 
    AM_CONDITIONAL(BUILD_AMIGAGUIDE, false)
787
 
  fi
788
 
fi
789
 
AC_SUBST(MAKEGUIDE)
790
 
 
791
 
dnl check for windows chm compiler
792
 
AC_CHECK_PROGS(HHC, hhc, no)
793
 
if test x"$HHC" = "xno"; then
794
 
  AM_CONDITIONAL(BUILD_CHM, false)
795
 
else
796
 
  AM_CONDITIONAL(BUILD_CHM, true)
797
 
fi
798
 
 
799
 
dnl check for windows hlp compiler programs
800
 
AC_CHECK_PROGS(MAKERTF, makertf, no)
801
 
AC_CHECK_PROGS(HCRTF, hcrtf, no)
802
 
if test x"$MAKERTF" = "xno" -o x"$HCRTF" = "xno"; then
803
 
  AM_CONDITIONAL(BUILD_HLP, false)
804
 
else
805
 
  AM_CONDITIONAL(BUILD_HLP, true)
806
 
fi
807
 
 
808
 
dnl check for os/2 ipf compiler programs
809
 
AC_CHECK_PROGS(TEXI2IPF, texi2ipf, no)
810
 
AC_CHECK_PROGS(IPFC, wipfc, no)
811
 
if test x"$TEXI2IPF" != "xno"; then
812
 
  if test x"$IPFC" = "xno"; then
813
 
    AC_CHECK_PROGS(IPFC, ipfc, no)
814
 
  fi
815
 
  if test x"$IPFC" != "xno"; then
816
 
    AM_CONDITIONAL(BUILD_IPF, true)
817
 
  else
818
 
    AM_CONDITIONAL(BUILD_IPF, false)
819
 
  fi
820
 
else
821
 
  AM_CONDITIONAL(BUILD_IPF, false)
822
 
fi
823
 
 
824
 
dnl Extension for executable files in this system
825
 
AC_EXEEXT
826
 
 
827
 
dnl NLS stuff
828
 
dnl Its has been rejected to use the full GNU gettext package 
829
 
dnl delivered within the source. This is a minimum replacement implementing
830
 
dnl a simple check to find `libintl.h' and `gettext'.
831
 
dnl
832
 
 
833
 
dnl Add new languages here
834
 
ALL_LINGUAS="da de es fr hu it ko nl pl ru sv tr"
835
 
 
836
 
dnl These rules are solely for the distribution goal.  While doing this
837
 
dnl we only have to keep exactly one list of the available catalogs
838
 
dnl in configure.in.
839
 
for lang in $ALL_LINGUAS; do
840
 
  GMOFILES="$GMOFILES $lang.gmo"
841
 
  POFILES="$POFILES $lang.po"
842
 
done
843
 
AC_SUBST(GMOFILES)
844
 
AC_SUBST(POFILES)
845
 
 
846
 
if test x"$enable_nls" != "xno" -a x"$is_unix" = "xyes"; then
847
 
  AC_CHECK_HEADER(libintl.h,
848
 
    [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
849
 
      [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
850
 
         gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
851
 
 
852
 
     AC_CACHE_CHECK([for gettext in libintl], gt_cv_func_gettext_libintl,
853
 
      [save_libs="$LIBS"
854
 
       LIBS="-lintl $LIBS"
855
 
       AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
856
 
         INTLLIBS=-lintl gt_cv_func_gettext_libintl=yes, gt_cv_func_gettext_libintl=no)
857
 
       LIBS="$save_libs"])
858
 
 
859
 
     if test "$gt_cv_func_gettext_libc" = "yes" \
860
 
        || test "$gt_cv_func_gettext_libintl" = "yes"; then
861
 
        AC_DEFINE(HAVE_GETTEXT,,[Define if gettext if available.])
862
 
        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
863
 
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
864
 
        if test "$MSGFMT" != "no"; then
865
 
          AC_CHECK_FUNCS(dcgettext)
866
 
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
867
 
          AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
868
 
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
869
 
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
870
 
                         return _nl_msg_cat_cntr],
871
 
            [CATOBJEXT=.gmo
872
 
             DATADIRNAME=share],
873
 
            [CATOBJEXT=.mo
874
 
             DATADIRNAME=lib])
875
 
          INSTOBJEXT=.mo
876
 
        fi
877
 
        USE_NLS=yes
878
 
        AC_DEFINE(ENABLE_NLS,,[Define if NLS support is enabled.])
879
 
        AC_DEFINE(HAVE_LIBINTL_H,,[use libintl for NLS.])
880
 
        AC_DEFINE_UNQUOTED(DATADIRNAME, "$DATADIRNAME",[NLS datadirname.])
881
 
        dnl this is prefixed with PREFIX
882
 
        AC_DEFINE(NLS_LOCALEDIR, PREFIX"/"DATADIRNAME"/locale",[NLS local directory.])
883
 
      else
884
 
        AC_MSG_WARN([libintl.h not found, disabling NLS])
885
 
        USE_NLS=no
886
 
      fi
887
 
  ])
888
 
  dnl Test whether we really found GNU xgettext.
889
 
  if test "$XGETTEXT" != ":"; then
890
 
    dnl If it is no GNU xgettext we define it as : so that the
891
 
    dnl Makefiles still can work.
892
 
    if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
893
 
      : ;
894
 
    else
895
 
      AC_MSG_RESULT(
896
 
        [found xgettext program is not GNU xgettext; ignore it])
897
 
      XGETTEXT=":"
898
 
    fi
899
 
  fi
900
 
 
901
 
  dnl Test wether GMSGFMT is there. Should fix `make dist'.
902
 
  if test "$GMSGFMT" = "" ; then
903
 
    GMSGFMT=":"
904
 
  fi
905
 
 
906
 
  # We need to process the po/ directory.
907
 
  POSUB=po
908
 
  
909
 
  AC_OUTPUT_COMMANDS(
910
 
    [case "$CONFIG_FILES" in *po/Makefile.in*)
911
 
      sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
912
 
    esac])
913
 
  
914
 
  dnl Make all variables we use known to autoconf.
915
 
  AC_SUBST(USE_INCLUDED_LIBINTL)
916
 
  AC_SUBST(CATALOGS)
917
 
  AC_SUBST(DATADIRNAME)
918
 
  AC_SUBST(INSTOBJEXT)
919
 
  AC_SUBST(INTLDEPS)
920
 
  AC_SUBST(INTLLIBS)
921
 
  AC_SUBST(INTLOBJS)
922
 
  AC_SUBST(POSUB)
923
 
  AC_SUBST(GENCAT)
924
 
 
925
 
  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
926
 
  dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
927
 
  dnl Try to locate is.
928
 
  MKINSTALLDIRS=
929
 
  if test -n "$ac_aux_dir"; then
930
 
    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
931
 
  fi
932
 
  if test -z "$MKINSTALLDIRS"; then
933
 
    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
934
 
  fi
935
 
  AC_SUBST(MKINSTALLDIRS)
936
 
 
937
 
  dnl currently no catgets support, can't check it.
938
 
  GENCAT=
939
 
  AC_SUBST(GENCAT)
940
 
else
941
 
  if test x"$is_unix" = "xyes"; then
942
 
    AC_MSG_WARN([disabling NLS on user request])
943
 
  fi
944
 
  USE_NLS=no
945
 
fi
946
 
 
947
 
if test x"$USE_NLS" = "x" ; then
948
 
  USE_NLS=no
949
 
fi
950
 
if test "$MSGFMT" = "no" ; then
951
 
  dnl Fallback to shipped .gmo 
952
 
  dnl Those should work on x86 linux systems.
953
 
  AC_MSG_WARN([msgfmt not found, falling back to default catalogs (x86/Linux)])
954
 
  CATOBJEXT=".gmo"
955
 
fi
956
 
AC_SUBST(CATOBJEXT)
957
 
AC_SUBST(USE_NLS)
958
 
AC_SUBST(NLS_LOCALEDIR)
959
 
 
960
 
dnl Check for a perl interpreter.
961
 
AC_PATH_PROG(PERL, perl)
962
 
AC_SUBST(PERL)
963
 
 
964
 
if test x"$POSUB" = "xpo"; then
965
 
  AM_CONDITIONAL(PO_SUBDIR_USED, true)
966
 
else
967
 
  AM_CONDITIONAL(PO_SUBDIR_USED, false)
968
 
fi
969
 
 
970
 
dnl Check if --param inline-unit-growth=60 can be used.
971
 
old_CFLAGS=$CFLAGS
972
 
CFLAGS="$CFLAGS --param inline-unit-growth=60"
973
 
AC_MSG_CHECKING([if the compiler accepts --param inline-unit-growth=60])
974
 
AC_TRY_COMPILE([],
975
 
               [int test;],
976
 
               [ AC_MSG_RESULT(yes)
977
 
                 INLINE_UNIT_GROWTH="--param inline-unit-growth=60"
978
 
                ],
979
 
               [ AC_MSG_RESULT(no)
980
 
                INLINE_UNIT_GROWTH=""
981
 
                ])
982
 
CFLAGS=$old_CFLAGS
983
 
AC_SUBST(INLINE_UNIT_GROWTH)
984
 
 
985
 
dnl Check if --param max-inline-insns-single=600 can be used.
986
 
old_CFLAGS=$CFLAGS
987
 
CFLAGS="$CFLAGS --param max-inline-insns-single=600"
988
 
AC_MSG_CHECKING([if the compiler accepts --param max-inline-insns-single=600])
989
 
AC_TRY_COMPILE([],
990
 
               [int test;],
991
 
               [ AC_MSG_RESULT(yes)
992
 
                 MAX_INLINE_INSN_SINGLE="--param max-inline-insns-single=600"
993
 
                ],
994
 
               [ AC_MSG_RESULT(no)
995
 
                MAX_INLINE_INSN_SINGLE=""
996
 
                ])
997
 
CFLAGS=$old_CFLAGS
998
 
AC_SUBST(MAX_INLINE_INSN_SINGLE)
999
 
 
1000
 
dnl Check and setup aRts compilation.
1001
 
if test x"$with_arts" = "xyes"; then
1002
 
        AC_CHECK_PROGS(artsc_config, artsc-config, no)
1003
 
        if test x"$artsc_config" = "xno"; then
1004
 
                AC_MSG_WARN([artsc-config not found. aRts will not be configured])
1005
 
                with_arts=no
1006
 
        fi
1007
 
else
1008
 
        with_arts=no
1009
 
fi
1010
 
 
1011
 
dnl Set output drivers to none
1012
 
SOUND_DRIVERS=""
1013
 
GFXOUTPUT_DRIVERS=""
1014
 
 
1015
 
RESID_DIR=
1016
 
RESID_LIBS=
1017
 
RESID_INCLUDES=
1018
 
RESID_DEP=
1019
 
 
1020
 
RESID_FP_DIR=
1021
 
RESID_FP_LIBS=
1022
 
RESID_FP_INCLUDES=
1023
 
RESID_FP_DEP=
1024
 
 
1025
 
RESID_DTV_DIR=
1026
 
RESID_DTV_LIBS=
1027
 
RESID_DTV_INCLUDES=
1028
 
RESID_DTV_DEP=
1029
 
 
1030
 
 
1031
 
LINKCC='$(CC)'
1032
 
 
1033
 
dnl disable reSID-FP for certain platforms
1034
 
if test x"$host_os" = "xamigaos" -a x"$host_cpu" = "xm68k"; then
1035
 
  with_residfp=no
1036
 
fi
1037
 
 
1038
 
if test x"$is_unix_gp2x" = "xyes" -o x"$is_unix_wiz" = "xyes"; then
1039
 
  with_residfp=no
1040
 
fi
1041
 
 
1042
 
if test x"$host_os" = "xbeos" -a x"$host_cpu" = "xpowerpc"; then
1043
 
  with_residfp=no
1044
 
fi
1045
 
 
1046
 
dnl disable reSID for certain platforms
1047
 
 
1048
 
if test x"$with_resid" = "xno" -a x"$with_residfp" = "xno"; then
1049
 
  dnl Do not attempt to configure reSID(-fp).
1050
 
  dnl NOTE: no_recursion is set because directories specified with
1051
 
  dnl AC_CONFIG_SUBDIRS are always recursed into regardless of where the
1052
 
  dnl macro is used.
1053
 
  dnl Another workaround must be found if other self-contained packages go
1054
 
  dnl into VICE.
1055
 
  no_recursion=yes
1056
 
  dnl A workaround for an autoconf bug when not using/checking the C++
1057
 
  dnl compiler, we'll define am__fastdepCXX_TRUE as #
1058
 
  am__fastdepCXX_TRUE=#
1059
 
  am__fastdepCXX_FALSE=
1060
 
else
1061
 
  AC_LANG_SAVE
1062
 
  AC_LANG_CPLUSPLUS
1063
 
  AC_PROG_CXX
1064
 
 
1065
 
  dnl when using --host=, check if the C++ compiler is the intended cross compiler
1066
 
  if [[ x"$ac_cv_prog_cc_cross" != "xno" -a x"$toolchain_check" != "xno" ]]; then
1067
 
    if test x"$CXX" != "x" ; then
1068
 
      if test -n "$ac_tool_prefix"; then
1069
 
        valid_cxx=no
1070
 
        for cxx_compiler in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
1071
 
        do
1072
 
          if test x"$ac_tool_prefix$cxx_compiler" = x"$CXX"; then
1073
 
            valid_cxx=yes
1074
 
          fi
1075
 
        done
1076
 
 
1077
 
        if test x"$valid_cxx" = "xno"; then
1078
 
          AC_MSG_WARN([$CXX is not the intended cross-compiler, ReSID and ReSID-fp will not be configured])
1079
 
          with_resid=no
1080
 
          with_residfp=no
1081
 
          CXX=""
1082
 
        fi
1083
 
      fi
1084
 
    fi
1085
 
  fi
1086
 
 
1087
 
  dnl disable resid and residfp when no C++ compiler is found
1088
 
  if test x"$CXX" != "x" ; then
1089
 
    LINKCC='$(CXX)'
1090
 
 
1091
 
    dnl Set CXXFLAGS. Use -fno-exceptions for G++ if supported.
1092
 
    if test "$ac_test_CXXFLAGS" != set; then
1093
 
      if test "$GXX" = yes; then
1094
 
        CXXFLAGS="$CFLAGS -fno-exceptions"
1095
 
        AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works])
1096
 
        AC_TRY_COMPILE([],
1097
 
                       [ int test; ],
1098
 
                       [ AC_MSG_RESULT(yes) ],
1099
 
                       [ AC_MSG_RESULT(no)
1100
 
                         CXXFLAGS="$CFLAGS"
1101
 
                         ])
1102
 
      else
1103
 
        CXXFLAGS="$CFLAGS"
1104
 
      fi
1105
 
    fi
1106
 
    AC_PROG_CXXCPP
1107
 
  fi
1108
 
 
1109
 
  if test x"$with_resid" = "xyes" -o x"$with_resid" = "x"; then
1110
 
    AC_DEFINE(HAVE_RESID,,[This version provides ReSID support.])
1111
 
    AC_CONFIG_SUBDIRS(src/resid)
1112
 
    RESID_DIR=resid
1113
 
    RESID_LIBS="\$(top_builddir)/src/resid/libresid.a"
1114
 
    RESID_INCLUDES="-I\$(top_builddir)/src/resid"
1115
 
    RESID_DEP=libresid
1116
 
 
1117
 
    AC_DEFINE(HAVE_RESID_DTV,,[This version provides ReSID-DTV support.])
1118
 
    AC_CONFIG_SUBDIRS(src/resid-dtv)
1119
 
    RESID_DTV_DIR=resid-dtv
1120
 
    RESID_DTV_LIBS="\$(top_builddir)/src/resid-dtv/libresiddtv.a"
1121
 
    RESID_DTV_INCLUDES="-I\$(top_builddir)/src/resid-dtv"
1122
 
    RESID_DTV_DEP=libresiddtv
1123
 
  fi
1124
 
 
1125
 
  if test x"$with_residfp" != "xno"; then
1126
 
    AC_DEFINE(HAVE_RESID_FP,,[This version provides ReSID_FP support.])
1127
 
    AC_CONFIG_SUBDIRS(src/resid-fp)
1128
 
    RESID_FP_DIR=resid-fp
1129
 
    RESID_FP_LIBS="\$(top_builddir)/src/resid-fp/libresidfp.a"
1130
 
    RESID_FP_INCLUDES="-I\$(top_builddir)/src/resid-fp"
1131
 
    RESID_FP_DEP=libresidfp
1132
 
  fi
1133
 
 
1134
 
  AC_LANG_RESTORE
1135
 
fi
1136
 
 
1137
 
AC_SUBST(LINKCC)
1138
 
 
1139
 
AM_CONDITIONAL(HAVE_RESID, test x"$with_resid" != "xno")
1140
 
 
1141
 
AC_SUBST(RESID_DIR)
1142
 
AC_SUBST(RESID_LIBS)
1143
 
AC_SUBST(RESID_INCLUDES)
1144
 
AC_SUBST(RESID_DEP)
1145
 
 
1146
 
if test x"$with_residfp" = "xno"; then
1147
 
  AM_CONDITIONAL(HAVE_RESID_FP, false)
1148
 
else
1149
 
  AM_CONDITIONAL(HAVE_RESID_FP, true)
1150
 
fi
1151
 
 
1152
 
AC_SUBST(RESID_FP_DIR)
1153
 
AC_SUBST(RESID_FP_LIBS)
1154
 
AC_SUBST(RESID_FP_INCLUDES)
1155
 
AC_SUBST(RESID_FP_DEP)
1156
 
 
1157
 
AM_CONDITIONAL(HAVE_RESID_DTV, test x"$with_resid" != "xno")
1158
 
AC_SUBST(RESID_DTV_DIR)
1159
 
AC_SUBST(RESID_DTV_LIBS)
1160
 
AC_SUBST(RESID_DTV_INCLUDES)
1161
 
AC_SUBST(RESID_DTV_DEP)
1162
 
 
1163
 
dnl Check for typedefs, structures, and compiler characteristics.
1164
 
AC_CHECK_HEADERS(sys/types.h)
1165
 
 
1166
 
AC_TYPE_OFF_T
1167
 
AC_TYPE_PID_T
1168
 
AC_TYPE_SIZE_T
1169
 
 
1170
 
dnl Check whether inline functions are available.
1171
 
AC_C_INLINE
1172
 
if test x"$ac_cv_c_inline" = "xno" ; then
1173
 
  CFLAGS="$CFLAGS -DNO_INLINE"
1174
 
fi
1175
 
 
1176
 
dnl Define the type sizes.
1177
 
if [[ x"$ac_cv_prog_cc_cross" != "xyes" ]]; then
1178
 
  AC_C_BIGENDIAN
1179
 
else
1180
 
  dnl if cross-compiling, we have to do this by hand
1181
 
  echo "warning: assuming sizeof(unsigned short) == 2,"
1182
 
  echo "                  sizeof(unsigned int) == 4,"
1183
 
  echo "                  sizeof(unsigned long) == 4"
1184
 
fi
1185
 
 
1186
 
if test x"$cross_compiling" = "xyes"; then
1187
 
  AM_CONDITIONAL(CROSS, true)
1188
 
  CROSS=true
1189
 
else
1190
 
  AM_CONDITIONAL(CROSS, false)
1191
 
  CROSS=false
1192
 
fi
1193
 
AC_SUBST(CROSS)
1194
 
 
1195
 
AC_CHECK_SIZEOF(unsigned short, 2)
1196
 
AC_CHECK_SIZEOF(unsigned int, 4)
1197
 
AC_CHECK_SIZEOF(unsigned long, 4)
1198
 
 
1199
 
 
1200
 
dnl Check whether gcc needs -traditional.
1201
 
AC_PROG_GCC_TRADITIONAL
1202
 
 
1203
 
 
1204
 
dnl Check for header files.
1205
 
AC_HEADER_DIRENT
1206
 
AC_CHECK_HEADERS(direct.h errno.h fcntl.h limits.h regex.h unistd.h strings.h \
1207
 
sys/dirent.h sys/ioctl.h sys/stat.h inttypes.h libgen.h \
1208
 
dir.h io.h process.h signal.h alloca.h wchar.h stdint.h sys/time.h)
1209
 
 
1210
 
AC_CHECK_HEADER(regexp.h,,,[#define     INIT            register char *sp = instring;
1211
 
#define GETC()          (*sp++)
1212
 
#define PEEKC()         (*sp)
1213
 
#define UNGETC(c)       -- sp
1214
 
#define RETURN(ptr)     return NULL;
1215
 
#define ERROR(val)      _RegExpError(val)
1216
 
])
1217
 
AC_DECL_SYS_SIGLIST
1218
 
 
1219
 
dnl ----- Dynamic Lib Loading Support -----
1220
 
dynlib_support=no
1221
 
DYNLIB_LIBS=
1222
 
dnl check for dlopen support on unix systems
1223
 
if test x"$is_unix" = "xyes"; then
1224
 
  AC_CHECK_HEADER(dlfcn.h,,)
1225
 
  if test x"$ac_cv_header_dlfcn_h" = "xyes" ; then
1226
 
    AC_CHECK_FUNC(dlopen,
1227
 
                 [ DYNLIB_LIBS="";
1228
 
                   AC_DEFINE(HAVE_DYNLIB_SUPPORT,,
1229
 
                             [Support for dynamic library loading.])
1230
 
                   dynlib_support=yes
1231
 
                 ])
1232
 
    if test x"$dynlib_support" != "xyes" ; then
1233
 
      AC_CHECK_LIB(dl, dlopen,
1234
 
                 [ DYNLIB_LIBS="-ldl";
1235
 
                   AC_DEFINE(HAVE_DYNLIB_SUPPORT,,
1236
 
                             [Support for dynamic library loading.])
1237
 
                   dynlib_support=yes
1238
 
                   LIBS="-ldl $LIBS"
1239
 
                 ],,)
1240
 
    fi
1241
 
  fi
1242
 
elif test x"$is_win32" = "xyes" ; then
1243
 
  AC_DEFINE(HAVE_DYNLIB_SUPPORT,,[Support for dynamic library loading.])
1244
 
fi
1245
 
AC_SUBST(DYNLIB_LIBS)
1246
 
 
1247
 
dnl ----- Joystick support -----
1248
 
JOY_LIBS=
1249
 
if test x"$is_unix_x11" = "xyes" -a x"$enable_sdlui" != "xyes" ; then
1250
 
  AC_CHECK_HEADER(linux/joystick.h,
1251
 
                  [ AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
1252
 
                    AC_DEFINE(LINUX_JOYSTICK,,
1253
 
                              [Enable support for Linux style joysticks.])],)
1254
 
  if test x"$ac_cv_header_linux_joystick_h" = "xyes" ; then
1255
 
    AC_MSG_CHECKING(whether linux/joystick.h supports digital joysticks)
1256
 
    AC_TRY_COMPILE([ #include <linux/joystick.h> ],
1257
 
                   [ struct DJS_DATA_TYPE djs; ],
1258
 
                   [ AC_DEFINE(HAS_DIGITAL_JOYSTICK,,
1259
 
                               [Enable emulation for digital joysticks.])
1260
 
                     AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
1261
 
  fi
1262
 
 
1263
 
  AC_CHECK_HEADER(machine/joystick.h,
1264
 
                  [ AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
1265
 
                    AC_DEFINE(HAVE_MACHINE_JOYSTICK_H,,
1266
 
                              [Define to 1 if you have the <machine/joystick.h> header file.])
1267
 
                    AC_DEFINE(BSD_JOYSTICK,,
1268
 
                              [Enable support for BSD style joysticks.])],)
1269
 
 
1270
 
  if test x"$ac_cv_header_machine_joystick_h" != "xyes"; then
1271
 
    AC_CHECK_HEADER(sys/joystick.h,
1272
 
                    [ AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
1273
 
                      AC_DEFINE(HAVE_SYS_JOYSTICK_H,,
1274
 
                                [Define to 1 if you have the <sys/joystick.h> header file.])
1275
 
                      AC_DEFINE(BSD_JOYSTICK,,
1276
 
                                [Enable support for BSD style joysticks.])],)
1277
 
  fi
1278
 
 
1279
 
  dnl NetBSD/FreeBSD USB joystick support
1280
 
  usbhid_header=no
1281
 
  usbhid_lib=no
1282
 
  usb_lib=no
1283
 
  AC_CHECK_LIB(usbhid, hid_get_report_desc, usbhid_lib=yes)
1284
 
  if test x"$usbhid_lib" = "xyes" ; then
1285
 
    AC_CHECK_HEADER(usbhid.h,
1286
 
                    [AC_DEFINE(HAVE_USBHID_H,1,
1287
 
                      [Define to 1 if you have the <usbhid.h> header file.])
1288
 
                    usb_header=yes])
1289
 
    AC_CHECK_HEADER(libusbhid.h,
1290
 
                    [AC_DEFINE(HAVE_LIBUSBHID_H,1,
1291
 
                      [Define to 1 if you have the <libusbhid.h> header file.])
1292
 
                    usb_header=yes])
1293
 
 
1294
 
    if test x"$usb_header" = "xyes" ; then
1295
 
      AC_DEFINE(HAS_USB_JOYSTICK,,[Enable emulation for USB joysticks.])
1296
 
      JOY_LIBS="-lusbhid"
1297
 
    fi
1298
 
  else
1299
 
    AC_CHECK_LIB(usb, hid_get_report_desc, usb_lib=yes)
1300
 
    if test x"$usb_lib" = "xyes"; then
1301
 
      AC_CHECK_HEADER(usb.h,
1302
 
                      [AC_DEFINE(HAVE_USB_H,1,
1303
 
                        [Define to 1 if you have the <usb.h> header file.])
1304
 
                      usb_header=yes])
1305
 
      AC_CHECK_HEADER(libusb.h,
1306
 
                      [AC_DEFINE(HAVE_LIBUSB_H,1,
1307
 
                        [Define to 1 if you have the <libusb.h> header file.])
1308
 
                      usb_header=yes])
1309
 
      if test x"$usb_header" = "xyes" ; then
1310
 
        AC_DEFINE(HAS_USB_JOYSTICK,,[Enable emulation for USB joysticks.])
1311
 
        JOY_LIBS="-lusb"
1312
 
      fi
1313
 
    fi
1314
 
  fi
1315
 
fi
1316
 
 
1317
 
if test x"$is_unix_macosx" = "xyes" -a x"$enable_sdlui" != "xyes" ; then
1318
 
  dnl --- Mac joystick support ---
1319
 
  
1320
 
  dnl check for HID Manager
1321
 
  if test x"$enable_hidmgr" != "xno" ; then
1322
 
    AC_CHECK_HEADER(IOKit/hid/IOHIDManager.h,,)
1323
 
    if test x"$ac_cv_header_IOKit_hid_IOHIDManager_h" = "xyes" ; then
1324
 
      AC_MSG_CHECKING(whether we can link the (mac) IOHIDManager)
1325
 
      old_LIBS="${LIBS}"
1326
 
      LIBS="$LIBS -framework IOKit -framework CoreServices"
1327
 
      AC_TRY_LINK([#include <IOKit/hid/IOHIDManager.h>],
1328
 
                  [IOHIDManagerCreate(NULL,0)],
1329
 
                  [AC_MSG_RESULT(yes);
1330
 
                   JOY_LIBS="-framework IOKit -framework CoreServices";
1331
 
                   AC_DEFINE(HAS_JOYSTICK,,[Enable Joystick emulation.])
1332
 
                   AC_DEFINE(MAC_JOYSTICK,,[Enable Mac Joystick support.])
1333
 
                   AC_DEFINE(HAS_HIDMGR,,[Enable Mac IOHIDManager Joystick driver.])
1334
 
                   enable_hidutils=no
1335
 
                   ],
1336
 
                  [AC_MSG_RESULT(no);
1337
 
                   LIBS=${old_LIBS}])
1338
 
      LIBS="${old_LIBS}"
1339
 
    fi
1340
 
  fi
1341
 
  
1342
 
  dnl check for HID utility library
1343
 
  if test x"$enable_hidutils" != "xno" ; then
1344
 
    AC_CHECK_HEADER(HID_Utilities_External.h,,)
1345
 
    if test x"$ac_cv_header_HID_Utilities_External_h" = "xyes" ; then
1346
 
      AC_MSG_CHECKING(whether we can link the (mac) HIDUtilities library)
1347
 
      old_LIBS="${LIBS}"
1348
 
      LIBS="$LIBS -lHIDUtilities -framework IOKit -framework CoreServices"
1349
 
      AC_TRY_LINK([#include <HID_Utilities_External.h>],
1350
 
                  [HIDCountDevices()],
1351
 
                  [AC_MSG_RESULT(yes);
1352
 
                   JOY_LIBS="-lHIDUtilities -framework IOKit -framework CoreServices";
1353
 
                   AC_DEFINE(HAS_JOYSTICK,,[Enable Joystick emulation.])
1354
 
                   AC_DEFINE(MAC_JOYSTICK,,[Enable Mac Joystick support.])],
1355
 
                  [AC_MSG_RESULT(no);
1356
 
                   LIBS=${old_LIBS}])
1357
 
      LIBS="${old_LIBS}"
1358
 
    fi
1359
 
  fi
1360
 
fi
1361
 
AC_SUBST(JOY_LIBS)
1362
 
 
1363
 
dnl Check for math library
1364
 
AC_CHECK_HEADERS(math.h)
1365
 
AC_CHECK_LIB(m, sqrt,,,$LIBS)
1366
 
 
1367
 
 
1368
 
dnl ----- ZLib -----
1369
 
ZLIB_LIBS=
1370
 
 
1371
 
if test x"$with_zlib" != "xno" ; then
1372
 
  AC_CHECK_HEADER(zlib.h,,)
1373
 
  if test x"$ac_cv_header_zlib_h" = "xyes" ; then
1374
 
    ac_cv_lib_z_zlibVersion=yes
1375
 
    AC_CHECK_LIB(z, zlibVersion,
1376
 
               [ ZLIB_LIBS="-lz";
1377
 
                 AC_DEFINE(HAVE_ZLIB,,
1378
 
                 [Can we use the ZLIB compression library?]) ],,)
1379
 
  fi
1380
 
fi
1381
 
 
1382
 
AC_SUBST(ZLIB_LIBS)
1383
 
 
1384
 
 
1385
 
dnl ----- Netplay Support -----
1386
 
NETPLAY_LIBS=
1387
 
old_LIBS="$LIBS"
1388
 
if test x"$is_unix_x11" = "xyes" -o x"$is_dos" = "xyes" -o x"$is_unix_macosx" = "xyes"; then
1389
 
 
1390
 
  if test x"$host_os" != "xqnx"; then
1391
 
    dnl Check for needed network headers
1392
 
    UNIX_NETWORK_HEADERS_PRESENT=yes
1393
 
    AC_CHECK_HEADERS(sys/types.h unistd.h sys/socket.h sys/time.h sys/select.h netinet/in.h arpa/inet.h netdb.h,,
1394
 
                     [UNIX_NETWORK_HEADERS_PRESENT=no],)
1395
 
  else
1396
 
    LIBS="-lsocket -lunix $LIBS"
1397
 
  fi
1398
 
 
1399
 
  if test x"$UNIX_NETWORK_HEADERS_PRESENT" = "xyes"; then
1400
 
 
1401
 
    dnl Check for possible extra needed network libraries
1402
 
    AC_CHECK_LIB(intl, dgettext,[ NETPLAY_LIBS="-lintl $NETPLAY_LIBS";
1403
 
                                  LIBS="-lintl $LIBS"],,)
1404
 
    AC_CHECK_LIB(nsl, gethostbyname,[ NETPLAY_LIBS="-lnsl $NETPLAY_LIBS";
1405
 
                                      LIBS="-lnsl $LIBS"],,)
1406
 
    AC_CHECK_LIB(socket, gethostbyname,[ NETPLAY_LIBS="-lsocket $NETPLAY_LIBS";
1407
 
                                         LIBS="-lsocket $LIBS"],,)
1408
 
    AC_CHECK_LIB(bsd, gethostbyname,[ NETPLAY_LIBS="-lbsd $NETPLAY_LIBS";
1409
 
                                      LIBS="-lbsd $LIBS"],,)
1410
 
    AC_CHECK_LIB(net, gethostbyname,[ NETPLAY_LIBS="-lnet $NETPLAY_LIBS";
1411
 
                                      LIBS="-lnet $LIBS"],,)
1412
 
    AC_CHECK_LIB(inet, gethostbyname,[ NETPLAY_LIBS="-linet $NETPLAY_LIBS";
1413
 
                                       LIBS="-linet $LIBS"],,)
1414
 
    AC_CHECK_LIB(watt, gethostbyname,[ NETPLAY_LIBS="-lwatt $NETPLAY_LIBS";
1415
 
                                       LIBS="-lwatt $LIBS"],,)
1416
 
 
1417
 
    dnl Check for needed functions
1418
 
    UNIX_NETWORK_FUNCS_PRESENT=yes
1419
 
 
1420
 
    AC_CHECK_FUNCS(socket send bind listen gethostbyname connect recv accept,,
1421
 
                   [UNIX_NETWORK_FUNCS_PRESENT=no],)
1422
 
 
1423
 
    if test x"$UNIX_NETWORK_FUNCS_PRESENT" = "xyes"; then
1424
 
      AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
1425
 
      AC_CHECK_FUNCS(htons htonl)
1426
 
      AC_CHECK_FUNCS(getdtablesize getrlimit)
1427
 
      AC_MSG_CHECKING([For socklen_t])
1428
 
      AC_TRY_COMPILE([#include <sys/types.h>
1429
 
                      #include <sys/socket.h>],
1430
 
                     [socklen_t foo; foo = 1235;],
1431
 
                     [AC_DEFINE(HAVE_SOCKLEN_T,,[Define if the socklen_t type is present.])
1432
 
                      AC_MSG_RESULT(yes)],
1433
 
                     [AC_MSG_RESULT(no)])
1434
 
 
1435
 
      AC_MSG_CHECKING([for in_addr_t])
1436
 
      AC_TRY_COMPILE([#include <sys/types.h>
1437
 
                      #include <stdlib.h>
1438
 
                      #include <stddef.h>
1439
 
                      #include <netinet/in.h>], [in_addr_t foo;],
1440
 
                      [AC_DEFINE(HAVE_IN_ADDR_T,,[Define if the in_addr_t type is present.])
1441
 
                       AC_MSG_RESULT(yes)],
1442
 
                      [AC_MSG_RESULT(no)])
1443
 
    fi
1444
 
  fi
1445
 
elif test x"$is_beos" = "xyes"; then
1446
 
 
1447
 
  dnl Check for needed network headers
1448
 
  BEOS_NETWORK_HEADERS_PRESENT=yes
1449
 
  AC_CHECK_HEADERS(socket.h netdb.h byteorder.h,,
1450
 
                   [BEOS_NETWORK_HEADERS_PRESENT=no],)
1451
 
 
1452
 
  if test x"$BEOS_NETWORK_HEADERS_PRESENT" = "xyes"; then
1453
 
 
1454
 
    dnl Check for possible extra needed network libraries
1455
 
    AC_CHECK_LIB(net, gethostbyname,[ NETPLAY_LIBS="-lnet -lnetapi $NETPLAY_LIBS";
1456
 
                                      LIBS="-lnet -lnetapi $LIBS"],,)
1457
 
 
1458
 
    dnl Check for needed functions
1459
 
 
1460
 
    BEOS_NETWORK_FUNCS_PRESENT=yes
1461
 
 
1462
 
    AC_CHECK_FUNCS(socket send bind listen gethostbyname connect recv accept,,
1463
 
                   [BEOS_NETWORK_FUNCS_PRESENT=no],)
1464
 
 
1465
 
    if test x"$BEOS_NETWORK_FUNCS_PRESENT" = "xyes"; then
1466
 
      AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
1467
 
      AC_CHECK_FUNCS(getdtablesize getrlimit)
1468
 
    fi
1469
 
  fi
1470
 
fi
1471
 
 
1472
 
dnl Check for availability of IPV6
1473
 
if test x"$is_unix_x11" = "xyes" -o x"$is_dos" = "xyes" -o x"$is_unix_macosx" = "xyes" ; then
1474
 
  if test x"$UNIX_NETWORK_FUNCS_PRESENT" = "xyes"; then
1475
 
    AC_MSG_CHECKING([if IPV6 should be enabled])
1476
 
    if test x"$enable_ipv6" != "xno"; then
1477
 
      have_ipv6=no
1478
 
      AC_TRY_COMPILE([
1479
 
        #include <sys/socket.h>
1480
 
        #include <sys/types.h>
1481
 
        #include <netinet/in.h>], [
1482
 
        struct sockaddr_storage ss;
1483
 
        struct in6_addr in6;
1484
 
        socket(AF_INET6, SOCK_STREAM, 0);
1485
 
        in6 = in6addr_any;
1486
 
        ],
1487
 
        have_ipv6=yes,
1488
 
        have_ipv6=no
1489
 
      )
1490
 
      AC_MSG_RESULT($have_ipv6)
1491
 
 
1492
 
      if test $have_ipv6 = yes; then
1493
 
        have_broken_ss_family=no
1494
 
 
1495
 
        dnl on some platforms, the structure sockaddr doesn't have a
1496
 
        dnl ss_family, but __ss_family. If we find no ss_family then we
1497
 
        dnl check for __ss_family, and if found define NEED_PREFIXED_SS_FAMILY.
1498
 
        AC_MSG_CHECKING([struct sockaddr::ss_family])
1499
 
        AC_TRY_COMPILE([
1500
 
          #include <sys/socket.h>
1501
 
          #include <sys/types.h>], [
1502
 
          struct sockaddr_storage ss ;
1503
 
          ss.ss_family = 0 ;
1504
 
          ],
1505
 
          have_ss_family=yes,
1506
 
          have_ss_family=no
1507
 
        )
1508
 
        AC_MSG_RESULT($have_ss_family)
1509
 
        if test x"$have_ss_family" = "xno" ; then
1510
 
          AC_MSG_CHECKING([broken struct sockaddr::ss_family])
1511
 
          AC_TRY_COMPILE([
1512
 
            #include <sys/socket.h>
1513
 
            #include <sys/types.h>], [
1514
 
            struct sockaddr_storage ss ;
1515
 
            ss.__ss_family = 0 ;
1516
 
            ],
1517
 
            have_broken_ss_family=yes,
1518
 
            have_broken_ss_family=no
1519
 
          )
1520
 
          AC_MSG_RESULT($have_broken_ss_family)
1521
 
          if test x$have_broken_ss_family = xyes ; then
1522
 
            AC_DEFINE(NEED_PREFIXED_SS_FAMILY, [],
1523
 
            [Whether struct sockaddr::__ss_family exists]) 
1524
 
            AC_DEFINE(ss_family, __ss_family,
1525
 
            [ss_family is not defined here, use __ss_family instead])
1526
 
          else
1527
 
            AC_MSG_WARN(ss_family and __ss_family not found)
1528
 
          fi
1529
 
        fi
1530
 
 
1531
 
        have_gethostbyname2=no
1532
 
        AC_CHECK_FUNC(gethostbyname2, have_gethostbyname2=yes)
1533
 
        if test $have_gethostbyname2 = yes; then
1534
 
          AC_DEFINE([HAVE_GETHOSTBYNAME2], [], [Define if gethostbyname2 can be used])
1535
 
          AC_DEFINE([HAVE_IPV6], [], [Define if ipv6 can be used])
1536
 
        else
1537
 
          have_getipnodebyname=no
1538
 
          AC_CHECK_FUNC(getipnodebyname, have_getipnodebyname=yes)
1539
 
          if test $have_getipnodebyname = yes; then
1540
 
            AC_DEFINE([HAVE_GETIPNODEBYNAME], [], [Define if getipnodebyname can be used])
1541
 
            AC_DEFINE([HAVE_IPV6], [], [Define if ipv6 can be used])
1542
 
          fi
1543
 
        fi
1544
 
      fi
1545
 
    else
1546
 
      AC_MSG_RESULT("no")
1547
 
    fi
1548
 
  fi
1549
 
fi
1550
 
LIBS="$old_LIBS"
1551
 
AC_SUBST(NETPLAY_LIBS)
1552
 
 
1553
 
 
1554
 
dnl ----- FFMPEG -----
1555
 
PKG_PROG_PKG_CONFIG
1556
 
FFMPEG_INCLUDES=
1557
 
FFMPEG_LIBS=
1558
 
AC_MSG_CHECKING([for FFMPEG support])
1559
 
if test x"$enable_ffmpeg" != "xno"; then
1560
 
  if test x"$is_win32" = "xyes" ; then
1561
 
    dnl --- win32 ---
1562
 
    AC_MSG_RESULT([yes (internal)])
1563
 
    GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS ffmpegdrv.o ffmpeglib.o"
1564
 
    AC_DEFINE([HAVE_FFMPEG],,[Have FFMPEG av* libs available])
1565
 
    AC_DEFINE([HAVE_FFMPEG_SWSCALE],,[Have FFMPEG swscale lib available])
1566
 
    AC_DEFINE([HAVE_FFMPEG_HEADER_SUBDIRS],,[FFMPEG uses subdirs for headers])
1567
 
    FFMPEG_INCLUDES="-I\$(top_srcdir)/src/lib/libffmpeg"
1568
 
  elif test x"$is_unix" = "xyes" -a x"$dynlib_support" = "xyes" ; then
1569
 
    dnl --- unix (requires dynlib support) ---
1570
 
    AC_MSG_RESULT([via pkg-config])
1571
 
    PKG_CHECK_MODULES(FFMPEG_AV,  [libavcodec libavformat libavutil], 
1572
 
      [old_CFLAGS=$CFLAGS
1573
 
       old_CPPFLAGS=$CPPFLAGS
1574
 
       CFLAGS="$CFLAGS $FFMPEG_AV_CFLAGS"
1575
 
       CPPFLAGS="$CPPFLAGS $FFMPEG_AV_CFLAGS"
1576
 
 
1577
 
       AC_CHECK_HEADER(libavformat/avformat.h,
1578
 
        [AC_DEFINE([HAVE_FFMPEG_HEADER_SUBDIRS],,[FFMPEG uses subdirs for headers])],
1579
 
        [AC_CHECK_HEADER(avformat.h,,
1580
 
          [AC_MSG_ERROR([No suitable FFMPEG header found!])])])
1581
 
 
1582
 
       CFLAGS=$old_CFLAGS
1583
 
       CPPFLAGS=$old_CPPFLAGS
1584
 
 
1585
 
      PKG_CHECK_MODULES(FFMPEG_SWSCALE, [libswscale],
1586
 
        [have_swscale=yes],
1587
 
        [echo "no. trying img_convert"]
1588
 
        [old_LIBS=$LIBS]
1589
 
        [AC_CHECK_LIB(avcodec, img_convert,[have_imgconvert=yes])]
1590
 
        [LIBS=$old_LIBS]
1591
 
      )
1592
 
      if (test x"${have_swscale}" = x"yes") || (test x"${have_imgconvert}" = x"yes") ; then
1593
 
        AC_DEFINE([HAVE_FFMPEG],,[Have FFMPEG av* libs available])
1594
 
        FFMPEG_INCLUDES="$FFMPEG_AV_CFLAGS"
1595
 
        GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS ffmpegdrv.o ffmpeglib.o"
1596
 
      fi
1597
 
      if (test x"${have_swscale}" = x"yes") ; then
1598
 
        AC_DEFINE([HAVE_FFMPEG_SWSCALE],,[Have FFMPEG swscale lib available])
1599
 
        FFMPEG_INCLUDES="$FFMPEG_INCLUDES $FFMPEG_SWSCALE_CFLAGS"
1600
 
      fi
1601
 
       ],
1602
 
      [echo "no. disabled."]
1603
 
    )
1604
 
  else
1605
 
    AC_MSG_RESULT([not available])
1606
 
  fi
1607
 
else
1608
 
  AC_MSG_RESULT([disabled])
1609
 
fi
1610
 
AC_SUBST(FFMPEG_INCLUDES)
1611
 
AC_SUBST(FFMPEG_LIBS)
1612
 
 
1613
 
dnl ----- Apple QuickTime -----
1614
 
QUICKTIME_INCLUDES=
1615
 
QUICKTIME_LIBS=
1616
 
if test x"$enable_quicktime" = "xyes" -o x"$is_unix_macosx" = "xyes"; then
1617
 
 
1618
 
  dnl ---- Mac OS X -----
1619
 
  if test x"$is_unix_macosx" = x"yes" ; then
1620
 
    AC_CHECK_HEADER(QuickTime/QuickTime.h,,)
1621
 
    if test x"$ac_cv_header_QuickTime_QuickTime_h" = "xyes" ; then
1622
 
      AC_CHECK_HEADER(CoreVideo/CVPixelBuffer.h,,)
1623
 
      if test x"$ac_cv_header_CoreVideo_CVPixelBuffer_h" = "xyes" ; then
1624
 
        AC_MSG_CHECKING(whether we can link the QuickTime framework)
1625
 
        old_LIBS="${LIBS}"
1626
 
        LIBS="${LIBS} -framework QuickTime -framework CoreVideo"
1627
 
        AC_TRY_LINK([#include <QuickTime/Movies.h>
1628
 
                     #include <CoreVideo/CVPixelBuffer.h>],
1629
 
                    [EnterMovies(); CVPixelBufferGetTypeID();],
1630
 
                    [AC_MSG_RESULT(yes);
1631
 
                     GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS quicktimedrv.o"
1632
 
                     QUICKTIME_LIBS="-framework QuickTime -framework CoreVideo"
1633
 
                     AC_DEFINE(HAVE_QUICKTIME,,[Enable QuickTime support.])],
1634
 
                    [AC_MSG_RESULT(no)])
1635
 
        LIBS=${old_LIBS}
1636
 
      fi
1637
 
    fi
1638
 
  fi
1639
 
  dnl ----- Windows -----
1640
 
  if test x"$is_win32" = x"yes" ; then
1641
 
    echo "TODO"
1642
 
  fi
1643
 
 
1644
 
fi
1645
 
AC_SUBST(QUICKTIME_INCLUDES)
1646
 
AC_SUBST(QUICKTIME_LIBS)
1647
 
 
1648
 
dnl ----- Ethernet -----
1649
 
TFE_LIBS=
1650
 
DOS_TFE_PCAP_LIB=""
1651
 
if test x"$is_dos" = "xyes" ; then
1652
 
  if test x"$enable_ethernet" = "xyes"; then
1653
 
    old_LIBS="$LIBS"
1654
 
    AC_CHECK_LIB(watt, gethostbyname,[ AC_DEFINE(DOS_TCP,,[Can we use the dos WATTCP library?])
1655
 
                                       TFE_LIBS="-lwatt $TFE_LIBS";
1656
 
                                       LIBS="-lwatt $LIBS"],,)
1657
 
 
1658
 
    AC_CHECK_LIB(pcap, pcap_open_live,[ AC_DEFINE(DOS_TFE,,[Can we use the dos PCAP library?])
1659
 
                                        AC_DEFINE(HAVE_TFE,,[Support for The Final Ethernet])
1660
 
                                        TFE_LIBS="arch/msdos/libpcap_nodma.a $TFE_LIBS";
1661
 
                                        DOS_TFE_PCAP_LIB="libpcap_nodma.a";
1662
 
                                        LIBS="-lpcap $LIBS"],,)
1663
 
 
1664
 
    AC_CHECK_LIB(net, libnet_write_link_layer,[ AC_DEFINE(HAVE_DOS_LIBNET,,[Can we use the dos NET library?])
1665
 
                                        TFE_LIBS="-lnet $TFE_LIBS"],,)
1666
 
    LIBS=$old_LIBS
1667
 
  fi
1668
 
else
1669
 
  if test x"$is_win32" = "xno"; then
1670
 
    if test x"$enable_ethernet" = "xyes"; then
1671
 
    dnl libpcap.a
1672
 
      AC_CHECK_LIB(pcap, pcap_inject,[
1673
 
        AC_DEFINE(HAVE_TFE,,[Support for The Final Ethernet])
1674
 
        AC_DEFINE(HAVE_PCAP_INJECT,,[A libpcap version with pcap_inject is available])
1675
 
        TFE_LIBS="-lpcap"
1676
 
      ],,$LIBS)
1677
 
      AC_CHECK_LIB(pcap, pcap_sendpacket,[
1678
 
        AC_DEFINE(HAVE_TFE,,[Support for The Final Ethernet])
1679
 
        AC_DEFINE(HAVE_PCAP_SENDPACKET,,[A libpcap version with pcap_sendpacket is available])
1680
 
        TFE_LIBS="-lpcap"
1681
 
      ],,$LIBS)
1682
 
    dnl libpcap.a
1683
 
    dnl libnet.a
1684
 
      AC_CHECK_LIB(pcap, pcap_open_live,[
1685
 
        AC_CHECK_LIB(net, libnet_init,[
1686
 
          AC_DEFINE(HAVE_TFE,,[Support for The Final Ethernet])
1687
 
          AC_DEFINE(VICE_USE_LIBNET_1_1,,[Support for The Final Ethernet])
1688
 
          TFE_LIBS="-lpcap `libnet-config --libs`"
1689
 
          CFLAGS="$CFLAGS `libnet-config --defines`"
1690
 
      ],,$LIBS)],,$LIBS)
1691
 
    dnl libpcap.a
1692
 
    dnl libnet.a
1693
 
      AC_CHECK_LIB(pcap, pcap_open_live,[
1694
 
        AC_CHECK_LIB(net, libnet_write_link_layer,[
1695
 
          AC_DEFINE(HAVE_TFE,,[Support for The Final Ethernet])
1696
 
          TFE_LIBS="-lpcap `libnet-config --libs`"
1697
 
          CFLAGS="$CFLAGS `libnet-config --defines`"
1698
 
      ],,$LIBS)],,$LIBS)
1699
 
    fi
1700
 
  fi
1701
 
fi
1702
 
AC_SUBST(DOS_TFE_PCAP_LIB)
1703
 
AC_SUBST(TFE_LIBS)
1704
 
 
1705
 
dnl Check and setup SDL compilation.
1706
 
if test x"$with_sdlsound" = "xyes" -o x"$enable_sdlui" = "xyes"; then
1707
 
 
1708
 
    if test x"$enable_dingoo" = "xyes"; then
1709
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o"
1710
 
        AC_DEFINE(USE_SDL_AUDIO,,[Enable sdl sound support.])
1711
 
        if test x"$enable_sdlui" = "xyes"; then
1712
 
            AC_DEFINE(USE_SDLUI,,[Enable sdl ui support.])
1713
 
        fi
1714
 
        AC_DEFINE(HAVE_FULLSCREEN,,[Enable Fullscreen support.])
1715
 
    elif test x"$is_unix_macosx" = "xyes"; then
1716
 
        LIBS="$LIBS -lSDLmain -framework SDL -framework Cocoa -framework OpenGL -framework CoreVideo"
1717
 
        CFLAGS="$CFLAGS -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers"
1718
 
        CXXFLAGS="$CXXFLAGS -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers"
1719
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o"
1720
 
        AC_DEFINE(USE_SDL_AUDIO,,[Enable SDL sound support.])
1721
 
        if test x"$enable_sdlui" = "xyes"; then
1722
 
            AC_DEFINE(USE_SDLUI,,[Enable SDL UI support.])
1723
 
        fi
1724
 
        AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling])
1725
 
        AC_DEFINE(HAVE_FULLSCREEN,,[Enable Fullscreen support.])
1726
 
        AC_CHECK_FUNCS(SDL_NumJoysticks)
1727
 
    elif test x"$host_os" = "xmingw32ce" -o x"$host_os" = "xcegcc"; then
1728
 
        LIBS="$LIBS -lSDL -lwinsock"
1729
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o"
1730
 
        AC_DEFINE(USE_SDL_AUDIO,,[Enable SDL sound support.])
1731
 
        if test x"$enable_sdlui" = "xyes"; then
1732
 
            AC_DEFINE(USE_SDLUI,,[Enable SDL UI support.])
1733
 
        fi
1734
 
        AC_DEFINE(CEGCC_COMPILE,,[Enable cegcc support.])
1735
 
    elif test x"$is_amiga" = "xyes"; then
1736
 
        if test x"$enable_sdlui" = "xyes"; then
1737
 
            AC_DEFINE(USE_SDLUI,,[Enable SDL UI support.])
1738
 
        fi
1739
 
        AC_CHECK_HEADER(inline/SDL.h,[SDL_AMIGA_INLINE=yes], [SDL_AMIGA_INLINE=no],)
1740
 
        AC_CHECK_HEADER(ppcinline/powersdl.h,[POWERSDL_AMIGA_INLINE=yes], [POWERSDL_AMIGA_INLINE=no],)
1741
 
        AC_CHECK_LIB(debug, kprintf, [LIBS="$LIBS -ldebug"])
1742
 
        AC_CHECK_LIB(GL, AROSMesaCreateContext, [LIBS="$LIBS -lGL"])
1743
 
        if test x"$SDL_AMIGA_INLINE" = "xyes"; then
1744
 
            AC_DEFINE(SDL_AMIGA_INLINE,,[Enable amiga shared SDL library support.])
1745
 
            AC_DEFINE(HAVE_SDL_NUMJOYSTICKS,, [Define to 1 if you have the `SDL_NumJoysticks' function.])
1746
 
        elif test x"$POWERSDL_AMIGA_INLINE" = "xyes"; then
1747
 
            AC_DEFINE(POWERSDL_AMIGA_INLINE,,[Enable morphos shared SDL library support.])
1748
 
            AC_DEFINE(HAVE_SDL_NUMJOYSTICKS,, [Define to 1 if you have the `SDL_NumJoysticks' function.])
1749
 
        else
1750
 
            AC_CHECK_LIB(SDL, SDL_SetVideoMode, [found_sdl_lib=yes], [found_sdl_lib=no])
1751
 
            if test x"$found_sdl_lib" = "xno"; then
1752
 
                AC_MSG_ERROR([static SDL lib missing])
1753
 
            else
1754
 
                LIBS="-lSDL $LIBS"
1755
 
            fi
1756
 
            AC_CHECK_LIB(SDL, SDL_OpenAudio, [found_sdl_sound=yes], [found_sdl_sound=no])
1757
 
            if test x"$found_sdl_sound" = "xyes"; then
1758
 
                SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o";
1759
 
                AC_DEFINE(USE_SDL_AUDIO,,[Enable SDL sound support.])
1760
 
            fi
1761
 
            AC_CHECK_FUNCS(SDL_NumJoysticks)
1762
 
        fi
1763
 
        AC_CHECK_HEADER(SDL/SDL.h, [found_sdl_h=yes], [found_sdl_h=no],)
1764
 
        if test x"$found_sdl_h" = "xyes"; then
1765
 
            AC_DEFINE(USE_SDL_PREFIX,,[Enable SDL prefix for header inclusion.])
1766
 
            if test x"$found_sdl_sound" = "xyes"; then
1767
 
                AC_CHECK_HEADER(SDL/SDL_audio.h, [], [AC_MSG_ERROR([SDL headers missing])],)
1768
 
            fi
1769
 
        else
1770
 
            AC_CHECK_HEADER(SDL.h, [found_sdl_h=yes], [found_sdl_h=no],)
1771
 
            if test x"$found_sdl_h" = "xno"; then
1772
 
                AC_MSG_ERROR([SDL headers missing])
1773
 
            fi
1774
 
            if test x"$found_sdl_sound" = "xyes"; then
1775
 
                AC_CHECK_HEADER(SDL_audio.h, [], [AC_MSG_ERROR([SDL headers missing])],)
1776
 
            fi
1777
 
        fi
1778
 
    else
1779
 
 
1780
 
        dnl check for sdl-config
1781
 
        AC_CHECK_TOOLS(sdl_config, sdl-config, no)
1782
 
 
1783
 
        old_cflags=$CFLAGS
1784
 
        old_cxxflags=$CXXFLAGS
1785
 
        old_libs=$LIBS
1786
 
 
1787
 
        dnl if no sdl-config was found we assume that there are no extra CFLAGS
1788
 
        dnl and that libSDL can be found in the default lib search path
1789
 
        if test x"$sdl_config" = "xno"; then
1790
 
            LIBS="$LIBS -lSDL"
1791
 
        else
1792
 
            CFLAGS="$CFLAGS `$sdl_config --cflags`"
1793
 
            CXXFLAGS="$CXXFLAGS `$sdl_config --cflags`"
1794
 
            LIBS="$LIBS `$sdl_config --libs`"
1795
 
        fi
1796
 
 
1797
 
 
1798
 
        AC_CHECK_HEADERS(SDL/SDL_audio.h,[AC_CHECK_LIB(SDL, SDL_OpenAudio,
1799
 
                         [SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o";
1800
 
                          use_sdl_prefix=yes;
1801
 
                          AC_DEFINE(USE_SDL_PREFIX,,[Enable SDL prefix for header inclusion.])
1802
 
                          AC_DEFINE(USE_SDL_AUDIO,,[Enable SDL sound support.])],
1803
 
                         [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break],$SOUND_LIBS $EXTRA_SDL_LIBS)],
1804
 
                         [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break])
1805
 
 
1806
 
        if test x"$ac_cv_lib_SDL_SDL_OpenAudio" != "xyes"; then
1807
 
            unset ac_cv_lib_SDL_SDL_OpenAudio
1808
 
            AC_CHECK_HEADERS(SDL_audio.h,[AC_CHECK_LIB(SDL, SDL_OpenAudio,
1809
 
                             [SOUND_DRIVERS="$SOUND_DRIVERS soundsdl.o";
1810
 
                              use_sdl_prefix=no;
1811
 
                              AC_DEFINE(USE_SDL_AUDIO,,[Enable SDL sound support.])],
1812
 
                             [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break],$SOUND_LIBS $EXTRA_SDL_LIBS)],
1813
 
                             [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break])
1814
 
        fi
1815
 
 
1816
 
        if test x"$ac_cv_lib_SDL_SDL_OpenAudio" != "xyes"; then
1817
 
            with_sdlsound=no
1818
 
        else
1819
 
            SOUND_LIBS="$SOUND_LIBS $EXTRA_SDL_LIBS"
1820
 
        fi
1821
 
 
1822
 
        if test x"$enable_sdlui" = "xyes"; then
1823
 
            AC_CHECK_HEADERS(SDL/SDL.h,[AC_CHECK_LIB(SDL, SDL_SetVideoMode,
1824
 
                             [use_sdl_prefix=yes;
1825
 
                              AC_DEFINE(USE_SDL_PREFIX,,[Enable SDL prefix for header inclusion.])
1826
 
                              AC_DEFINE(USE_SDLUI,,[Enable SDL UI support.])],
1827
 
                             [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break],$EXTRA_SDL_LIBS)],
1828
 
                             [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break])
1829
 
 
1830
 
            if test x"$ac_cv_lib_SDL_SDL_SetVideoMode" != "xyes"; then
1831
 
                unset ac_cv_lib_SDL_SDL_SetVideoMode
1832
 
                AC_CHECK_HEADERS(SDL.h,[AC_CHECK_LIB(SDL, SDL_SetVideoMode,
1833
 
                                 [use_sdl_prefix=no;
1834
 
                                  AC_DEFINE(USE_SDLUI,,[Enable SDL UI support.])],
1835
 
                                 [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break],$EXTRA_SDL_LIBS)],
1836
 
                                 [CFLAGS=$old_cflags; CXXFLAGS=$old_cxxflags; LIBS=$old_libs; break])
1837
 
            fi
1838
 
 
1839
 
            if test x"$ac_cv_lib_SDL_SDL_SetVideoMode" != "xyes"; then
1840
 
                AC_MSG_ERROR([SDL headers and/or libraries missing])
1841
 
            else
1842
 
                AC_DEFINE(HAVE_FULLSCREEN,,[Enable Fullscreen support.])
1843
 
            fi
1844
 
 
1845
 
            if test x"$ac_cv_lib_SDL_SDL_OpenAudio" != "xyes"; then
1846
 
                LIBS="$LIBS $EXTRA_SDL_LIBS"
1847
 
            fi
1848
 
 
1849
 
            AC_CHECK_FUNCS(SDL_NumJoysticks)
1850
 
 
1851
 
            dnl check for opengl libs.
1852
 
            AC_MSG_CHECKING(whether we can use the GL library)
1853
 
 
1854
 
            old_LIBS="$LIBS"
1855
 
            LIBS="$LIBS -lGL"
1856
 
            if test x"$use_sdl_prefix" = "xyes"; then
1857
 
                AC_TRY_LINK([#include <SDL/SDL_opengl.h>],
1858
 
                            [glViewport(1,2,3,4)],
1859
 
                            [AC_MSG_RESULT(yes);
1860
 
                             have_opengl_lib=yes],
1861
 
                            [AC_MSG_RESULT(no);
1862
 
                             LIBS="$old_LIBS"])
1863
 
            else
1864
 
                AC_TRY_LINK([#include <SDL_opengl.h>],
1865
 
                            [glViewport(1,2,3,4)],
1866
 
                            [AC_MSG_RESULT(yes);
1867
 
                             have_opengl_lib=yes],
1868
 
                            [AC_MSG_RESULT(no);
1869
 
                             LIBS="$old_LIBS"])
1870
 
            fi
1871
 
 
1872
 
            if test x"$have_opengl_lib" != "xyes"; then
1873
 
                AC_MSG_CHECKING(whether we can use the opengl32 library)
1874
 
                old_LIBS="$LIBS"
1875
 
                LIBS="$LIBS -lopengl32"
1876
 
                if test x"$use_sdl_prefix" = "xyes"; then
1877
 
                    AC_TRY_LINK([#include <SDL/SDL_opengl.h>],
1878
 
                                [glViewport(1,2,3,4)],
1879
 
                                [AC_MSG_RESULT(yes);
1880
 
                                 have_opengl_lib=yes],
1881
 
                                [AC_MSG_RESULT(no);
1882
 
                                 LIBS="$old_LIBS"])
1883
 
                else
1884
 
                    AC_TRY_LINK([#include <SDL_opengl.h>],
1885
 
                                [glViewport(1,2,3,4)],
1886
 
                                [AC_MSG_RESULT(yes);
1887
 
                                 have_opengl_lib=yes],
1888
 
                                [AC_MSG_RESULT(no);
1889
 
                                 LIBS="$old_LIBS"])
1890
 
                fi
1891
 
            fi
1892
 
 
1893
 
            if test x"$have_opengl_lib" = "xyes"; then
1894
 
                AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling])
1895
 
            fi
1896
 
 
1897
 
            dnl check for the SDL_main.h header
1898
 
            if test x"$use_sdl_prefix" = "xyes"; then
1899
 
                AC_CHECK_HEADERS(SDL/SDL_main.h)
1900
 
            else
1901
 
                AC_CHECK_HEADERS(SDL_main.h)
1902
 
            fi
1903
 
 
1904
 
            AC_MSG_CHECKING(whether we can use the SDLmain library)
1905
 
            old_LIBS="$LIBS"
1906
 
            LIBS="$LIBS -lSDLmain -lSDL $EXTRA_SDL_LIBS"
1907
 
            if test x"$use_sdl_prefix" = "xyes"; then
1908
 
                AC_TRY_LINK([#include <SDL/SDL_main.h>
1909
 
                             int main(int argc, char *argv[])
1910
 
                             { return 0; }
1911
 
                             #undef main
1912
 
                             #define main something_else],
1913
 
                            [return 0;],
1914
 
                            [AC_MSG_RESULT(yes);
1915
 
                             have_sdlmain=yes],
1916
 
                            [AC_MSG_RESULT(no);
1917
 
                             LIBS="$old_LIBS"])
1918
 
            else
1919
 
                AC_TRY_LINK([#include <SDL_main.h>
1920
 
                             int main(int argc, char *argv[])
1921
 
                             { return 0; }
1922
 
                             #undef main
1923
 
                             #define main something_else],
1924
 
                            [return 0;],
1925
 
                            [AC_MSG_RESULT(yes);
1926
 
                             have_sdlmain=yes],
1927
 
                            [AC_MSG_RESULT(no);
1928
 
                             LIBS="$old_LIBS"])
1929
 
            fi
1930
 
 
1931
 
            if test x"$have_sdlmain" != "xyes"; then
1932
 
                AC_MSG_CHECKING(whether we can use the SDLmain library when adding -lmingw32)
1933
 
                old_LIBS="$LIBS"
1934
 
                LIBS="$LIBS -lmingw32 -lSDLmain -lSDL"
1935
 
                if test x"$use_sdl_prefix" = "xyes"; then
1936
 
                    AC_TRY_LINK([#include <SDL/SDL_main.h>
1937
 
                                 int main(int argc, char *argv[])
1938
 
                                 { return 0; }
1939
 
                                 #undef main
1940
 
                                 #define main something_else],
1941
 
                                [return 0;],
1942
 
                                [AC_MSG_RESULT(yes);
1943
 
                                 have_sdlmain=yes],
1944
 
                                [AC_MSG_RESULT(no);
1945
 
                                 LIBS="$old_LIBS"])
1946
 
                else
1947
 
                    AC_TRY_LINK([#include <SDL_main.h>
1948
 
                                 int main(int argc, char *argv[])
1949
 
                                 { return 0; }
1950
 
                                 #undef main
1951
 
                                 #define main something_else],
1952
 
                                [return 0;],
1953
 
                                [AC_MSG_RESULT(yes);
1954
 
                                 have_sdlmain=yes],
1955
 
                                [AC_MSG_RESULT(no);
1956
 
                                 LIBS="$old_LIBS"])
1957
 
                fi
1958
 
            fi
1959
 
 
1960
 
            if test x"$have_sdlmain" = "xyes"; then
1961
 
                AC_DEFINE(HAVE_SDLMAIN,,[Enable SDLmain replacement])
1962
 
            fi
1963
 
 
1964
 
            AC_MSG_CHECKING(whether we can use directx sound)
1965
 
            old_LIBS="$LIBS"
1966
 
            LIBS="$LIBS -ldsound"
1967
 
            AC_TRY_LINK([#define DIRECTSOUND_VERSION 0x500
1968
 
                             #include <dsound.h>],
1969
 
                            [LPDIRECTSOUNDBUFFER buffer=NULL;
1970
 
                             IDirectSoundBuffer_Restore(buffer);],
1971
 
                            [AC_MSG_RESULT(yes);
1972
 
                             SOUND_DRIVERS="$SOUND_DRIVERS sounddx.o";
1973
 
                             SOUND_LIBS="$SOUND_LIBS -ldsound";
1974
 
                             AC_DEFINE(USE_DXSOUND,,[Enable directx sound support.])
1975
 
                             AC_DEFINE(HAVE_DSOUND_LIB, [], [dsound.lib or libdsound.a are present])],
1976
 
                            [AC_MSG_RESULT(no)])
1977
 
            LIBS="$old_LIBS"
1978
 
 
1979
 
            if test x"$is_unix_gp2x" = "xyes" -o x"$is_unix_wiz" = "xyes"; then
1980
 
                LIBS="$LIBS -lpthread"
1981
 
            fi
1982
 
        fi
1983
 
    fi
1984
 
fi
1985
 
 
1986
 
dnl ----- Sound Drivers -----
1987
 
if test x"$is_unix" = "xyes"; then
1988
 
  AC_CHECK_HEADERS(cwsid.h, AC_DEFINE(HAVE_CATWEASELMKIII,,
1989
 
                   [Support for Catweasel MKIII.]), )
1990
 
 
1991
 
  if test x"$with_pulse" != "xno"; then
1992
 
    AC_CHECK_HEADERS(pulse/simple.h,[AC_CHECK_LIB(pulse-simple, pa_simple_new,
1993
 
                     [SOUND_DRIVERS="$SOUND_DRIVERS soundpulse.o";
1994
 
                      SOUND_LIBS="$SOUND_LIBS -lpulse-simple -lpulse";
1995
 
                      AC_DEFINE(USE_PULSE,,[Enable pulseaudio support.])],,$SOUND_LIBS)])
1996
 
  fi
1997
 
 
1998
 
  if test x"$with_arts" = "xyes"; then
1999
 
    old_cflags=$CFLAGS
2000
 
    old_libs=$LIBS
2001
 
    CFLAGS="$CFLAGS `artsc-config --cflags`"
2002
 
    LIBS="$LIBS `artsc-config --libs`"
2003
 
    AC_CHECK_HEADERS(artsc.h,[AC_CHECK_LIB(artsc, arts_init,
2004
 
                     [SOUND_DRIVERS="$SOUND_DRIVERS soundarts.o"; break],
2005
 
                     [CFLAGS=$old_cflags; LIBS=$old_libs; with_arts=no; break],$SOUND_LIBS)],
2006
 
                     [CFLAGS=$old_cflags; LIBS=$old_libs; with_arts=no; break])
2007
 
  fi
2008
 
 
2009
 
  if test x"$with_arts" = "xyes"; then
2010
 
    AC_DEFINE(USE_ARTS,,[Enable aRts support.])
2011
 
  fi
2012
 
 
2013
 
  if test x"$with_alsa" != "xno" -a x"$is_unix_gp2x" != "xyes" -a x"$is_unix_wiz" != "xyes"; then
2014
 
    AC_CHECK_HEADERS(alsa/asoundlib.h,[AC_CHECK_LIB(asound, snd_pcm_open,
2015
 
                     [SOUND_DRIVERS="$SOUND_DRIVERS soundalsa.o";
2016
 
                      SOUND_LIBS="$SOUND_LIBS -lasound";
2017
 
                      AC_DEFINE(USE_ALSA,,[Enable alsa support.])],,$SOUND_LIBS)])
2018
 
    AC_CHECK_LIB(asound, snd_pcm_avail,
2019
 
                 [AC_DEFINE(HAVE_SND_PCM_AVAIL,,[Use more accurate buffer fill reporting])])
2020
 
  fi
2021
 
 
2022
 
  if test x"$with_oss" != "xno" -a x"$host_os" != "uwin"; then
2023
 
    AC_CHECK_HEADERS(linux/soundcard.h machine/soundcard.h sys/soundcard.h soundcard.h,
2024
 
                     [SOUND_DRIVERS="$SOUND_DRIVERS sounduss.o";
2025
 
                      AC_DEFINE(USE_OSS,,[Enable oss support.])])
2026
 
    AC_CHECK_LIB(ossaudio, _oss_ioctl,,,$SOUND_LIBS)
2027
 
  fi
2028
 
 
2029
 
  AC_CHECK_HEADERS(dmedia/audio.h, [AC_CHECK_LIB(audio, ALseterrorhandler,
2030
 
                   [SOUND_DRIVERS="$SOUND_DRIVERS soundsgi.o";
2031
 
                    SOUND_LIBS="$SOUND_LIBS -laudio";
2032
 
                    AC_DEFINE(USE_DMEDIA,,[Enable sgi sound support.])],,$SOUND_LIBS)])
2033
 
 
2034
 
  AC_CHECK_HEADERS(sys/audioio.h,
2035
 
                   [SOUND_DRIVERS="$SOUND_DRIVERS soundsun.o"; break])
2036
 
 
2037
 
  case "$host_os" in
2038
 
    hpux*)
2039
 
      AC_CHECK_HEADERS(sys/audio.h,
2040
 
                       [SOUND_DRIVERS="$SOUND_DRIVERS soundhpux.o"; break])
2041
 
      ;;
2042
 
    *)
2043
 
      ;;
2044
 
  esac
2045
 
 
2046
 
  AC_CHECK_HEADERS(UMS/UMSAudioDevice.h,[AC_CHECK_HEADERS(UMS/UMSBAUDDevice.h,
2047
 
                   [AC_CHECK_LIB(UMSobj, UMSAudioDevice_initialize,
2048
 
                    [SOUND_DRIVERS="$SOUND_DRIVERS soundaix.o";
2049
 
                     SOUND_LIBS="$SOUND_LIBS -lUMSobj";
2050
 
                     AC_DEFINE(USE_AIX_AUDIO,,[Enable aix sound support.])],,$SOUND_LIBS)])])
2051
 
fi
2052
 
 
2053
 
if test x"$is_amiga" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2054
 
  AC_CHECK_HEADERS(devices/ahi.h,
2055
 
                   [SOUND_DRIVERS="$SOUND_DRIVERS soundahi.o"; break])
2056
 
fi
2057
 
 
2058
 
dnl --- Lame ---
2059
 
if test x"$enable_lame" != "xno" ; then
2060
 
 
2061
 
  AC_CHECK_HEADER(lame/lame.h,,)
2062
 
  
2063
 
  dnl the header is available!
2064
 
  if test "$ac_cv_header_lame_lame_h" != "no" ; then
2065
 
    AC_MSG_CHECKING([for lame lib linking])
2066
 
    if test x"$dynlib_support" = "xyes" -a x"$enable_static_lame" != "xyes" ; then
2067
 
      dnl dynlib linking
2068
 
      SOUND_DRIVERS="$SOUND_DRIVERS soundmp3.o lamelib.o"
2069
 
      AC_DEFINE(USE_LAMEMP3,,[Enable lamemp3 support.])
2070
 
      AC_MSG_RESULT([dynlib])
2071
 
    else
2072
 
      dnl try static linking
2073
 
      AC_MSG_RESULT([trying static])
2074
 
      AC_CHECK_LIB(mp3lame, lame_encode_buffer,[ADD_MPGDECODER=0],,)
2075
 
      if test "$ac_cv_lib_mp3lame_lame_encode_buffer" = "no"; then
2076
 
        unset ac_cv_lib_mp3lame_lame_encode_buffer
2077
 
        AC_CHECK_LIB(mp3lame, lame_encode_buffer,[ADD_MPGDECODER=1],,[-lmpgdecoder])
2078
 
      fi
2079
 
      if test "$ac_cv_lib_mp3lame_lame_encode_buffer" != "no"; then
2080
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundmp3.o";
2081
 
        SOUND_LIBS="$SOUND_LIBS -lmp3lame";
2082
 
        if test "$ADD_MPGDECODER" = "1" ; then
2083
 
          SOUND_LIBS="$SOUND_LIBS -lmpgdecoder";
2084
 
        fi
2085
 
        AC_DEFINE(USE_LAMEMP3,,[Enable lamemp3 support.])
2086
 
        AC_DEFINE(HAVE_STATIC_LAME,,[Static linking for lame libs])
2087
 
      fi
2088
 
    fi
2089
 
  fi
2090
 
 
2091
 
fi
2092
 
 
2093
 
AC_PATH_PROGS(FCCACHE, fc-cache, false)
2094
 
if test x"$FCCACHE" = "xfalse"; then
2095
 
  AM_CONDITIONAL(HAVE_FC_CACHE, false)
2096
 
else
2097
 
  AM_CONDITIONAL(HAVE_FC_CACHE, true)
2098
 
fi
2099
 
 
2100
 
if test x"$is_amigaos4" = "xyes"; then
2101
 
  if test x"$enable_sdlui" != "xyes"; then
2102
 
      AC_MSG_CHECKING(whether devices/timer.h defines TimeVal)
2103
 
      AC_TRY_COMPILE([ #include <devices/timer.h> ],
2104
 
                     [ struct TimeVal djs; ],
2105
 
                     [ AC_DEFINE(AMIGA_OS4_ALT,,
2106
 
                                 [Enable alternate OS4 includes.])
2107
 
                       AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
2108
 
  fi
2109
 
 
2110
 
  dnl for AmigaOS4 native resid needs to be configured without dependency tracking
2111
 
    if test x"$cross_compiling" != "xyes"; then
2112
 
    ac_configure_args="$ac_configure_args --disable-dependency-tracking"
2113
 
  fi
2114
 
fi
2115
 
 
2116
 
if test x"$is_dos" = "xyes"; then
2117
 
    if test x"$with_midas" = "xyes"; then
2118
 
        AC_CHECK_HEADERS(midasdll.h,
2119
 
                         [SOUND_DRIVERS="$SOUND_DRIVERS soundmidas.o"; break])
2120
 
    else
2121
 
        AC_CHECK_HEADERS(allegro.h,
2122
 
                         [SOUND_DRIVERS="$SOUND_DRIVERS soundallegro.o"; break])
2123
 
    fi
2124
 
fi
2125
 
 
2126
 
dsound_header_no_lib="no"
2127
 
 
2128
 
if test x"$is_win32" = "xyes"; then
2129
 
    if test x"$enable_sdlui" != "xyes"; then
2130
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundwmm.o"
2131
 
        AC_MSG_CHECKING(whether we can use directx sound)
2132
 
        AC_CHECK_HEADER(dsound.h,
2133
 
              [ AC_DEFINE(USE_DXSOUND,,[Enable directx sound support.]) ]
2134
 
              [ SOUND_DRIVERS="$SOUND_DRIVERS sounddx.o" ]
2135
 
              [ AC_MSG_CHECKING(for -ldsound) ]
2136
 
              [ old_LIBS="$LIBS" ]
2137
 
              [ LIBS="$LIBS -ldsound" ]
2138
 
              [ AC_LINK_IFELSE([
2139
 
                               AC_LANG_PROGRAM(
2140
 
                                               [#define DIRECTSOUND_VERSION 0x500
2141
 
                                                #include <dsound.h>],
2142
 
                                               [LPDIRECTSOUNDBUFFER buffer=NULL;
2143
 
                                                IDirectSoundBuffer_Restore(buffer);]
2144
 
                                              )
2145
 
                               ],
2146
 
                            [ AC_DEFINE(HAVE_DSOUND_LIB, [], [dsound.lib or libdsound.a are present]) ]
2147
 
                            [ AC_MSG_RESULT(yes) ]
2148
 
                            [ SOUND_LIBS="$SOUND_LIBS -ldsound" ],
2149
 
                            [ AC_MSG_RESULT(no) ]
2150
 
                            [ dsound_header_no_lib="yes" ]
2151
 
              )]
2152
 
              [ LIBS="$old_LIBS" ]
2153
 
        )
2154
 
 
2155
 
        if test x"$dsound_header_no_lib" == "xyes" -o x"$dinput_header_no_lib" == "xyes"; then
2156
 
              AC_MSG_CHECKING(if CoInitialize can be linked)
2157
 
              LIBS="$LIBS -lole32"
2158
 
              AC_LINK_IFELSE([
2159
 
                               AC_LANG_PROGRAM(
2160
 
                                               [#include <objbase.h>],
2161
 
                                               [CoInitialize(NULL);]
2162
 
                                              )
2163
 
                               ],
2164
 
                               [ AC_MSG_RESULT(yes) ],
2165
 
                               [ AC_MSG_ERROR(no) ]
2166
 
                              )
2167
 
        fi
2168
 
 
2169
 
        AC_PATH_TOOL(WINDRES, windres, windres)
2170
 
        AC_PATH_PROGS(WRC, wrc , windres)
2171
 
        if test x"$WRC" != "xwindres"; then
2172
 
            WRC_VERSION=`($WRC --version) 2>/dev/null`
2173
 
            case "$WRC_VERSION" in
2174
 
                Wine*)
2175
 
                    winerc=yes
2176
 
                    ;;
2177
 
                *)
2178
 
                    winerc=no
2179
 
                    AC_MSG_WARN([WRC found, but is not the Wine Resource Compiler])
2180
 
                    WRC="$WINDRES"
2181
 
                    ;;
2182
 
            esac
2183
 
        else
2184
 
            AC_MSG_WARN([WRC not found, WRC is required for propper internationalization support])
2185
 
            WRC="$WINDRES"
2186
 
        fi
2187
 
        dnl if windres is used, test for propper ISO codepage support
2188
 
        if test x"$WRC" = x"$WINDRES"; then
2189
 
          AC_MSG_CHECKING(if windres supports iso codepages)
2190
 
          rm -f test.rc test.res
2191
 
          echo >test.rc "#pragma code_page(29852)"
2192
 
          echo >>test.rc "STRINGTABLE"
2193
 
          echo >>test.rc "BEGIN"
2194
 
          echo >>test.rc "1, \"test\""
2195
 
          echo >>test.rc "END"
2196
 
          $WINDRES test.rc -o test.res 2>/dev/null
2197
 
          if test -e "test.res"; then
2198
 
            AC_MSG_RESULT(yes)
2199
 
          else
2200
 
            AC_DEFINE(WINDRES_CP_IGNORE,,[Have windres ignore code page pragmas])
2201
 
            AC_MSG_RESULT(no)
2202
 
          fi
2203
 
          rm -f test.rc test.res
2204
 
        fi
2205
 
    else
2206
 
        SOUND_DRIVERS="$SOUND_DRIVERS soundwmm.o"
2207
 
    fi
2208
 
fi
2209
 
 
2210
 
if test x"$is_beos" = "xyes" -o x"$is_beos_x11" = "xyes"; then
2211
 
    SOUND_DRIVERS="$SOUND_DRIVERS soundbeos.o"
2212
 
fi
2213
 
 
2214
 
if test x"$is_unix_macosx" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2215
 
 
2216
 
  dnl --- check for CoreAudio ---
2217
 
  AC_CHECK_HEADER(CoreAudio/CoreAudio.h,,)
2218
 
  if test x"$ac_cv_header_CoreAudio_CoreAudio_h" = "xyes" ; then
2219
 
    AC_CHECK_HEADER(AudioToolbox/AudioToolbox.h,,)
2220
 
    if test x"$ac_cv_header_AudioToolbox_AudioToolbox_h" = "xyes" ; then
2221
 
      AC_MSG_CHECKING(whether we can link the CoreAudio framework)
2222
 
      old_LIBS="${LIBS}"
2223
 
      LIBS="${LIBS} -framework CoreAudio -framework AudioToolbox"
2224
 
      AC_TRY_LINK([#include <CoreAudio/CoreAudio.h>],
2225
 
                  [AudioDeviceStart(0,0);],
2226
 
                  [AC_MSG_RESULT(yes);
2227
 
                   SOUND_DRIVERS="$SOUND_DRIVERS soundcoreaudio.o";
2228
 
                   SOUND_LIBS="$SOUND_LIBS -framework CoreAudio -framework AudioToolbox";
2229
 
                   AC_DEFINE(USE_COREAUDIO,,[Enable CoreAudio support.])],
2230
 
                  [AC_MSG_RESULT(no)])
2231
 
      LIBS=${old_LIBS}
2232
 
    
2233
 
      AC_CHECK_HEADER(AudioUnit/AudioUnit.h,,)
2234
 
      if test x"$ac_cv_header_AudioUnit_AudioUnit_h" = "xyes" ; then
2235
 
        AC_MSG_CHECKING(whether we can link the AudioUnit framework)
2236
 
        old_LIBS="${LIBS}"
2237
 
        LIBS="${LIBS} -framework AudioUnit"
2238
 
        AC_TRY_LINK([#include <AudioUnit/AudioUnit.h>],
2239
 
                    [AudioOutputUnitStart(NULL);],
2240
 
                    [AC_MSG_RESULT(yes);
2241
 
                     SOUND_LIBS="$SOUND_LIBS -framework AudioUnit";
2242
 
                     AC_DEFINE(HAVE_AUDIO_UNIT,,[Enable AudioUnit support.])],
2243
 
                    [AC_MSG_RESULT(no)])
2244
 
        LIBS=${old_LIBS}
2245
 
      fi  
2246
 
    fi
2247
 
  fi
2248
 
 
2249
 
  dnl --- check for CoreMIDI ---
2250
 
  if test x"$enable_midi" != "xno"; then
2251
 
    AC_MSG_CHECKING(whether we can link the CoreMIDI framework)
2252
 
    old_LIBS="${LIBS}"
2253
 
    LIBS="$LIBS -framework CoreMidi -framework CoreServices"
2254
 
    AC_TRY_LINK([#include <CoreMIDI/MIDIServices.h>],
2255
 
                [MIDIGetNumberOfDevices()],
2256
 
                [AC_MSG_RESULT(yes);
2257
 
                 AC_DEFINE(HAVE_MIDI,,[Enable MIDI emulation.])],
2258
 
               [AC_MSG_RESULT(no);
2259
 
                 LIBS=${old_LIBS}])
2260
 
  fi
2261
 
fi
2262
 
 
2263
 
AC_SUBST(SOUND_DRIVERS)
2264
 
AC_SUBST(SOUND_LIBS)
2265
 
 
2266
 
dnl Check for ParSID support
2267
 
if test x"$is_unix" = "xyes" -a x"$is_unix_gp2x" != "xyes" -a x"$is_unix_wiz" != "xyes"; then
2268
 
 
2269
 
  if test x"$enable_parsid" = "xyes"; then
2270
 
    dnl Check for needed parallel port io headers
2271
 
 
2272
 
    LIBIEEE1284_HEADERS_PRESENT=yes
2273
 
    QNX_MMAN_HEADERS_PRESENT=yes
2274
 
    BSD_SET_IOPERM_HEADERS_PRESENT=yes
2275
 
    PARSID_SUPPORT=no
2276
 
 
2277
 
    AC_CHECK_HEADERS(ieee1284.h,,[LIBIEEE1284_HEADERS_PRESENT=no],)
2278
 
    AC_CHECK_HEADERS(sys/mman.h hw/inout.h,,[QNX_MMAN_HEADERS_PRESENT=no],)
2279
 
    AC_CHECK_HEADERS(machine/sysarch.h,,[BSD_SET_IOPERM_HEADERS_PRESENT=no],)
2280
 
    AC_CHECK_HEADERS(unistd.h sys/io.h machine/pio.h)
2281
 
    case "$host_os" in
2282
 
      *kfreebsd*)
2283
 
        ;;
2284
 
      *)
2285
 
        AC_CHECK_HEADERS(machine/cpufunc.h)
2286
 
        ;;
2287
 
    esac
2288
 
 
2289
 
    if test x"$LIBIEEE1284_HEADERS_PRESENT" = "xyes"; then
2290
 
      AC_CHECK_LIB(ieee1284, ieee1284_find_ports,[LIBS="-lieee1284 $LIBS"; PARSID_SUPPORT=yes],,)
2291
 
      if test x"$PARSID_SUPPORT" = "xyes"; then
2292
 
        AC_DEFINE(HAVE_LIBIEEE1284,,[Define to 1 if you have the `ieee1284' library (-lieee1284).])
2293
 
      fi
2294
 
    fi
2295
 
 
2296
 
    if test x"$PARSID_SUPPORT" = "xno"; then
2297
 
      if test x"$QNX_MMAN_HEADERS_PRESENT" = "xyes"; then
2298
 
        QNX_MMAN_FUNCS_PRESENT=yes
2299
 
        AC_CHECK_FUNCS(mmap_device_io in8 out8,,[QNX_MMAN_FUNCS_PRESENT=no])
2300
 
        if test x"$QNX_MMAN_FUNCS_PRESENT" = "xyes"; then
2301
 
          PARSID_SUPPORT=yes
2302
 
        fi
2303
 
      fi
2304
 
    fi
2305
 
 
2306
 
    if test x"$PARSID_SUPPORT" = "xno"; then
2307
 
      if test x"$BSD_SET_IOPERM_HEADERS_PRESENT" = "xyes"; then
2308
 
        AC_CHECK_LIB(amd64, amd64_set_ioperm,[LIBS="-lamd64 $LIBS"; PARSID_SUPPORT=yes],,)
2309
 
        if test x"$PARSID_SUPPORT" = "xyes"; then
2310
 
          AC_DEFINE(HAVE_LIBAMD64,,[Define to 1 if you have the `amd64' library (-lamd64).])
2311
 
        fi
2312
 
      fi
2313
 
    fi
2314
 
 
2315
 
    if test x"$PARSID_SUPPORT" = "xno"; then
2316
 
      if test x"$BSD_SET_IOPERM_HEADERS_PRESENT" = "xyes"; then
2317
 
        AC_CHECK_LIB(i386, i386_get_ioperm,[LIBS="-li386 $LIBS"],,)
2318
 
        AC_CHECK_FUNCS(i386_set_ioperm,[PARSID_SUPPORT=yes],)
2319
 
      fi
2320
 
    fi
2321
 
 
2322
 
    if test x"$PARSID_SUPPORT" = "xno"; then
2323
 
      AC_CHECK_FUNCS(ioperm,[PARSID_SUPPORT=yes],)
2324
 
    fi
2325
 
 
2326
 
    if test x"$PARSID_SUPPORT" = "xyes"; then
2327
 
      AC_DEFINE(HAVE_PARSID,,[Support for ParSID.])
2328
 
    fi
2329
 
  fi
2330
 
fi
2331
 
 
2332
 
dnl Check for library functions
2333
 
if test x"$is_dos" = "xno" -a x"$is_win32" = "xno"; then
2334
 
  AC_FUNC_MEMCMP
2335
 
fi
2336
 
AC_TYPE_SIGNAL
2337
 
AC_FUNC_VFORK
2338
 
AC_CHECK_TYPES(u_short)
2339
 
AC_CHECK_TYPES(socklen_t, [], [], [[#include <sys/socket.h>]])
2340
 
dnl some platforms have some of the functions in libbsd,
2341
 
dnl so we check it out first.
2342
 
AC_CHECK_LIB(bsd,gettimeofday,,,$LIBS)
2343
 
AC_CHECK_FUNCS(gettimeofday memmove atexit strerror strcasecmp strncasecmp dirname mkstemp swab getcwd getpwuid rewinddir)
2344
 
AC_CHECK_FUNCS(strdup, [have_strdup_func=yes], [have_strdup_func=no])
2345
 
 
2346
 
if test x"$have_strdup_func" = "xno"; then
2347
 
  AC_MSG_CHECKING(whether strdup is defined as a macro)
2348
 
  AC_TRY_LINK([#include <string.h>],
2349
 
               [char *something = strdup("something")],
2350
 
               [AC_MSG_RESULT(yes); have_strdup_func=yes],
2351
 
               [AC_MSG_RESULT(no); have_strdup_func=no])
2352
 
fi
2353
 
 
2354
 
if test x"$have_strdup_func" = "xyes"; then
2355
 
  AC_DEFINE(HAVE_STRDUP,,[Define to 1 if you have the `strdup' function.])
2356
 
fi
2357
 
 
2358
 
AC_SUBST(LIBS)
2359
 
 
2360
 
dnl if usleep is not defined, compile our own version for it (usleep.o)
2361
 
if test x"$is_win32" = "xno" -a x"$is_amiga_aros" = "xno"; then
2362
 
  AC_REPLACE_FUNCS(usleep)
2363
 
fi
2364
 
 
2365
 
AC_CHECK_FUNC(nanosleep,
2366
 
              [ AC_DEFINE(HAVE_NANOSLEEP,,[Use nanosleep instead of usleep]) ])
2367
 
 
2368
 
dnl Check time.h.
2369
 
 
2370
 
dnl AC_HEADER_TIME
2371
 
dnl AC_STRUCT_TM
2372
 
 
2373
 
dnl ----- Readline -----
2374
 
dnl Check whether we have GNU readline.  If not, use our replacement.
2375
 
dnl The user can force us to use the replacement with `--without-readline'.
2376
 
READLINE_LIBS=
2377
 
EDITLINE_LIBS=
2378
 
if test x"$is_unix_x11" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2379
 
  if test x"$with_readline" != "xno" ; then
2380
 
    READLINE=""
2381
 
    unset ac_cv_lib_readline_readline
2382
 
    old_LIBS="$LIBS"
2383
 
    AC_CHECK_LIB(readline, readline,
2384
 
               [ READLINE="" READLINE_LIBS="-lreadline"],
2385
 
               [],,)
2386
 
 
2387
 
    if test "$ac_cv_lib_readline_readline" = "no"; then
2388
 
      unset ac_cv_lib_readline_readline
2389
 
      AC_CHECK_LIB(readline, readline,
2390
 
               [ READLINE="" READLINE_LIBS="-lreadline -ltermcap"],
2391
 
               [], [-ltermcap],)
2392
 
    fi
2393
 
 
2394
 
    if test "$ac_cv_lib_readline_readline" = "no"; then
2395
 
      unset ac_cv_lib_readline_readline
2396
 
      AC_CHECK_LIB(readline, readline,
2397
 
               [ READLINE="" READLINE_LIBS="-lreadline -lncurses"],
2398
 
               [], [-lncurses],)
2399
 
    fi
2400
 
 
2401
 
    if test "$ac_cv_lib_readline_readline" = "no"; then
2402
 
      unset ac_cv_lib_readline_readline
2403
 
      AC_CHECK_LIB(readline, readline,
2404
 
             [ READLINE="" READLINE_LIBS="-lreadline -lcurses"],
2405
 
             [ READLINE="\$(top_builddir)/src/arch/unix/readline/libreadline.a" ],
2406
 
              [-lcurses],)
2407
 
    fi
2408
 
 
2409
 
    if test "$ac_cv_lib_readline_readline" = "yes"; then
2410
 
      AC_CHECK_LIB(readline, rl_readline_name,
2411
 
             [ AC_DEFINE(HAVE_RLNAME,,
2412
 
             [Does the `readline' library support `rl_readline_name'?]) ],,)
2413
 
    fi
2414
 
    LIBS="${old_LIBS}"
2415
 
  else
2416
 
    READLINE="\$(top_builddir)/src/arch/unix/readline/libreadline.a"
2417
 
  fi
2418
 
dnl ----- editline support for Cocoa -----
2419
 
elif test x"$enable_editline" != "xno" -a x"$with_cocoa" = "xyes" ; then
2420
 
 
2421
 
   AC_CHECK_HEADER(histedit.h,
2422
 
    [AC_MSG_CHECKING(whether we can link the editline library)
2423
 
      old_LIBS="${LIBS}"
2424
 
      LIBS="${LIBS} -ledit"
2425
 
      AC_TRY_LINK([#include <histedit.h>],
2426
 
                  [history_init();],
2427
 
                  [AC_MSG_RESULT(yes);
2428
 
                   AC_DEFINE(HAVE_EDITLINE,,[Have editline library])
2429
 
                   EDITLINE_LIBS="-ledit"],
2430
 
                  [AC_MSG_RESULT(no)])
2431
 
      LIBS="$old_LIBS"],)
2432
 
 
2433
 
else
2434
 
  READLINE=""
2435
 
fi
2436
 
AM_CONDITIONAL(NEED_READLINE, test x"$READLINE" != "x")
2437
 
AC_SUBST(READLINE)
2438
 
AC_SUBST(READLINE_LIBS)
2439
 
AC_SUBST(EDITLINE_LIBS)
2440
 
 
2441
 
dnl check Amiga graphics support
2442
 
if test x"$is_amiga" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2443
 
  cgx_present=no
2444
 
  p96_present=no
2445
 
  if test x"$with_picasso96" != "xyes"; then
2446
 
    AC_CHECK_HEADERS(proto/cybergraphics.h,[cgx_present=yes],,)
2447
 
  fi
2448
 
 
2449
 
  if test x"$cgx_present" = "xno"; then
2450
 
    AC_CHECK_HEADERS(proto/Picasso96.h,[p96_present=yes],,)
2451
 
    if test x"$p96_present" = "xno"; then
2452
 
      AC_CHECK_HEADERS(proto/Picasso96API.h,[p96_present=yes],,)
2453
 
      if test x"$p96_present" = "xno"; then
2454
 
        AC_MSG_ERROR([No CGX or P96 headers found])
2455
 
      fi
2456
 
    fi
2457
 
  fi
2458
 
fi
2459
 
 
2460
 
 
2461
 
dnl Configure graphics output drivers
2462
 
old_LIBS="$LIBS"
2463
 
GFXOUTPUT_LIBS=
2464
 
 
2465
 
if test x"$with_png" != "xno" ; then
2466
 
  dnl Check for the PNG library.
2467
 
  AC_CHECK_HEADER(png.h,,)
2468
 
  if test x"$ac_cv_header_png_h" = "xyes" ; then
2469
 
    unset ac_cv_lib_png_png_sig_cmp
2470
 
    AC_CHECK_LIB(png, png_sig_cmp,
2471
 
                 [ GFXOUTPUT_LIBS="-lpng $GFXOUTPUT_LIBS";
2472
 
                   GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS pngdrv.o";
2473
 
                   AC_DEFINE(HAVE_PNG,,[Can we use the PNG library?]) ],,)
2474
 
    if test "$ac_cv_lib_png_png_sig_cmp" = "no"; then
2475
 
      unset ac_cv_lib_png_png_sig_cmp
2476
 
      AC_CHECK_LIB(png, png_sig_cmp,
2477
 
                   [ GFXOUTPUT_LIBS="-lpng -lz $GFXOUTPUT_LIBS";
2478
 
                     GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS pngdrv.o";
2479
 
                     AC_DEFINE(HAVE_PNG,,
2480
 
                               [Can we use the PNG library?]) ],,"-lz")
2481
 
    fi
2482
 
  fi
2483
 
fi
2484
 
 
2485
 
dnl Check for the GIF or UNGIF library.
2486
 
AC_CHECK_HEADER(gif_lib.h,,)
2487
 
if test x"$ac_cv_header_gif_lib_h" = "xyes" ; then
2488
 
  AC_CHECK_LIB(ungif, EGifPutLine, [ 
2489
 
               GFXOUTPUT_LIBS="-lungif $GFXOUTPUT_LIBS";
2490
 
               GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS gifdrv.o";
2491
 
               AC_DEFINE(HAVE_GIF,,[Can we use the GIF or UNGIF library?]) ],,)
2492
 
  if test "$ac_cv_lib_ungif_EGifPutLine" = "no"; then
2493
 
    AC_CHECK_LIB(gif, EGifPutLine, [ 
2494
 
                 GFXOUTPUT_LIBS="-lgif $GFXOUTPUT_LIBS";
2495
 
                 GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS gifdrv.o";
2496
 
                 AC_DEFINE(HAVE_GIF,,[Can we use the GIF or UNGIF library?]) ],,)
2497
 
  fi
2498
 
fi
2499
 
 
2500
 
dnl Check for the JPEG library.
2501
 
AC_CHECK_HEADER(jpeglib.h,,)
2502
 
if test x"$ac_cv_header_jpeglib_h" = "xyes" ; then
2503
 
  AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [ 
2504
 
               GFXOUTPUT_LIBS="-ljpeg $GFXOUTPUT_LIBS";
2505
 
               GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS jpegdrv.o";
2506
 
               AC_DEFINE(HAVE_JPEG,,[Can we use the JPEG library?]) ],,)
2507
 
fi
2508
 
 
2509
 
LIBS="$old_LIBS"
2510
 
AC_SUBST(GFXOUTPUT_DRIVERS)
2511
 
AC_SUBST(GFXOUTPUT_LIBS)
2512
 
 
2513
 
 
2514
 
dnl Check for libraries and header files
2515
 
if test x"$is_unix_x11" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2516
 
  X_LIBS=""
2517
 
  AC_PATH_XTRA
2518
 
 
2519
 
  PATH_X_LIBS=$X_LIBS
2520
 
  LINK_X_LIBS=""
2521
 
 
2522
 
  have_xvideo_header="no"
2523
 
  have_xvideo_lib="no"
2524
 
 
2525
 
  if [[ x"${enable_gnomeui}" = "xyes" ]] ; then
2526
 
 
2527
 
    have_vte=no
2528
 
 
2529
 
    PKG_CHECK_MODULES(GTK, [gtk+-2.0])
2530
 
 
2531
 
    dnl PKG_CHECK_MODULES(VTE, [vte-2.90], have_vte=yes, AC_MSG_RESULT(no))
2532
 
    dnl if test x"$have_vte" = "xno"; then
2533
 
      PKG_CHECK_MODULES(VTE, [vte])
2534
 
    dnl fi
2535
 
 
2536
 
    PKG_CHECK_MODULES(GTKGL, [gtkglext-1.0],
2537
 
        AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling]),
2538
 
        AC_MSG_RESULT(no)
2539
 
      )
2540
 
    X_LIBS="$GTK_LIBS $GTKGL_LIBS $X_LIBS $VTE_LIBS"
2541
 
    LINK_X_LIBS="$GTK_LIBS $GTKGL_LIBS $LINK_X_LIBS $VTE_LIBS"
2542
 
  else
2543
 
    if test "$ac_cv_lib_readline_readline" = "no"; then
2544
 
      AC_MSG_ERROR(The Xaw port needs Readline)
2545
 
    fi
2546
 
    LINK_X_LIBS=${READLINE_LIBS} ${LINK_X_LIBS}
2547
 
    AC_DEFINE(USE_COLOR_MANAGEMENT,,[Enable new color management code.])
2548
 
 
2549
 
    AC_CHECK_LIB(w, wslen,[ X_LIBS="-lw $X_LIBS";
2550
 
                 LINK_X_LIBS="-lw $LINK_X_LIBS"],,$X_LIBS)
2551
 
 
2552
 
    AC_CHECK_LIB(intl, dgettext,[ X_LIBS="-lintl $X_LIBS";
2553
 
                 LINK_X_LIBS="-lintl $LINK_X_LIBS"],,$X_LIBS)
2554
 
 
2555
 
    dnl instead of assuming that libsocket needs libnsl, we
2556
 
    dnl will check the existance of libnsl first.
2557
 
    AC_CHECK_LIB(nsl, gethostbyname,[ X_LIBS="-lnsl $X_LIBS";
2558
 
                 LINK_X_LIBS="-lnsl $LINK_X_LIBS"],,$X_LIBS)
2559
 
    AC_CHECK_LIB(socket, gethostbyname,[ X_LIBS="-lsocket $X_LIBS";
2560
 
                 LINK_X_LIBS="-lsocket $LINK_X_LIBS"],,$X_LIBS)
2561
 
    AC_CHECK_LIB(bsd, gethostbyname,[ X_LIBS="-lbsd $X_LIBS";
2562
 
                 LINK_X_LIBS="-lbsd $LINK_X_LIBS"],,$X_LIBS)
2563
 
    if test x"$ac_cv_lib_ICE_IceConnectionNumber" != "xyes"; then
2564
 
      unset ac_cv_lib_ICE_IceConnectionNumber
2565
 
    fi
2566
 
    AC_CHECK_LIB(ICE, IceConnectionNumber,[ X_LIBS="-lICE $X_LIBS";
2567
 
                 LINK_X_LIBS="-lICE $LINK_X_LIBS"],,$X_LIBS)
2568
 
    AC_CHECK_LIB(SM, SmFreeProperty,[ X_LIBS="-lSM $X_LIBS";
2569
 
                 LINK_X_LIBS="-lSM $LINK_X_LIBS"],,$X_LIBS)
2570
 
 
2571
 
    dnl This is necessary because CPP tests use `CPPFLAGS' instead.
2572
 
    dnl FIXME: Are we sure `AC_PATH_XTRA' will always put only X11
2573
 
    dnl include paths in?  Let's hope so.
2574
 
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2575
 
 
2576
 
    MISSING_X_LIBS=""
2577
 
 
2578
 
    AC_CHECK_LIB(X11, XCreateWindow,
2579
 
                 [ X_LIBS="-lX11 $X_LIBS";
2580
 
                   LINK_X_LIBS="-lX11 $LINK_X_LIBS"],,$X_LIBS)
2581
 
 
2582
 
    if test x"$ac_cv_lib_X11_XCreateWindow" != "xyes"; then
2583
 
      unset ac_cv_lib_X11_XCreateWindow
2584
 
      AC_CHECK_LIB(X11, XCreateWindow,
2585
 
                   [ X_LIBS="-lX11 -lXext $X_LIBS";
2586
 
                     LINK_X_LIBS="-lX11 -lXext $LINK_X_LIBS"],
2587
 
                   [ MISSING_X_LIBS="$MISSING_X_LIBS X11" ],$X_LIBS -lXext)
2588
 
    fi
2589
 
 
2590
 
    AC_CHECK_LIB(Xext, XQueryExtension,
2591
 
                 [ X_LIBS="-lXext $X_LIBS";
2592
 
                   LINK_X_LIBS="-lXext $LINK_X_LIBS"],,$X_LIBS)
2593
 
 
2594
 
    dnl the solution to the X_ShmAttach prototype split can be much simpler
2595
 
    dnl without involving the pkgconfig requirement, relying on pkgconfig
2596
 
    dnl for simple header checks could lead to the 'problem' not being 'caught'
2597
 
    dnl if pkgconfig is not installed.
2598
 
 
2599
 
    dnl since xext 7.1 and up have the shmproto.h file and lower versions
2600
 
    dnl don't have the file we just check for the header and set the define
2601
 
    dnl when the header is present.
2602
 
 
2603
 
    AC_CHECK_HEADER(X11/extensions/shmproto.h,
2604
 
            [ AC_DEFINE(HAVE_X11_EXTENSIONS_SHMPROTO_H,,[Use new XShm header]) ]
2605
 
            ,,[#include <X11/Xlibint.h>])
2606
 
 
2607
 
    AC_MSG_CHECKING(for X11/extensions/Xvlib.h)
2608
 
    AC_TRY_LINK([#include <X11/Xlib.h>
2609
 
                 #include <X11/extensions/Xvlib.h>],
2610
 
                [return 0;],
2611
 
                [AC_MSG_RESULT(yes); have_xvideo_header="yes"],
2612
 
                [AC_MSG_RESULT(no); have_xvideo_header="no"])
2613
 
 
2614
 
    AC_CHECK_LIB(Xv, XvQueryExtension,
2615
 
                 [ X_LIBS="-lXv $X_LIBS";
2616
 
                   LINK_X_LIBS="-lXv $LINK_X_LIBS";
2617
 
                  have_xvideo_lib="yes" ],,$X_LIBS)
2618
 
 
2619
 
    if test x"$have_xvideo_header" != "xno" -a x"$have_xvideo_lib" != "xno"; then
2620
 
       AC_DEFINE(HAVE_XVIDEO,,[Enable XVideo support.])
2621
 
       AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling])
2622
 
    fi
2623
 
 
2624
 
    AC_CHECK_LIB(Xt, XtToolkitInitialize,
2625
 
                 [ X_LIBS="-lXt $X_LIBS";
2626
 
                   LINK_X_LIBS="-lXt $LINK_X_LIBS"],
2627
 
                 [ MISSING_X_LIBS="$MISSING_X_LIBS Xt" ],$X_LIBS)
2628
 
 
2629
 
    AC_CHECK_LIB(Xmu, XInternAtom,
2630
 
                 [ X_LIBS="-lXmu $X_LIBS";
2631
 
                   LINK_X_LIBS="-lXmu $LINK_X_LIBS"],
2632
 
                 [ MISSING_X_LIBS="$MISSING_X_LIBS Xmu" ],$X_LIBS)
2633
 
 
2634
 
    dnl check for Xpm, on some systems Xpm is required for correct Xaw usage.
2635
 
    AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
2636
 
                 [ X_LIBS="-lXpm $X_LIBS";
2637
 
                   LINK_X_LIBS="-lXpm $LINK_X_LIBS";
2638
 
                   AC_DEFINE(HAVE_LIBXPM,,[Is libXpm available?]) ],,$X_LIBS)
2639
 
 
2640
 
    dnl Check for Xaw.  Use Xaw3d if requested.
2641
 
    if test x"$with_xaw3d" != "xyes" ; then
2642
 
      AC_CHECK_LIB(Xaw, XawFormDoLayout,
2643
 
                   [ X_LIBS="-lXaw $X_LIBS";
2644
 
                     LINK_X_LIBS="-lXaw $LINK_X_LIBS"],
2645
 
                   [ MISSING_X_LIBS="$MISSING_X_LIBS Xaw" ],
2646
 
                   $X_LIBS $X_PRE_LIBS)
2647
 
    else
2648
 
      AC_CHECK_LIB(Xaw3d, XawFormDoLayout,
2649
 
                   [ X_LIBS="-lXaw3d $X_LIBS";
2650
 
                     LINK_X_LIBS="-lXaw3d $LINK_X_LIBS"],
2651
 
                   [ MISSING_X_LIBS="$MISSING_X_LIBS Xaw3d" ],
2652
 
                   $X_LIBS $X_PRE_LIBS)
2653
 
    fi
2654
 
 
2655
 
    AC_CHECK_HEADER(X11/extensions/XShm.h,,,[#include <X11/Xlib.h>])
2656
 
    if test x"$ac_cv_header_X11_extensions_XShm_h" = "xyes" ; then
2657
 
      AC_CHECK_LIB(Xext, XShmAttach,
2658
 
                   [ AC_DEFINE(USE_MITSHM,,
2659
 
                   [Enable MITSHM extensions.]) ],,$X_LIBS)
2660
 
    fi
2661
 
 
2662
 
    if test x"$MISSING_X_LIBS" != "x"; then
2663
 
      AC_MSG_ERROR([The following important X11 libraries were not found: $MISSING_X_LIBS])
2664
 
    fi
2665
 
 
2666
 
    AC_CHECK_HEADERS(X11/Sunkeysym.h X11/xpm.h xpm.h)
2667
 
  fi
2668
 
 
2669
 
  AC_CHECK_HEADER(GL/glx.h,,,[#include <GL/gl.h>])
2670
 
  if test x"$ac_cv_header_GL_glx_h" = "xyes" ; then
2671
 
    AC_CHECK_LIB(GL, glXWaitVideoSyncSGI,
2672
 
                 [ X_LIBS="-lGL $X_LIBS";
2673
 
                   LINK_X_LIBS="-lGL $LINK_X_LIBS";
2674
 
                   VICE_SYNC="openGL_sync.o $VICE_SYNC";
2675
 
                   AC_DEFINE(USE_XF86_EXTENSIONS,,[Enable XF86 extensions.])
2676
 
                   AC_DEFINE(HAVE_OPENGL_SYNC,,
2677
 
                   [Enable openGL synchronization])],,$X_LIBS)
2678
 
  fi
2679
 
  AC_SUBST(VICE_SYNC)
2680
 
 
2681
 
  dnl Check for XFree86 header and library extensions.
2682
 
  FULLSCREEN_DRIVERS=""
2683
 
 
2684
 
  if test x"$enable_fullscreen" != "xno"; then
2685
 
 
2686
 
    dnl currently fullscreen gnomeui is done with X11 dependent libs,
2687
 
    dnl so check for X11
2688
 
    if test x"$enable_gnomeui" = "xyes"; then
2689
 
        AC_CHECK_LIB(X11, XCreateWindow,
2690
 
                     [ X_LIBS="-lX11 $X_LIBS";
2691
 
                       LINK_X_LIBS="-lX11 $LINK_X_LIBS"],,$X_LIBS)
2692
 
    fi
2693
 
    AC_CHECK_HEADER(X11/extensions/xf86vmode.h,,,[#include <X11/Xlib.h>])
2694
 
    if test x"$ac_cv_header_X11_extensions_xf86vmode_h" = "xyes" ; then
2695
 
      AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion,
2696
 
                   [ X_LIBS="-lXxf86vm $X_LIBS";
2697
 
                     LINK_X_LIBS="-lXxf86vm $LINK_X_LIBS";
2698
 
                     FULLSCREEN_DRIVERS="$FULLSCREEN_DRIVERS vidmode.o";
2699
 
                     AC_DEFINE(USE_XF86_VIDMODE_EXT,,
2700
 
                               [Enable XF86 VidMode extensions.])
2701
 
                     AC_DEFINE(HAVE_FULLSCREEN,,[Enable Fullscreen support.])
2702
 
                     AC_DEFINE(USE_XF86_EXTENSIONS,,
2703
 
                               [Enable XF86 extensions.])],,$X_LIBS)
2704
 
    fi
2705
 
    AC_CHECK_HEADER(X11/extensions/Xrandr.h,,,[#include <X11/Xlib.h>])
2706
 
    if test x"$ac_cv_header_X11_extensions_Xrandr_h" = "xyes" ; then
2707
 
      AC_CHECK_LIB(Xrandr, XRRConfigCurrentRate,
2708
 
                   [ X_LIBS="-lXrandr $X_LIBS";
2709
 
                     LINK_X_LIBS="-lXrandr $LINK_X_LIBS";
2710
 
                     FULLSCREEN_DRIVERS="$FULLSCREEN_DRIVERS xrandr.o";
2711
 
                     AC_DEFINE(USE_XF86_EXTENSIONS,,[Enable XF86 extensions.])
2712
 
                     AC_DEFINE(HAVE_FULLSCREEN,,[Enable Fullscreen support.])
2713
 
                     AC_DEFINE(HAVE_XRANDR,,
2714
 
                     [Enable XRandR extension.])],,$X_LIBS)
2715
 
    fi
2716
 
  fi
2717
 
 
2718
 
  X_LIBS="$PATH_X_LIBS $LINK_X_LIBS"
2719
 
  AC_SUBST(FULLSCREEN_DRIVERS)
2720
 
 
2721
 
  OLD_LIBS=$LIBS
2722
 
  LIBS="$LIBS $X_LIBS"
2723
 
  AC_CHECK_FUNCS(_XlcConvert _XlcCurrentLC _XlcOpenConverter _XlcCloseConverter,,[xlc_funcs_present=no],)
2724
 
  LIBS=$OLD_LIBS
2725
 
  if test x"$xlc_funcs_present" != "xno"; then
2726
 
    AC_DEFINE(XLC_FUNCS_PRESENT,,[Enable _Xlc_* functions.])
2727
 
  fi
2728
 
 
2729
 
elif test x"$is_dos" = "xyes"; then
2730
 
 
2731
 
  dnl On MS-DOS, we already know what we want.
2732
 
 
2733
 
  if test x"$enable_sdlui" = "xyes"; then
2734
 
    LIBS="$LIBS $LIBMIDAS"
2735
 
  else
2736
 
    LIBS="$LIBS -lalleg $LIBMIDAS"
2737
 
  fi
2738
 
  AC_SUBST(LDFLAGS)
2739
 
 
2740
 
elif test x"$is_amiga" = "xyes"; then
2741
 
 
2742
 
  dnl On Amiga, we already know what we want.
2743
 
  if test x"$is_amiga_aros" != "xyes"; then
2744
 
    if test x"$host_os" != "xmorphos" -a x"$host_os" != "xwarpos" -a x"$host_os" != "xpowerup"; then
2745
 
      LIBS="$LIBS -lauto"
2746
 
    fi
2747
 
  else
2748
 
    if test x"$enable_sdlui" != "xyes"; then
2749
 
      LIBS="$LIBS -lmui"
2750
 
    fi
2751
 
  fi
2752
 
  AC_SUBST(LDFLAGS)
2753
 
 
2754
 
  if test x"$enable_sdlui" != "xyes"; then
2755
 
    AC_DEFINE(HAS_TRANSLATION,,[Enable internationalization support])
2756
 
  fi
2757
 
 
2758
 
elif test x"$is_beos" = "xyes"; then
2759
 
 
2760
 
  dnl On BEOS, we already know what we want.
2761
 
 
2762
 
  LIBS="$LIBS -lbe -ltracker -ldevice -lgame"
2763
 
  AC_SUBST(LDFLAGS)
2764
 
 
2765
 
elif test x"$is_unix_gp2x" = "xyes" -o x"$is_unix_wiz" = "xyes"; then
2766
 
 
2767
 
  dnl on GP2X (and WIZ) we need static libs.
2768
 
 
2769
 
  LDFLAGS="$LDFLAGS -static"
2770
 
  LIBS="$LIBS -lpthread"
2771
 
  AC_SUBST(LDFLAGS)
2772
 
 
2773
 
elif test x"$is_win32" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2774
 
 
2775
 
  dnl On Windows, we already know what we want.
2776
 
 
2777
 
  if test x"$host_cpu" = "xx86_64" -o x"$host_cpu" = "xamd64"; then
2778
 
    LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lwinmm -lcomdlg32 -lcomctl32 -lws2_32 -lversion"
2779
 
  else
2780
 
    LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lwinmm -lcomdlg32 -lcomctl32 -lwsock32 -lversion"
2781
 
  fi
2782
 
 
2783
 
  AC_CHECK_HEADER(d3d9.h,
2784
 
      [ AC_DEFINE(HAVE_D3D9_H,,[Support for DirectX9.]) ],)
2785
 
  AC_CHECK_LIB(dxguid, GUID_SysMouse,[LIBS="$LIBS -ldxguid";
2786
 
               AC_DEFINE(HAVE_GUIDLIB,,
2787
 
                         [Is the GUID lib of DX SDK present?])],,$LIBS)
2788
 
 
2789
 
  AC_MSG_CHECKING([whether DWORD is defined as unsigned long or unsigned int in the Mingw32 headers])
2790
 
  AC_TRY_COMPILE([#include <windows.h>
2791
 
extern DWORD test;
2792
 
unsigned long test; ],
2793
 
                 ,
2794
 
                 [ AC_DEFINE(DWORD_IS_LONG,,
2795
 
                   [Is DWORD defined as long or int in the Windows header files?])
2796
 
                   AC_MSG_RESULT(unsigned long) ], AC_MSG_RESULT(unsigned int))
2797
 
 
2798
 
  vsid_LDFLAGS="-mwindows"
2799
 
  x64_LDFLAGS="-mwindows"
2800
 
  x128_LDFLAGS="-mwindows"
2801
 
  xvic_LDFLAGS="-mwindows"
2802
 
  xpet_LDFLAGS="-mwindows"
2803
 
  xplus4_LDFLAGS="-mwindows"
2804
 
  xcbm2_LDFLAGS="-mwindows"
2805
 
 
2806
 
  if test x"$CC" != "xowcc"; then
2807
 
    VSID_WINRES="\$(top_builddir)/src/arch/win32/resvsid.o"
2808
 
    X64_WINRES="\$(top_builddir)/src/arch/win32/resc64.o"
2809
 
    X64DTV_WINRES="\$(top_builddir)/src/arch/win32/resc64dtv.o"
2810
 
    X128_WINRES="\$(top_builddir)/src/arch/win32/resc128.o"
2811
 
    XVIC_WINRES="\$(top_builddir)/src/arch/win32/resvic20.o"
2812
 
    XPET_WINRES="\$(top_builddir)/src/arch/win32/respet.o"
2813
 
    XPLUS4_WINRES="\$(top_builddir)/src/arch/win32/resplus4.o"
2814
 
    XCBM2_WINRES="\$(top_builddir)/src/arch/win32/rescbm2.o"
2815
 
    XCBM5X0_WINRES="\$(top_builddir)/src/arch/win32/rescbm5x0.o"
2816
 
  fi
2817
 
 
2818
 
  AC_SUBST(LDFLAGS)
2819
 
 
2820
 
  if test -z "$WINDRES" ; then
2821
 
    WINDRES="windres"
2822
 
  fi
2823
 
 
2824
 
  AC_SUBST(WINDRES)
2825
 
 
2826
 
  AC_DEFINE(HAS_TRANSLATION,,[Enable internationalization support])
2827
 
fi
2828
 
 
2829
 
dnl CBM4Linux/OpenCBM
2830
 
AC_MSG_CHECKING([for OpenCBM support])
2831
 
if test x"$enable_realdevice" != "xno"; then
2832
 
  if test x"$host_os" = "xcygwin32" -o x"$host_os" = "xcygwin" -o x"$host_os" = "xmingw32" -o x"$host_os" = "xmingw32msvc"; then
2833
 
    AC_DEFINE(HAVE_OPENCBM,,[Support for OpenCBM (former CBM4Linux).])
2834
 
    AM_CONDITIONAL(HAVE_REALDEVICE, true)
2835
 
    AC_MSG_RESULT([yes])
2836
 
  else
2837
 
    if test x"$dynlib_support" = "xyes"; then
2838
 
      AC_DEFINE(HAVE_OPENCBM,,[Support for OpenCBM (former CBM4Linux).])
2839
 
      AM_CONDITIONAL(HAVE_REALDEVICE, true)
2840
 
      AC_MSG_RESULT([yes])
2841
 
    else
2842
 
      AM_CONDITIONAL(HAVE_REALDEVICE, false)
2843
 
      AC_MSG_RESULT([no (dynamic lib support missing)])
2844
 
    fi
2845
 
  fi
2846
 
else
2847
 
  AM_CONDITIONAL(HAVE_REALDEVICE, false)
2848
 
  AC_MSG_RESULT([no (realdevice disabled)])
2849
 
fi
2850
 
 
2851
 
AC_SUBST(vsid_LDFLAGS)
2852
 
AC_SUBST(x64_LDFLAGS)
2853
 
AC_SUBST(x128_LDFLAGS)
2854
 
AC_SUBST(xvic_LDFLAGS)
2855
 
AC_SUBST(xpet_LDFLAGS)
2856
 
AC_SUBST(xplus4_LDFLAGS)
2857
 
AC_SUBST(xcbm2_LDFLAGS)
2858
 
 
2859
 
AC_SUBST(VSID_WINRES)
2860
 
AC_SUBST(X64_WINRES)
2861
 
AC_SUBST(X64DTV_WINRES)
2862
 
AC_SUBST(X128_WINRES)
2863
 
AC_SUBST(XVIC_WINRES)
2864
 
AC_SUBST(XPET_WINRES)
2865
 
AC_SUBST(XPLUS4_WINRES)
2866
 
AC_SUBST(XCBM2_WINRES)
2867
 
AC_SUBST(XCBM5X0_WINRES)
2868
 
 
2869
 
 
2870
 
dnl disable building of x64dtv for native gp2x, wiz, and dingoo
2871
 
if test x"$is_unix_gp2x" = "xyes" -o x"$is_unix_wiz" = "xyes" -o x"$is_unix_dingux" = "xyes"; then
2872
 
  if test x"$enable_sdlui" != "xyes"; then
2873
 
    AM_CONDITIONAL(SUPPORT_X64DTV, false)
2874
 
  else
2875
 
    AM_CONDITIONAL(SUPPORT_X64DTV, true)
2876
 
  fi
2877
 
else
2878
 
  AM_CONDITIONAL(SUPPORT_X64DTV, true)
2879
 
fi
2880
 
 
2881
 
dnl disable building of x64sc for gp2x, wiz, dingoo and disabled resid configurations
2882
 
if test x"$is_unix_gp2x" = "xyes" -o x"$is_unix_wiz" = "xyes" -o x"$enable_dingoo" = "xyes" -o x"$is_unix_dingux" = "xyes" -o x"$with_resid" = "xno"; then
2883
 
  AM_CONDITIONAL(SUPPORT_X64SC, false)
2884
 
else
2885
 
  AM_CONDITIONAL(SUPPORT_X64SC, true)
2886
 
fi
2887
 
 
2888
 
dnl Setup the system-specific object files.
2889
 
if test x"$enable_sdlui" = "xyes"; then
2890
 
  ARCH_DIR="\$(top_builddir)/src/arch/sdl"
2891
 
  ARCH_SRC_DIR="\$(top_srcdir)/src/arch/sdl"
2892
 
  ARCH_LIBS="$ARCH_DIR/libarch.a"
2893
 
  if test x"$is_win32" = "xyes"; then
2894
 
    ARCH_INCLUDES="-I$ARCH_SRC_DIR -I\$(top_srcdir)/src/arch/win32/msvc/wpcap"
2895
 
  else
2896
 
    ARCH_INCLUDES="-I$ARCH_SRC_DIR -I\$(top_srcdir)/src/arch"
2897
 
  fi
2898
 
  AC_DEFINE(HAS_JOYSTICK,,[Enable joystick emulation.])
2899
 
  AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
2900
 
  AM_CONDITIONAL(SDL_COMPILE, true)
2901
 
else
2902
 
  AM_CONDITIONAL(SDL_COMPILE, false)
2903
 
fi
2904
 
 
2905
 
SDL_EXTRA_LIBS=""
2906
 
 
2907
 
if test x"$is_unix" = "xyes"; then
2908
 
 
2909
 
  if test x"$enable_sdlui" != "xyes"; then
2910
 
    ARCH_DIR="\$(top_builddir)/src/arch/unix"
2911
 
    ARCH_SRC_DIR="\$(top_srcdir)/src/arch/unix"
2912
 
    ARCH_EXTRA_SUBDIR="gui x11"
2913
 
 
2914
 
    if test x"$is_unix_x11" = "xyes" ; then
2915
 
      if test x"$enable_gnomeui" != "xyes" ; then
2916
 
        ARCH_LIBS="$ARCH_DIR/libarch.a $ARCH_DIR/gui/libarchgui.a $ARCH_DIR/x11/libx11ui.a $ARCH_DIR/x11/xaw/libxawui.a $ARCH_DIR/x11/xaw/widgets/libwidgets.a $ARCH_DIR/libarch.a $ARCH_DIR/gui/libarchgui.a $ARCH_DIR/x11/libx11ui.a"
2917
 
        ARCH_INCLUDES="-I$ARCH_SRC_DIR"
2918
 
        AC_DEFINE(USE_XAWUI,,[Are we using the Unix/X11/Xaw ui?])
2919
 
      else
2920
 
        ARCH_LIBS="$ARCH_DIR/libarch.a $ARCH_DIR/gui/libarchgui.a $ARCH_DIR/x11/gnome/libgnomeui.a $ARCH_DIR/x11/libx11ui.a"
2921
 
        ARCH_INCLUDES="-I$ARCH_SRC_DIR $GTK_CFLAGS $GTKGL_CFLAGS $VTE_CFLAGS"
2922
 
      fi
2923
 
    
2924
 
      AC_DEFINE(HAVE_READLINE,,[Are we using the readline library replacement?])
2925
 
      
2926
 
      AC_CHECK_HEADERS(stdlib.h,AC_DEFINE(HAVE_STDLIB,,[We are using stdlib.h]))
2927
 
 
2928
 
      if test x"$READLINE" != x ; then
2929
 
        ARCH_EXTRA_SUBDIR="$ARCH_EXTRA_SUBDIR readline"
2930
 
      fi
2931
 
    fi
2932
 
  else
2933
 
    AC_DEFINE(UNIX_COMPILE,,[Are we compiling for unix?])
2934
 
  fi
2935
 
 
2936
 
  if test x"$is_unix_gp2x" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2937
 
    ARCH_LIBS="$ARCH_DIR/libarch.a $ARCH_DIR/gp2x/libarchgp2x.a $ARCH_DIR/gp2x/minimal/libarchgp2xsys.a"
2938
 
    ARCH_INCLUDES="-I$ARCH_SRC_DIR -I$ARCH_SRC_DIR/gp2x -I$ARCH_SRC_DIR/gp2x/minimal"
2939
 
    ARCH_EXTRA_SUBDIR="gp2x gp2x/minimal"
2940
 
  fi
2941
 
 
2942
 
  if test x"$is_unix_wiz" = "xyes" -a x"$enable_sdlui" != "xyes"; then
2943
 
    ARCH_LIBS="$ARCH_DIR/libarch.a $ARCH_DIR/gp2x/libarchgp2x.a $ARCH_DIR/gp2x/wiz/libarchwizsys.a"
2944
 
    ARCH_INCLUDES="-I$ARCH_SRC_DIR -I$ARCH_SRC_DIR/gp2x -I$ARCH_SRC_DIR/gp2x/wiz"
2945
 
    ARCH_EXTRA_SUBDIR="gp2x gp2x/wiz"
2946
 
  fi
2947
 
 
2948
 
  if test x"$is_unix_macosx" = "xyes" ; then
2949
 
    ARCH_MAKE_BINDIST_DIR="\$(top_srcdir)/src/arch/unix/macosx"
2950
 
    if test x"$enable_sdlui" = "xyes"; then
2951
 
      UNIX_MACOSX_UITYPE=sdl
2952
 
    elif test x"$with_cocoa" = "xyes" ; then
2953
 
      ARCH_LIBS="$ARCH_DIR/macosx/cocoa/menu/libarchmacosxcocoamenu.a $ARCH_DIR/macosx/cocoa/dialog/libarchmacosxcocoadialog.a $ARCH_DIR/macosx/cocoa/libarchmacosxcocoa.a $ARCH_DIR/macosx/cocoa/view/libarchmacosxcocoaview.a $ARCH_DIR/macosx/libarchmacosx.a $ARCH_DIR/libarch.a $ARCH_LIBS"
2954
 
      ARCH_INCLUDES="-I$ARCH_SRC_DIR/macosx/cocoa/menu -I$ARCH_SRC_DIR/macosx/cocoa/dialog -I$ARCH_SRC_DIR/macosx/cocoa/view -I$ARCH_SRC_DIR/macosx/cocoa -I$ARCH_SRC_DIR/macosx -I$ARCH_SRC_DIR $ARCH_INCLUDES"
2955
 
      ARCH_EXTRA_SUBDIR="macosx macosx/cocoa macosx/cocoa/view macosx/cocoa/menu macosx/cocoa/dialog"
2956
 
      UI_LIBS="-framework Cocoa -framework OpenGL -framework Carbon -framework CoreVideo"
2957
 
      UNIX_MACOSX_UITYPE=cocoa
2958
 
    else
2959
 
      ARCH_LIBS="$ARCH_DIR/macosx/libarchmacosx.a $ARCH_LIBS"
2960
 
      ARCH_INCLUDES="-I$ARCH_SRC_DIR/macosx $ARCH_INCLUDES"
2961
 
      ARCH_EXTRA_SUBDIR="$ARCH_EXTRA_SUBDIR macosx"
2962
 
      UI_LIBS="$UI_LIBS -framework CoreVideo"
2963
 
      if test x"$enable_gnomeui" != "xyes" ; then
2964
 
        UNIX_MACOSX_UITYPE=x11
2965
 
      else
2966
 
        UNIX_MACOSX_UITYPE=gtk
2967
 
      fi
2968
 
    fi
2969
 
  fi
2970
 
  AC_SUBST(UNIX_MACOSX_UITYPE)
2971
 
 
2972
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
2973
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
2974
 
  AM_CONDITIONAL(UNIX_COMPILE, true)
2975
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
2976
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
2977
 
  AM_CONDITIONAL(OS2_COMPILE, false)
2978
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
2979
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
2980
 
  AM_CONDITIONAL(HAVE_TRANSLATION, false)
2981
 
  openserver5compile=no
2982
 
  openserver6compile=no
2983
 
  unixwarecompile=no
2984
 
  qnx4compile=no
2985
 
  qnx6compile=no
2986
 
  solariscompile=no
2987
 
  hpuxcompile=no
2988
 
  skyoscompile=no
2989
 
  syllablecompile=no
2990
 
  nextstepcompile=no
2991
 
  openstepcompile=no
2992
 
  rhapsodycompile=no
2993
 
  case "$host_os" in
2994
 
    rhapsody*)
2995
 
      rhapsodycompile=yes
2996
 
      AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, true)
2997
 
      AC_DEFINE(RHAPSODY_COMPILE,,[Enable Rhapsody 5.x support])
2998
 
      ;;
2999
 
    openstep*)
3000
 
      openstepcompile=yes
3001
 
      AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, true)
3002
 
      AC_DEFINE(OPENSTEP_COMPILE,,[Enable OpenStep 4.x support])
3003
 
      ;;
3004
 
    nextstep*)
3005
 
      nextstepcompile=yes
3006
 
      AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, true)
3007
 
      AC_DEFINE(NEXTSTEP_COMPILE,,[Enable NextStep 3.x support])
3008
 
      ;;
3009
 
    skyos*)
3010
 
      skyoscompile=yes
3011
 
      AM_CONDITIONAL(UNIX_SKYOS_COMPILE, true)
3012
 
      ;;
3013
 
    qnx*)
3014
 
      qnx4compile=yes
3015
 
      AM_CONDITIONAL(UNIX_QNX4_COMPILE, true)
3016
 
      ;;
3017
 
    nto*)
3018
 
      qnx6compile=yes
3019
 
      AM_CONDITIONAL(UNIX_QNX6_COMPILE, true)
3020
 
      ;;
3021
 
    solaris*)
3022
 
      solariscompile=yes
3023
 
      AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, true)
3024
 
      sol_version=`uname -r`
3025
 
      if test x"$sol_version" = "x5.7"; then
3026
 
        ac_configure_args="$ac_configure_args --disable-sse"
3027
 
      fi
3028
 
      ;;
3029
 
    sco3.2v5*)
3030
 
      openserver5compile=yes
3031
 
      AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, true)
3032
 
      AC_DEFINE(OPENSERVER5_COMPILE,,[Enable SCO Openserver 5.x support])
3033
 
      ;;
3034
 
    sco3.2v6*)
3035
 
      openserver6compile=yes
3036
 
      AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, true)
3037
 
      AC_DEFINE(OPENSERVER6_COMPILE,,[Enable SCO Openserver 6.x support])
3038
 
      ;;
3039
 
    sco3.2v7*)
3040
 
      unixwarecompile=yes
3041
 
      AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, true)
3042
 
      AC_DEFINE(UNIXWARE_COMPILE,,[Enable SCO Unixware 7.x support])
3043
 
      ;;
3044
 
    hpux*)
3045
 
      hpuxcompile=yes
3046
 
      AM_CONDITIONAL(UNIX_HPUX_COMPILE, true)
3047
 
      ;;
3048
 
    syllable*)
3049
 
      syllablecompile=yes
3050
 
      AM_CONDITIONAL(SYLLABLE_COMPILE, true)
3051
 
      ;;
3052
 
    *)
3053
 
      ;;  
3054
 
  esac
3055
 
 
3056
 
  if test x"$skyoscompile" = "xno"; then
3057
 
    AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3058
 
  fi
3059
 
 
3060
 
  if test x"$qnx4compile" = "xno"; then
3061
 
    AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3062
 
  fi
3063
 
 
3064
 
  if test x"$qnx6compile" = "xno"; then
3065
 
    AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3066
 
  fi
3067
 
 
3068
 
  if test x"$nextstepcompile" = "xno"; then
3069
 
    AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3070
 
  fi
3071
 
 
3072
 
  if test x"$openstepcompile" = "xno"; then
3073
 
    AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3074
 
  fi
3075
 
 
3076
 
  if test x"$rhapsodycompile" = "xno"; then
3077
 
    AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3078
 
  fi
3079
 
 
3080
 
  if test x"$solariscompile" = "xno"; then
3081
 
    AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3082
 
  fi
3083
 
 
3084
 
  if test x"$openserver5compile" = "xno"; then
3085
 
    AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3086
 
  fi
3087
 
 
3088
 
  if test x"$openserver6compile" = "xno"; then
3089
 
    AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3090
 
  fi
3091
 
 
3092
 
  if test x"$unixwarecompile" = "xno"; then
3093
 
    AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3094
 
  fi
3095
 
 
3096
 
  if test x"$hpuxcompile" = "xno"; then
3097
 
    AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3098
 
  fi
3099
 
 
3100
 
  if test x"$syllablecompile" = "xno"; then
3101
 
    AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3102
 
  fi
3103
 
 
3104
 
  if test x"$is_unix_gp2x" = "xyes" ; then
3105
 
    AM_CONDITIONAL(UNIX_GP2X_COMPILE, true)
3106
 
    AM_CONDITIONAL(MAKE_BINDIST, true)
3107
 
  else
3108
 
    AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3109
 
  fi
3110
 
 
3111
 
  if test x"$is_unix_wiz" = "xyes" ; then
3112
 
    AM_CONDITIONAL(UNIX_WIZ_COMPILE, true)
3113
 
    AM_CONDITIONAL(MAKE_BINDIST, true)
3114
 
  else
3115
 
    AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3116
 
  fi
3117
 
 
3118
 
  if test x"$is_unix_dingux" = "xyes" ; then
3119
 
    AM_CONDITIONAL(UNIX_DINGUX_COMPILE, true)
3120
 
    AM_CONDITIONAL(MAKE_BINDIST, true)
3121
 
  else
3122
 
    AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3123
 
  fi
3124
 
 
3125
 
  if test x"$is_unix_macosx" = "xyes" ; then
3126
 
    AM_CONDITIONAL(UNIX_MACOSX_COMPILE, true)
3127
 
    if test x"$enable_bundle" != "xno" ; then
3128
 
      AM_CONDITIONAL(MAKE_BINDIST, true)
3129
 
    else
3130
 
      AM_CONDITIONAL(MAKE_BINDIST, false)
3131
 
    fi
3132
 
  else
3133
 
    AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3134
 
  fi
3135
 
 
3136
 
  if test x"$is_unix_gp2x" != "xyes" -a x"$is_unix_wiz" != "xyes" -a x"$is_unix_dingux" != "xyes" -a x"$is_unix_macosx" != "xyes"; then
3137
 
    AM_CONDITIONAL(MAKE_BINDIST, false)
3138
 
  fi
3139
 
 
3140
 
elif test x"$enable_dingoo" = "xyes" ; then
3141
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, true)
3142
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, false)
3143
 
  AC_DEFINE(HAVE_ATEXIT,,[Dingoo has atexit])
3144
 
  AM_CONDITIONAL(HAVE_RAWDRIVE, false)
3145
 
  AM_CONDITIONAL(UNIX_COMPILE, true)
3146
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
3147
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
3148
 
  AM_CONDITIONAL(OS2_COMPILE, false)
3149
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
3150
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
3151
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3152
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3153
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3154
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3155
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3156
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3157
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3158
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3159
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3160
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3161
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3162
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3163
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3164
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3165
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3166
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3167
 
  AM_CONDITIONAL(HAVE_TRANSLATION, false)
3168
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3169
 
  AM_CONDITIONAL(SUPPORT_X64DTV, true)
3170
 
 
3171
 
elif test x"$is_win32" = "xyes"; then
3172
 
  if test x"$enable_sdlui" != "xyes"; then
3173
 
    ARCH_DIR="\$(top_builddir)/src/arch/win32"
3174
 
    ARCH_SRC_DIR="\$(top_srcdir)/src/arch/win32"
3175
 
    ARCH_LIBS="$ARCH_DIR/libarch.a"
3176
 
    ARCH_INCLUDES="-I\$(top_srcdir)/src/arch/win32"
3177
 
    if test x"$host_os" = "xcygwin32" -o x"$host_os" = "xcygwin"; then
3178
 
      AC_DEFINE([PLATFORM], ["win32 x86 cygwin"],[The current arch, cpu and compiler used.])
3179
 
    else
3180
 
      if test x"$host_cpu" = "xx86_64" -o x"$host_cpu" = "xamd64"; then
3181
 
        AC_DEFINE([PLATFORM], ["win64 x64 mingw"], [The current arch, cpu and compiler used.])
3182
 
      else
3183
 
        if test x"$CC" = "xowcc"; then
3184
 
          AC_DEFINE([PLATFORM], ["win32 x86 owcc"], [The current arch, cpu and compiler used.])
3185
 
        else
3186
 
          AC_DEFINE([PLATFORM], ["win32 x86 mingw"], [The current arch, cpu and compiler used.])
3187
 
        fi
3188
 
      fi
3189
 
    fi
3190
 
  fi
3191
 
  AC_DEFINE(WIN32_COMPILE,,[Are we compiling for win32?])
3192
 
 
3193
 
  if test x"$enable_sdlui" = "xyes"; then
3194
 
    if test x"$host_cpu" = "xx86_64" -o x"$host_cpu" = "xamd64"; then
3195
 
      SDL_EXTRA_LIBS="$UI_LIBS -lwinmm -lws2_32"
3196
 
    else
3197
 
      SDL_EXTRA_LIBS="$UI_LIBS -lwinmm -lwsock32"
3198
 
    fi
3199
 
  fi
3200
 
 
3201
 
  AM_CONDITIONAL(WIN32_COMPILE, true)
3202
 
  AM_CONDITIONAL(UNIX_COMPILE, false)
3203
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3204
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3205
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3206
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3207
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3208
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3209
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3210
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3211
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3212
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3213
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3214
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3215
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3216
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3217
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3218
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
3219
 
  AM_CONDITIONAL(OS2_COMPILE, false)
3220
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
3221
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
3222
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3223
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
3224
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
3225
 
  AM_CONDITIONAL(HAVE_TRANSLATION, true)
3226
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3227
 
elif test x"$is_amiga" = "xyes"; then
3228
 
  if test x"$enable_sdlui" != "xyes"; then
3229
 
    ARCH_DIR="\$(top_builddir)/src/arch/amigaos"
3230
 
    ARCH_SRC_DIR="\$(top_srcdir)/src/arch/amigaos"
3231
 
    ARCH_LIBS="$ARCH_DIR/libarch.a"
3232
 
    ARCH_INCLUDES="-I\$(top_srcdir)/src/arch/amigaos"
3233
 
  fi
3234
 
  AM_CONDITIONAL(UNIX_COMPILE, false)
3235
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3236
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3237
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3238
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3239
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3240
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3241
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3242
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3243
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3244
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3245
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3246
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3247
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3248
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3249
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3250
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
3251
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
3252
 
  AM_CONDITIONAL(OS2_COMPILE, false)
3253
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
3254
 
  AM_CONDITIONAL(AMIGA_COMPILE, true)
3255
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3256
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
3257
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
3258
 
  AM_CONDITIONAL(HAVE_TRANSLATION, true)
3259
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3260
 
elif test x"$is_dos" = "xyes"; then
3261
 
  ARCH_INCLUDES="-I\$(top_srcdir)/src/arch/msdos"
3262
 
  ARCH_DIR="\$(top_builddir)/src/arch/msdos"
3263
 
  ARCH_SRC_DIR="\$(top_srcdir)/src/arch/msdos"
3264
 
  if test x"$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then
3265
 
    ARCH_LIBS="$ARCH_DIR/libarch.a $ARCH_DIR/libpcap_nodma.a"
3266
 
  else
3267
 
    ARCH_LIBS="$ARCH_DIR/libarch.a"
3268
 
  fi
3269
 
  AM_CONDITIONAL(UNIX_COMPILE, false)
3270
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3271
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3272
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3273
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3274
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3275
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3276
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3277
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3278
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3279
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3280
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3281
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3282
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3283
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3284
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3285
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
3286
 
  AM_CONDITIONAL(MSDOS_COMPILE, true)
3287
 
  AM_CONDITIONAL(OS2_COMPILE, false)
3288
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
3289
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
3290
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3291
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
3292
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
3293
 
  AM_CONDITIONAL(HAVE_TRANSLATION, false)
3294
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3295
 
elif test x"$is_os2" = "xyes"; then
3296
 
  ARCH_INCLUDES="-I\$(top_srcdir)/src/arch/os2"
3297
 
  ARCH_DIR="\$(top_builddir)/src/arch/os2"
3298
 
  ARCH_SRC_DIR="\$(top_srcdir)/src/arch/os2"
3299
 
  ARCH_LIBS="$ARCH_DIR/libarch.a"
3300
 
  AM_CONDITIONAL(UNIX_COMPILE, false)
3301
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3302
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3303
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3304
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3305
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3306
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3307
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3308
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3309
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3310
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3311
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3312
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)
3313
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)
3314
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3315
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3316
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
3317
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
3318
 
  AM_CONDITIONAL(OS2_COMPILE, true)
3319
 
  AM_CONDITIONAL(BEOS_COMPILE, false)
3320
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
3321
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3322
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
3323
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
3324
 
  AM_CONDITIONAL(HAVE_TRANSLATION, false)
3325
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3326
 
elif test x"$is_beos" = "xyes"; then
3327
 
  if test x"$enable_sdlui" != "xyes"; then
3328
 
    ARCH_INCLUDES="-I\$(top_srcdir)/src/arch/beos"
3329
 
    ARCH_DIR="\$(top_builddir)/src/arch/beos"
3330
 
    ARCH_SRC_DIR="\$(top_srcdir)/src/arch/beos"
3331
 
    ARCH_LIBS="$ARCH_DIR/libarch.a"
3332
 
  fi
3333
 
  AM_CONDITIONAL(UNIX_COMPILE, false)
3334
 
  AM_CONDITIONAL(UNIX_GP2X_COMPILE, false)
3335
 
  AM_CONDITIONAL(UNIX_WIZ_COMPILE, false)
3336
 
  AM_CONDITIONAL(UNIX_DINGUX_COMPILE, false)
3337
 
  AM_CONDITIONAL(UNIX_SKYOS_COMPILE, false)
3338
 
  AM_CONDITIONAL(UNIX_QNX4_COMPILE, false)
3339
 
  AM_CONDITIONAL(UNIX_QNX6_COMPILE, false)
3340
 
  AM_CONDITIONAL(UNIX_SOLARIS_COMPILE, false)
3341
 
  AM_CONDITIONAL(UNIX_RHAPSODY_COMPILE, false)
3342
 
  AM_CONDITIONAL(UNIX_OPENSTEP_COMPILE, false)
3343
 
  AM_CONDITIONAL(UNIX_NEXTSTEP_COMPILE, false)
3344
 
  AM_CONDITIONAL(UNIX_OPENSERVER5_COMPILE, false)
3345
 
  AM_CONDITIONAL(UNIX_OPENSERVER6_COMPILE, false)  
3346
 
  AM_CONDITIONAL(UNIX_UNIXWARE_COMPILE, false)  
3347
 
  AM_CONDITIONAL(UNIX_HPUX_COMPILE, false)
3348
 
  AM_CONDITIONAL(SYLLABLE_COMPILE, false)
3349
 
  AM_CONDITIONAL(WIN32_COMPILE, false)
3350
 
  AM_CONDITIONAL(MSDOS_COMPILE, false)
3351
 
  AM_CONDITIONAL(OS2_COMPILE, false)
3352
 
  AM_CONDITIONAL(BEOS_COMPILE, true)
3353
 
  AM_CONDITIONAL(AMIGA_COMPILE, false)
3354
 
  AM_CONDITIONAL(UNIX_MACOSX_COMPILE, false)
3355
 
  AM_CONDITIONAL(DINGOO_NATIVE_COMPILE, false)
3356
 
  AM_CONDITIONAL(SUPPORT_CMDLINE_TOOLS, true)
3357
 
  AM_CONDITIONAL(HAVE_TRANSLATION, false)
3358
 
  AM_CONDITIONAL(MAKE_BINDIST, true)
3359
 
else
3360
 
  AC_MSG_WARN([No architecture defined!])
3361
 
fi
3362
 
 
3363
 
dnl Check wether we have gcc
3364
 
if test x"$GCC" = "xyes" ; then
3365
 
  AC_DEFINE(USE_GCC,, [Define when using gcc] )
3366
 
fi
3367
 
 
3368
 
dnl Check wether we have gcc and solaris /usr/openwin stuff.
3369
 
dnl The headers there give zillions of warnings because of implicit int 
3370
 
dnl declarations. gcc's >= 2.6.3 know the `-Wno-implicit-int' option so I 
3371
 
dnl don't care about checking it out. MP
3372
 
 
3373
 
if test x"$GCC" = "xyes" ; then
3374
 
  case "$host_os" in
3375
 
    solaris*)
3376
 
      if echo ${CFLAGS} ${ARCH_INCLUDES} | grep "I/usr/openwin/include" > /dev/null 2>&1 ; then
3377
 
        CFLAGS="${CFLAGS} -Wno-implicit-int"
3378
 
      fi
3379
 
      ;;
3380
 
    *)
3381
 
      ;;  
3382
 
  esac
3383
 
fi
3384
 
 
3385
 
AC_SUBST(HAVE_READLINE)
3386
 
AC_SUBST(ARCH_INCLUDES)
3387
 
AC_SUBST(ARCH_LIBS)
3388
 
AC_SUBST(ARCH_DIR)
3389
 
AC_SUBST(ARCH_SRC_DIR)
3390
 
AC_SUBST(ARCH_MAKE_BINDIST_DIR)
3391
 
AC_SUBST(ARCH_EXTRA_SUBDIR)
3392
 
AC_SUBST(UI_LIBS)
3393
 
AC_SUBST(SDL_EXTRA_LIBS)
3394
 
AC_SUBST(SOUND_USS_OBJ)
3395
 
AC_SUBST(SOUND_SGI_OBJ)
3396
 
AC_SUBST(SOUND_HPUX_OBJ)
3397
 
AC_SUBST(SOUND_AIX_OBJ)
3398
 
AC_SUBST(SOUND_MIDAS_OBJ)
3399
 
AC_SUBST(SOUND_SDL_OBJ)
3400
 
 
3401
 
if test "$prefix" = NONE && test "$exec_prefix" = NONE; then
3402
 
  PREFIX="$ac_default_prefix"
3403
 
elif test "$prefix" = NONE; then
3404
 
  PREFIX="$exec_prefix"
3405
 
else
3406
 
  PREFIX="$prefix"
3407
 
fi
3408
 
 
3409
 
AC_DEFINE_UNQUOTED(PREFIX, "$PREFIX",
3410
 
                   [Where do we want to install the executable?])
3411
 
 
3412
 
dnl Fix for po directory Makefile
3413
 
case "$host_os" in
3414
 
  freebsd*)
3415
 
    AM_CONDITIONAL(PO_SRCDIR_PREFIX, false)
3416
 
    ;;
3417
 
  *)
3418
 
    AM_CONDITIONAL(PO_SRCDIR_PREFIX, true)
3419
 
    ;;
3420
 
esac
3421
 
 
3422
 
dnl Path for keymaps, ROMs etc.
3423
 
case "$host_os" in
3424
 
  netbsd*)
3425
 
    VICEDIR="$PREFIX/share/vice"
3426
 
    AM_CONDITIONAL(ALTERNATE_DOCDIR, true)
3427
 
    ;;
3428
 
  freebsd*)
3429
 
    VICEDIR="$PREFIX/lib/vice"
3430
 
    AM_CONDITIONAL(ALTERNATE_DOCDIR, true)
3431
 
    ;;
3432
 
  linux*)
3433
 
    if test x"$host_cpu" = "xx86_64"; then
3434
 
      VICEDIR="$PREFIX/lib/vice"
3435
 
      AM_CONDITIONAL(ALTERNATE_DOCDIR, false)
3436
 
    else
3437
 
      VICEDIR="$PREFIX/lib/vice"
3438
 
      AM_CONDITIONAL(ALTERNATE_DOCDIR, false)
3439
 
    fi
3440
 
    ;;
3441
 
  *)
3442
 
    VICEDIR="$PREFIX/lib/vice"
3443
 
    AM_CONDITIONAL(ALTERNATE_DOCDIR, false)
3444
 
    ;;  
3445
 
esac
3446
 
AC_SUBST(VICEDIR)
3447
 
 
3448
 
if false ; then
3449
 
    dnl Now produce the directories & Makefiles.
3450
 
 
3451
 
    mkdir -p arch/amigaos
3452
 
    mkdir -p arch/beos
3453
 
    mkdir -p arch/msdos
3454
 
    mkdir -p arch/os2
3455
 
    mkdir -p arch/os2/dialogs
3456
 
    mkdir -p arch/os2/icons
3457
 
    mkdir -p arch/os2/kbd
3458
 
    mkdir -p arch/os2/snippets
3459
 
    mkdir -p arch/os2/vac++
3460
 
    mkdir -p arch/sdl
3461
 
    mkdir -p arch/sdl/win32-msvc
3462
 
    mkdir -p arch/sdl/win32-watcom
3463
 
    mkdir -p arch/sdl/win64-msvc
3464
 
    mkdir -p arch/sdl/winmips-msvc
3465
 
    mkdir -p arch/sdl/dingoo-files
3466
 
    mkdir -p arch/sdl/syllable-files
3467
 
    mkdir -p arch/sdl/xbox
3468
 
    mkdir -p arch/unix
3469
 
    mkdir -p arch/unix/gp2x
3470
 
    mkdir -p arch/unix/gp2x/minimal
3471
 
    mkdir -p arch/unix/gp2x/wiz
3472
 
    mkdir -p arch/unix/gui
3473
 
    mkdir -p arch/unix/readline
3474
 
    mkdir -p arch/unix/x11
3475
 
    mkdir -p arch/unix/x11/gnome
3476
 
    mkdir -p arch/unix/x11/xaw
3477
 
    mkdir -p arch/unix/x11/xaw/widgets
3478
 
    mkdir -p arch/unix/macosx
3479
 
    mkdir -p arch/unix/macosx/cocoa
3480
 
    mkdir -p arch/unix/macosx/cocoa/view
3481
 
    mkdir -p arch/unix/macosx/cocoa/menu
3482
 
    mkdir -p arch/unix/macosx/cocoa/dialog
3483
 
    mkdir -p arch/win32
3484
 
    mkdir -p arch/win32/utils
3485
 
    mkdir -p c128
3486
 
    mkdir -p c64
3487
 
    mkdir -p c64/cart
3488
 
    mkdir -p cbm2
3489
 
    mkdir -p core
3490
 
    mkdir -p crtc
3491
 
    mkdir -p diskimage
3492
 
    mkdir -p drive
3493
 
    mkdir -p drive/iec
3494
 
    mkdir -p drive/iec/c64exp
3495
 
    mkdir -p drive/iec/plus4exp
3496
 
    mkdir -p drive/iec128dcr
3497
 
    mkdir -p drive/iecieee
3498
 
    mkdir -p drive/ieee
3499
 
    mkdir -p drive/tcbm
3500
 
    mkdir -p fileio
3501
 
    mkdir -p fsdevice
3502
 
    mkdir -p gfxoutputdrv
3503
 
    mkdir -p iecbus
3504
 
    mkdir -p imagecontents
3505
 
    mkdir -p lib
3506
 
    mkdir -p monitor
3507
 
    mkdir -p lib/p64
3508
 
    mkdir -p parallel
3509
 
    mkdir -p pet
3510
 
    mkdir -p platform
3511
 
    mkdir -p plus4
3512
 
    mkdir -p printerdrv
3513
 
    mkdir -p raster
3514
 
    mkdir -p resid
3515
 
    mkdir -p resid-dtv
3516
 
    mkdir -p resid-fp
3517
 
    mkdir -p rs232drv
3518
 
    mkdir -p rtc
3519
 
    mkdir -p serial
3520
 
    mkdir -p sid
3521
 
    mkdir -p sounddrv
3522
 
    mkdir -p tape
3523
 
    mkdir -p userport
3524
 
    mkdir -p vdc
3525
 
    mkdir -p vdrive
3526
 
    mkdir -p vic20
3527
 
    mkdir -p vic20/cart
3528
 
    mkdir -p vicii
3529
 
    mkdir -p viciisc
3530
 
    mkdir -p video 
3531
 
 
3532
 
    if test x"$srcdir" != "x." ; then
3533
 
        BINDIR="./bin"
3534
 
        mkdir -p "$BINDIR"
3535
 
        rm -f "$BINDIR/C64" "$BINDIR/PET" "$BINDIR/VIC20"
3536
 
        $LN_S "../$srcdir/../bin/C64" "$BINDIR/C64"
3537
 
        $LN_S "../$srcdir/../bin/PET" "$BINDIR/PET"
3538
 
        $LN_S "../$srcdir/../bin/VIC20" "$BINDIR/VIC20"
3539
 
    else
3540
 
        BINDIR="../bin"
3541
 
    fi
3542
 
 
3543
 
    AC_SUBST(BINDIR)
3544
 
fi
3545
 
 
3546
 
AC_OUTPUT([Makefile
3547
 
           vice.spec
3548
 
           vice-gtk.spec
3549
 
           vice-mint.spec
3550
 
           vice-mint-sdl.spec
3551
 
           build/Makefile
3552
 
           data/Makefile
3553
 
           data/C128/Makefile
3554
 
           data/C64/Makefile
3555
 
           data/C64DTV/Makefile
3556
 
           data/CBM-II/Makefile
3557
 
           data/DRIVES/Makefile
3558
 
           data/PET/Makefile
3559
 
           data/PLUS4/Makefile
3560
 
           data/PRINTER/Makefile
3561
 
           data/VIC20/Makefile
3562
 
           data/fonts/Makefile
3563
 
           doc/Makefile
3564
 
           doc/html/Makefile
3565
 
           man/Makefile
3566
 
           src/Makefile
3567
 
           src/debug.h
3568
 
           src/gentranslate_h.sh
3569
 
           src/arch/Makefile
3570
 
           src/arch/amigaos/Makefile
3571
 
           src/arch/amigaos/genintl_h.sh
3572
 
           src/arch/beos/Makefile
3573
 
           src/arch/msdos/Makefile
3574
 
           src/arch/os2/Makefile
3575
 
           src/arch/os2/dialogs/Makefile
3576
 
           src/arch/os2/kbd/Makefile
3577
 
           src/arch/os2/snippets/Makefile
3578
 
           src/arch/os2/vac++/Makefile
3579
 
           src/arch/sdl/Makefile
3580
 
           src/arch/sdl/win32-msvc/Makefile
3581
 
           src/arch/sdl/win32-watcom/Makefile
3582
 
           src/arch/sdl/win64-msvc/Makefile
3583
 
           src/arch/sdl/winmips-msvc/Makefile
3584
 
           src/arch/sdl/dingoo-files/Makefile
3585
 
           src/arch/sdl/syllable-files/Makefile
3586
 
           src/arch/sdl/xbox/Makefile
3587
 
           src/arch/unix/Makefile
3588
 
           src/arch/unix/gp2x/Makefile
3589
 
           src/arch/unix/gp2x/minimal/Makefile
3590
 
           src/arch/unix/gp2x/wiz/Makefile
3591
 
           src/arch/unix/gui/Makefile
3592
 
           src/arch/unix/next_open_rhap/vice.info
3593
 
           src/arch/unix/readline/Makefile
3594
 
           src/arch/unix/x11/Makefile
3595
 
           src/arch/unix/x11/gnome/Makefile
3596
 
           src/arch/unix/x11/xaw/Makefile
3597
 
           src/arch/unix/x11/xaw/widgets/Makefile
3598
 
           src/arch/unix/macosx/Makefile
3599
 
           src/arch/unix/macosx/cocoa/Makefile
3600
 
           src/arch/unix/macosx/cocoa/view/Makefile
3601
 
           src/arch/unix/macosx/cocoa/menu/Makefile
3602
 
           src/arch/unix/macosx/cocoa/dialog/Makefile
3603
 
           src/arch/unix/macosx/Resources/Makefile
3604
 
           src/arch/unix/macosx/Resources/English.lproj/Makefile
3605
 
           src/arch/win32/Makefile
3606
 
           src/arch/win32/vice-version.bat
3607
 
           src/arch/win32/utils/Makefile
3608
 
           src/arch/win64/Makefile
3609
 
           src/c128/Makefile
3610
 
           src/c64/Makefile
3611
 
           src/c64/cart/Makefile
3612
 
           src/c64dtv/Makefile
3613
 
           src/cbm2/Makefile
3614
 
           src/core/Makefile
3615
 
           src/crtc/Makefile
3616
 
           src/diskimage/Makefile
3617
 
           src/drive/Makefile
3618
 
           src/drive/iec/Makefile
3619
 
           src/drive/iec/c64exp/Makefile
3620
 
           src/drive/iec/plus4exp/Makefile
3621
 
           src/drive/iec128dcr/Makefile
3622
 
           src/drive/iecieee/Makefile
3623
 
           src/drive/ieee/Makefile
3624
 
           src/drive/tcbm/Makefile
3625
 
           src/fileio/Makefile
3626
 
           src/fsdevice/Makefile
3627
 
           src/gfxoutputdrv/Makefile
3628
 
           src/iecbus/Makefile
3629
 
           src/imagecontents/Makefile
3630
 
           src/lib/Makefile
3631
 
           src/lib/p64/Makefile
3632
 
           src/monitor/Makefile
3633
 
           src/parallel/Makefile
3634
 
           src/pet/Makefile
3635
 
           src/platform/Makefile
3636
 
           src/plus4/Makefile
3637
 
           src/printerdrv/Makefile
3638
 
           src/raster/Makefile
3639
 
           src/rs232drv/Makefile
3640
 
           src/rtc/Makefile
3641
 
           src/serial/Makefile
3642
 
           src/sid/Makefile
3643
 
           src/sounddrv/Makefile
3644
 
           src/tape/Makefile
3645
 
           src/userport/Makefile
3646
 
           src/vdc/Makefile
3647
 
           src/vdrive/Makefile
3648
 
           src/vic20/Makefile
3649
 
           src/vic20/cart/Makefile
3650
 
           src/vicii/Makefile
3651
 
           src/viciisc/Makefile
3652
 
           src/video/Makefile
3653
 
           src/version.h
3654
 
           po/Makefile.in
3655
 
           ])
3656
 
 
3657
 
dnl Local Variables:
3658
 
dnl mode: autoconf
3659
 
dnl compile-command: "autoconf"
3660
 
dnl End: