fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1#*****************************************************************************
2#* pce *
3#*****************************************************************************
4
5#*****************************************************************************
6#* File name: configure.ac *
7#* Created: 2002-05-20 by Hampa Hug <hampa@hampa.ch> *
8#* Copyright: (C) 2002-2021 Hampa Hug <hampa@hampa.ch> *
9#*****************************************************************************
10
11#*****************************************************************************
12#* This program is free software. You can redistribute it and / or modify it *
13#* under the terms of the GNU General Public License version 2 as published *
14#* by the Free Software Foundation. *
15#* *
16#* This program is distributed in the hope that it will be useful, but *
17#* WITHOUT ANY WARRANTY, without even the implied warranty of *
18#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19#* Public License for more details. *
20#*****************************************************************************
21
22
23AC_PREREQ(2.64)
24
25AC_INIT([pce])
26AC_CONFIG_SRCDIR([Makefile.in])
27AC_CONFIG_HEADERS([src/config.h])
28
29
30#-----------------------------------------------------------------------------
31# package version
32
33AC_MSG_CHECKING([pce version])
34if test ! -r "$srcdir/version" ; then
35 AC_MSG_RESULT([file 'version' not found in source directory])
36 exit 1
37fi
38
39read p PCE_VERSION_MAJ PCE_VERSION_MIN PCE_VERSION_MIC dstr r < "$srcdir/version"
40
41PCE_VERSION_STR=$dstr
42
43if test "x$dstr" = "xscm" ; then
44 if test -d "$srcdir/.git" ; then
45 tmp=gitlog.$$.tmp
46 ( cd "$srcdir" && git log -1 --date=iso --abbrev=8 --pretty="format:%h %cd" HEAD ) > "$tmp" 2> /dev/null
47 read hash date time rest < "$tmp"
48 rm -f "$tmp"
49 date=`echo "$date" | sed -e "s/-//g"`
50 dirty=`cd "$srcdir" && git describe --tags --dirty --always 2> /dev/null`
51 case "$dirty" in
52 *-dirty)
53 dirty=-mod
54 ;;
55 *)
56 dirty=""
57 ;;
58 esac
59 PCE_VERSION_STR="$date-$hash$dirty"
60 fi
61elif test "x$dstr" = "x" ; then
62 PCE_VERSION_STR="$PCE_VERSION_MAJ.$PCE_VERSION_MIN.$PCE_VERSION_MIC"
63fi
64AC_SUBST(PCE_VERSION_MAJ)
65AC_SUBST(PCE_VERSION_MIN)
66AC_SUBST(PCE_VERSION_MIC)
67AC_SUBST(PCE_VERSION_STR)
68AC_DEFINE_UNQUOTED(PCE_VERSION_MAJ, $PCE_VERSION_MAJ)
69AC_DEFINE_UNQUOTED(PCE_VERSION_MIN, $PCE_VERSION_MIN)
70AC_DEFINE_UNQUOTED(PCE_VERSION_MIC, $PCE_VERSION_MIC)
71AC_DEFINE_UNQUOTED(PCE_VERSION_STR, "$PCE_VERSION_STR")
72AC_MSG_RESULT([$PCE_VERSION_STR ($PCE_VERSION_MAJ.$PCE_VERSION_MIN.$PCE_VERSION_MIC)])
73
74
75#-----------------------------------------------------------------------------
76# host
77
78AC_CANONICAL_HOST
79
80AC_MSG_CHECKING([host OS])
81PCE_HOST_LINUX=0
82PCE_HOST_WINDOWS=0
83PCE_HOST_SUNOS=0
84PCE_HOST_NETBSD=0
85PCE_HOST_MACOS=0
86case "$host_os" in
87[[Ll]]inux*)
88 PCE_HOST_LINUX=1
89 AC_DEFINE(PCE_HOST_LINUX)
90 AC_MSG_RESULT([Linux])
91 ;;
92mingw*)
93 PCE_HOST_WINDOWS=1
94 AC_DEFINE(PCE_HOST_WINDOWS)
95 AC_MSG_RESULT([Windows])
96 ;;
97SunOS*)
98 PCE_HOST_SUNOS=1
99 AC_DEFINE(PCE_HOST_SUNOS)
100 AC_MSG_RESULT([SunOS])
101 ;;
102netbsd*)
103 PCE_HOST_NETBSD=1
104 AC_DEFINE(PCE_HOST_NETBSD)
105 AC_MSG_RESULT([NetBSD])
106 ;;
107darwin*)
108 PCE_HOST_MACOS=1
109 AC_DEFINE(PCE_HOST_MACOS)
110 AC_MSG_RESULT([macOS])
111 ;;
112*)
113 AC_MSG_RESULT([unknown ($host_os)])
114 ;;
115esac
116AC_SUBST(PCE_HOST_LINUX)
117AC_SUBST(PCE_HOST_WINDOWS)
118AC_SUBST(PCE_HOST_SUNOS)
119AC_SUBST(PCE_HOST_NETBSD)
120AC_SUBST(PCE_HOST_MACOS)
121
122AC_MSG_CHECKING([host cpu])
123PCE_HOST_IA32=0
124PCE_HOST_PPC=0
125PCE_HOST_SPARC=0
126case "$host_cpu" in
127i?86)
128 PCE_HOST_IA32=1
129 AC_DEFINE(PCE_HOST_IA32)
130 AC_MSG_RESULT([IA32])
131 ;;
132powerpc*)
133 PCE_HOST_PPC=1
134 AC_DEFINE(PCE_HOST_PPC)
135 AC_MSG_RESULT([powerpc])
136 ;;
137sparc* | sun4*)
138 PCE_HOST_SPARC=1
139 AC_DEFINE(PCE_HOST_SPARC)
140 AC_MSG_RESULT([sparc])
141 ;;
142*)
143 AC_MSG_RESULT([unknown ($host_cpu)])
144 ;;
145esac
146AC_SUBST(PCE_HOST_IA32)
147AC_SUBST(PCE_HOST_PPC)
148AC_SUBST(PCE_HOST_SPARC)
149
150
151#-----------------------------------------------------------------------------
152# Checks for programs
153
154AC_PROG_CC
155AC_PROG_INSTALL
156case "$INSTALL" in
157.*)
158 d=`dirname "$INSTALL"`
159 f=`basename "$INSTALL"`
160 INSTALL=`cd "$d" && pwd`/"$f"
161 ;;
162esac
163AC_PATH_PROG(AR, ar, ar)
164AC_PROG_RANLIB
165AC_PROG_MAKE_SET
166AC_PROG_LN_S
167
168AC_PATH_PROG(NASM, nasm,)
169if test -x "$NASM" ; then
170 PCE_HAVE_NASM=1
171else
172 PCE_HAVE_NASM=0
173fi
174AC_SUBST(PCE_HAVE_NASM)
175
176AC_PATH_PROG(IHEX, ihex,)
177if test -x "$IHEX" ; then
178 PCE_HAVE_IHEX=1
179else
180 PCE_HAVE_IHEX=0
181fi
182AC_SUBST(PCE_HAVE_IHEX)
183
184
185#-----------------------------------------------------------------------------
186# Checks for header files.
187
188AC_CHECK_HEADERS( \
189 arpa/inet.h \
190 fcntl.h \
191 linux/if_tun.h \
192 linux/tcp.h \
193 limits.h \
194 netdb.h \
195 netinet/in.h \
196 poll.h \
197 sys/ioctl.h \
198 sys/poll.h \
199 sys/socket.h \
200 sys/soundcard.h \
201 sys/stat.h \
202 sys/time.h \
203 sys/types.h \
204 termios.h \
205 unistd.h \
206 vmnet/vmnet.h
207)
208
209AC_CHECK_HEADER(stdint.h,
210 [AC_DEFINE(HAVE_STDINT_H)
211 PCE_HAVE_STDINT_H=1],
212 PCE_HAVE_STDINT_H=0
213)
214AC_SUBST(PCE_HAVE_STDINT_H)
215
216AC_CHECK_HEADER(inttypes.h,
217 [AC_DEFINE(HAVE_INTTYPES_H)
218 PCE_HAVE_INTTYPES_H=1],
219 PCE_HAVE_INTTYPES_H=0
220)
221AC_SUBST(PCE_HAVE_INTTYPES_H)
222
223
224#-----------------------------------------------------------------------------
225# Checks for libraries
226
227AC_FUNC_FSEEKO
228AC_CHECK_FUNCS(ftruncate futimes gettimeofday nanosleep sleep usleep)
229
230AC_SEARCH_LIBS(socket, socket)
231AC_SEARCH_LIBS(accept, socket)
232AC_SEARCH_LIBS(gethostbyname, nsl resolv socket)
233AC_SEARCH_LIBS(inet_aton, nsl resolv socket)
234
235AC_PATH_X
236if test "x$no_x" = "xyes" ; then
237 PCE_ENABLE_X11=0
238 PCE_X11_CFLAGS=""
239 PCE_X11_LIBS=""
240else
241 PCE_ENABLE_X11=1
242 if test -n "$x_includes" ; then
243 PCE_X11_CFLAGS="-I$x_includes"
244 else
245 PCE_X11_CFLAGS=""
246 fi
247 if test -n "$x_libraries" ; then
248 PCE_X11_LIBS="-L$x_libraries -lX11"
249 else
250 PCE_X11_LIBS="-lX11"
251 fi
252 AC_DEFINE(PCE_ENABLE_X11)
253fi
254AC_SUBST(PCE_ENABLE_X11)
255AC_SUBST(PCE_X11_CFLAGS)
256AC_SUBST(PCE_X11_LIBS)
257
258
259PCE_ENABLE_SDL=0
260PCE_ENABLE_SDL1=0
261PCE_ENABLE_SDL2=0
262AC_MSG_CHECKING([for SDL])
263AC_ARG_WITH(sdl,
264 [AS_HELP_STRING([--with-sdl], [Build the SDL terminal [detected]])],
265 [
266 case "$withval" in
267 "no")
268 AC_MSG_RESULT([no (forced)])
269 ;;
270 "1")
271 PCE_ENABLE_SDL=1
272 PCE_ENABLE_SDL1=1
273 AC_MSG_RESULT([1 (forced)])
274 ;;
275 "2")
276 PCE_ENABLE_SDL=1
277 PCE_ENABLE_SDL2=1
278 AC_MSG_RESULT([2 (forced)])
279 ;;
280 esac
281 ],
282 [
283 if sdl2-config --version > /dev/null 2>&1 ; then
284 PCE_ENABLE_SDL=1
285 PCE_ENABLE_SDL2=1
286 AC_MSG_RESULT([2 (detected)])
287 elif sdl-config --version > /dev/null 2>&1 ; then
288 PCE_ENABLE_SDL=1
289 PCE_ENABLE_SDL1=1
290 AC_MSG_RESULT([1 (detected)])
291 else
292 AC_MSG_RESULT([no (detected)])
293 fi
294 ]
295)
296if test "x$PCE_ENABLE_SDL1" != "x0" ; then
297 PCE_SDL_CFLAGS=`sdl-config --cflags`
298 PCE_SDL_LIBS=`sdl-config --libs`
299 AC_DEFINE(PCE_ENABLE_SDL)
300 AC_DEFINE(PCE_ENABLE_SDL1)
301elif test "x$PCE_ENABLE_SDL2" != "x0" ; then
302 PCE_SDL_CFLAGS=`sdl2-config --cflags`
303 PCE_SDL_LIBS=`sdl2-config --libs`
304 AC_DEFINE(PCE_ENABLE_SDL)
305 AC_DEFINE(PCE_ENABLE_SDL2)
306fi
307AC_SUBST(PCE_ENABLE_SDL)
308AC_SUBST(PCE_ENABLE_SDL1)
309AC_SUBST(PCE_ENABLE_SDL2)
310AC_SUBST(PCE_SDL_CFLAGS)
311AC_SUBST(PCE_SDL_LIBS)
312
313
314#-----------------------------------------------------------------------------
315# Checks for options
316
317AC_ARG_ENABLE(largefile,
318 [AS_HELP_STRING([--disable-largefile], [Disable large file support [no]])],
319 opt_large=$enableval
320)
321if test "$opt_large" = "no" ; then
322 PCE_LARGE_FILE="0"
323else
324 AC_DEFINE(PCE_LARGE_FILE)
325 PCE_LARGE_FILE="1"
326fi
327AC_SUBST(PCE_LARGE_FILE)
328
329
330if test -d "$srcdir/src/arch/ibmpc"; then have_ibmpc=1; else have_ibmpc=0; fi
331if test -d "$srcdir/src/arch/macplus"; then have_macplus=1; else have_macplus=0; fi
332if test -d "$srcdir/src/arch/rc759"; then have_rc759=1; else have_rc759=0; fi
333if test -d "$srcdir/src/arch/sim405"; then have_sim405=1; else have_sim405=0; fi
334if test -d "$srcdir/src/arch/simarm"; then have_simarm=1; else have_simarm=0; fi
335if test -d "$srcdir/src/arch/sims32"; then have_sims32=1; else have_sims32=0; fi
336if test -d "$srcdir/src/arch/vic20"; then have_vic20=1; else have_vic20=0; fi
337
338
339AC_MSG_CHECKING([whether to build the Atari ST emulator])
340AC_ARG_ENABLE(atari-st,
341 [AS_HELP_STRING([--enable-atari-st], [Enable the Atari ST emulator [yes]])],
342 [
343 if test "x$enableval" = "xyes" ; then
344 PCE_BUILD_ATARIST=1
345 AC_MSG_RESULT([yes (forced)])
346 else
347 PCE_BUILD_ATARIST=0
348 AC_MSG_RESULT([no (forced)])
349 fi
350 ],
351 [
352 PCE_BUILD_ATARIST=1
353 AC_MSG_RESULT([yes (default)])
354 ]
355)
356AC_SUBST(PCE_BUILD_ATARIST)
357if test $PCE_BUILD_ATARIST -eq 1 ; then
358 AC_DEFINE(PCE_BUILD_ATARIST)
359fi
360
361
362AC_MSG_CHECKING([whether to build the CPM-80 emulator])
363AC_ARG_ENABLE(cpm80,
364 [AS_HELP_STRING([--enable-cpm80], [Enable the CPM-80 emulator [yes]])],
365 [
366 if test "x$enableval" = "xyes" ; then
367 PCE_BUILD_CPM80=1
368 AC_MSG_RESULT([yes (forced)])
369 else
370 PCE_BUILD_CPM80=0
371 AC_MSG_RESULT([no (forced)])
372 fi
373 ],
374 [
375 PCE_BUILD_CPM80=1
376 AC_MSG_RESULT([yes (default)])
377 ]
378)
379AC_SUBST(PCE_BUILD_CPM80)
380if test "x$PCE_BUILD_CPM80" = "x1" ; then
381 AC_DEFINE(PCE_BUILD_CPM80)
382fi
383
384
385AC_MSG_CHECKING([whether to build the IBM PC emulator])
386if test "x$have_ibmpc" != "x1" ; then
387 PCE_BUILD_IBMPC=0
388 AC_MSG_RESULT([no (no source)])
389else
390 AC_ARG_ENABLE(ibmpc,
391 [AS_HELP_STRING([--enable-ibmpc], [Enable the IBM PC emulator [yes]])],
392 [
393 if test "x$enableval" = "xyes" ; then
394 PCE_BUILD_IBMPC=1
395 AC_MSG_RESULT([yes (forced)])
396 else
397 PCE_BUILD_IBMPC=0
398 AC_MSG_RESULT([no (forced)])
399 fi
400 ],
401 [
402 PCE_BUILD_IBMPC=1
403 AC_MSG_RESULT([yes (default)])
404 ]
405 )
406fi
407AC_SUBST(PCE_BUILD_IBMPC)
408if test $PCE_BUILD_IBMPC -eq 1 ; then
409 AC_DEFINE(PCE_BUILD_IBMPC)
410fi
411
412
413AC_MSG_CHECKING([whether to build the IBM PC ROM])
414AC_ARG_ENABLE(ibmpc-rom,
415 [AS_HELP_STRING([--enable-ibmpc-rom], [Build the IBM PC ROM from source [no]])],
416 [
417 if test "x$enableval" = "xyes" ; then
418 PCE_BUILD_IBMPC_ROM=1
419 AC_MSG_RESULT([yes])
420 else
421 PCE_BUILD_IBMPC_ROM=0
422 AC_MSG_RESULT([no])
423 fi
424 ],
425 [
426 PCE_BUILD_IBMPC_ROM=0
427 AC_MSG_RESULT([no (default)])
428 ]
429)
430AC_SUBST(PCE_BUILD_IBMPC_ROM)
431
432
433AC_MSG_CHECKING([whether to build the Mac Plus emulator])
434if test "x$have_macplus" != "x1" ; then
435 PCE_BUILD_MACPLUS=0
436 AC_MSG_RESULT([no (no source)])
437else
438 AC_ARG_ENABLE(macplus,
439 [AS_HELP_STRING([--enable-macplus], [Enable the Mac Plus emulator [yes]])],
440 [
441 if test "x$enableval" = "xyes" ; then
442 PCE_BUILD_MACPLUS=1
443 AC_MSG_RESULT([yes (forced)])
444 else
445 PCE_BUILD_MACPLUS=0
446 AC_MSG_RESULT([no (forced)])
447 fi
448 ],
449 [
450 PCE_BUILD_MACPLUS=1
451 AC_MSG_RESULT([yes (default)])
452 ]
453 )
454fi
455AC_SUBST(PCE_BUILD_MACPLUS)
456if test $PCE_BUILD_MACPLUS -eq 1 ; then
457 AC_DEFINE(PCE_BUILD_MACPLUS)
458fi
459
460
461AC_MSG_CHECKING([whether to build the Mac Plus ROM])
462AC_ARG_ENABLE(macplus-rom,
463 [AS_HELP_STRING([--enable-macplus-rom], [Build the Mac Plus ROM from source [no]])],
464 [
465 if test "x$enableval" = "xyes" ; then
466 PCE_BUILD_MACPLUS_ROM=1
467 AC_MSG_RESULT([yes])
468 else
469 PCE_BUILD_MACPLUS_ROM=0
470 AC_MSG_RESULT([no])
471 fi
472 ],
473 [
474 PCE_BUILD_MACPLUS_ROM=0
475 AC_MSG_RESULT([no (default)])
476 ]
477)
478AC_SUBST(PCE_BUILD_MACPLUS_ROM)
479
480
481AC_MSG_CHECKING([whether to build the RC759 Piccoline])
482if test "x$have_rc759" != "x1" ; then
483 PCE_BUILD_RC759=0
484 AC_MSG_RESULT([no (no source)])
485else
486 AC_ARG_ENABLE(rc759,
487 [AS_HELP_STRING([--enable-rc759], [Enable the RC759 Piccoline [yes]])],
488 [
489 if test "x$enableval" = "xyes" ; then
490 PCE_BUILD_RC759=1
491 AC_MSG_RESULT([yes (forced)])
492 else
493 PCE_BUILD_RC759=0
494 AC_MSG_RESULT([no (forced)])
495 fi
496 ],
497 [
498 PCE_BUILD_RC759=1
499 AC_MSG_RESULT([yes (default)])
500 ]
501 )
502fi
503AC_SUBST(PCE_BUILD_RC759)
504if test $PCE_BUILD_RC759 -eq 1 ; then
505 AC_DEFINE(PCE_BUILD_RC759)
506fi
507
508
509AC_MSG_CHECKING([whether to build the PPC405 simulator])
510if test "x$have_sim405" != "x1" ; then
511 PCE_BUILD_SIM405=0
512 AC_MSG_RESULT([no (no source)])
513else
514 AC_ARG_ENABLE(sim405,
515 [AS_HELP_STRING([--enable-sim405], [Enable the PPC405 simulator [yes]])],
516 [
517 if test "x$enableval" = "xyes" ; then
518 PCE_BUILD_SIM405=1
519 AC_MSG_RESULT([yes (forced)])
520 else
521 PCE_BUILD_SIM405=0
522 AC_MSG_RESULT([no (forced)])
523 fi
524 ],
525 [
526 PCE_BUILD_SIM405=1
527 AC_MSG_RESULT([yes (default)])
528 ]
529 )
530fi
531AC_SUBST(PCE_BUILD_SIM405)
532if test "x$PCE_BUILD_SIM405" = "x1" ; then
533 AC_DEFINE(PCE_BUILD_SIM405)
534fi
535
536
537AC_MSG_CHECKING([whether to build the sparc32 simulator])
538if test "x$have_sims32" != "x1" ; then
539 PCE_BUILD_SIMS32=0
540 AC_MSG_RESULT([no (no source)])
541else
542 AC_ARG_ENABLE(sims32,
543 [AS_HELP_STRING([--enable-sims32], [Enable the sparc32 simulator [yes]])],
544 [
545 if test "x$enableval" = "xyes" ; then
546 PCE_BUILD_SIMS32=1
547 AC_MSG_RESULT([yes (forced)])
548 else
549 PCE_BUILD_SIMS32=0
550 AC_MSG_RESULT([no (forced)])
551 fi
552 ],
553 [
554 PCE_BUILD_SIMS32=1
555 AC_MSG_RESULT([yes (default)])
556 ]
557 )
558fi
559AC_SUBST(PCE_BUILD_SIMS32)
560if test "x$PCE_BUILD_SIMS32" = "x1" ; then
561 AC_DEFINE(PCE_BUILD_SIMS32)
562fi
563
564
565AC_MSG_CHECKING([whether to build the arm simulator])
566if test "x$have_simarm" != "x1" ; then
567 PCE_BUILD_SIMARM=0
568 AC_MSG_RESULT([no (no source)])
569else
570 AC_ARG_ENABLE(simarm,
571 [AS_HELP_STRING([--enable-simarm], [Enable the arm simulator [yes]])],
572 [
573 if test "x$enableval" = "xyes" ; then
574 PCE_BUILD_SIMARM=1
575 AC_MSG_RESULT([yes (forced)])
576 else
577 PCE_BUILD_SIMARM=0
578 AC_MSG_RESULT([no (forced)])
579 fi
580 ],
581 [
582 PCE_BUILD_SIMARM=1
583 AC_MSG_RESULT([yes (default)])
584 ]
585 )
586fi
587AC_SUBST(PCE_BUILD_SIMARM)
588if test "x$PCE_BUILD_SIMARM" = "x1" ; then
589 AC_DEFINE(PCE_BUILD_SIMARM)
590fi
591
592
593AC_MSG_CHECKING([whether to build the VIC20 emulator])
594AC_ARG_ENABLE(vic20,
595 [AS_HELP_STRING([--enable-vic20], [Enable the VIC20 emulator [yes]])],
596 [
597 if test "x$enableval" = "xyes" ; then
598 PCE_BUILD_VIC20=1
599 AC_MSG_RESULT([yes (forced)])
600 else
601 PCE_BUILD_VIC20=0
602 AC_MSG_RESULT([no (forced)])
603 fi
604 ],
605 [
606 PCE_BUILD_VIC20=1
607 AC_MSG_RESULT([yes (default)])
608 ]
609)
610AC_SUBST(PCE_BUILD_VIC20)
611if test $PCE_BUILD_VIC20 -eq 1 ; then
612 AC_DEFINE(PCE_BUILD_VIC20)
613fi
614
615
616AC_MSG_CHECKING([whether to build the ZX Spectrum emulator])
617AC_ARG_ENABLE(spectrum,
618 [AS_HELP_STRING([--enable-spectrum], [Enable the ZX Spectrum emulator [yes]])],
619 [
620 if test "x$enableval" = "xyes" ; then
621 PCE_BUILD_SPECTRUM=1
622 AC_MSG_RESULT([yes (forced)])
623 else
624 PCE_BUILD_SPECTRUM=0
625 AC_MSG_RESULT([no (forced)])
626 fi
627 ],
628 [
629 PCE_BUILD_SPECTRUM=1
630 AC_MSG_RESULT([yes (default)])
631 ]
632)
633AC_SUBST(PCE_BUILD_SPECTRUM)
634if test $PCE_BUILD_SPECTRUM -eq 1 ; then
635 AC_DEFINE(PCE_BUILD_SPECTRUM)
636fi
637
638
639AC_MSG_CHECKING([whether to enable tun])
640AC_ARG_ENABLE(tun,
641 [AS_HELP_STRING([--enable-tun], [Enable tun networking [guessed]])],
642 [
643 if test "x$enableval" = "xyes" ; then
644 PCE_ENABLE_TUN=1
645 AC_MSG_RESULT([yes])
646 else
647 PCE_ENABLE_TUN=0
648 AC_MSG_RESULT([no])
649 fi
650 ],
651 [
652 h1=$ac_cv_header_linux_if_tun_h
653 h2=$ac_cv_header_sys_ioctl_h
654 h3=$ac_cv_header_sys_poll_h
655 h4=$ac_cv_header_sys_socket_h
656 if test "x$h1" = "xyes" -a "x$h2" = "xyes" -a "x$h3" = "xyes" -a "x$h4" = "xyes" ; then
657 PCE_ENABLE_TUN=1
658 AC_MSG_RESULT([yes (guess)])
659 else
660 PCE_ENABLE_TUN=0
661 AC_MSG_RESULT([no (guess)])
662 fi
663 ]
664)
665AC_SUBST(PCE_ENABLE_TUN)
666if test "x$PCE_ENABLE_TUN" = "x1" ; then
667 AC_DEFINE(PCE_ENABLE_TUN)
668fi
669
670
671AC_MSG_CHECKING([whether to enable vmnet])
672AC_ARG_ENABLE(vmnet,
673 [AS_HELP_STRING([--enable-vmnet], [Enable vmnet networking [guessed]])],
674 [
675 if test "x$enableval" = "xyes" ; then
676 PCE_ENABLE_VMNET=1
677 AC_MSG_RESULT([yes])
678 else
679 PCE_ENABLE_VMNET=0
680 AC_MSG_RESULT([no])
681 fi
682 ],[
683 PCE_ENABLE_VMNET=1
684 test "x$ac_cv_header_vmnet_vmnet_h" = "xyes" || PCE_ENABLE_VMNET=0
685 if test "x$PCE_ENABLE_VMNET" = "x1" ; then
686 AC_MSG_RESULT([yes (guess)])
687 else
688 AC_MSG_RESULT([no (guess)])
689 fi
690 ]
691)
692AC_SUBST(PCE_ENABLE_VMNET)
693if test "x$PCE_ENABLE_VMNET" = "x1" ; then
694 AC_DEFINE(PCE_ENABLE_VMNET)
695fi
696
697
698AC_MSG_CHECKING([whether to enable the posix file character driver])
699AC_ARG_ENABLE(char-posix,
700 [AS_HELP_STRING([--enable-char-posix], [Enable the posix file character driver [guessed]])],
701 [
702 if test "x$enableval" = "xyes" ; then
703 PCE_ENABLE_CHAR_POSIX=1
704 AC_MSG_RESULT([yes])
705 else
706 PCE_ENABLE_CHAR_POSIX=0
707 AC_MSG_RESULT([no])
708 fi
709 ],[
710 PCE_ENABLE_CHAR_POSIX=1
711 test "x$ac_cv_header_fcntl_h" = "xyes" || PCE_ENABLE_CHAR_POSIX=0
712 test "x$ac_cv_header_poll_h" = "xyes" || PCE_ENABLE_CHAR_POSIX=0
713 test "x$ac_cv_header_sys_stat_h" = "xyes" || PCE_ENABLE_CHAR_POSIX=0
714 test "x$ac_cv_header_unistd_h" = "xyes" || PCE_ENABLE_CHAR_POSIX=0
715 if test "x$PCE_ENABLE_CHAR_POSIX" = "x1" ; then
716 AC_MSG_RESULT([yes (guess)])
717 else
718 AC_MSG_RESULT([no (guess)])
719 fi
720 ]
721)
722AC_SUBST(PCE_ENABLE_CHAR_POSIX)
723if test "x$PCE_ENABLE_CHAR_POSIX" = "x1" ; then
724 AC_DEFINE(PCE_ENABLE_CHAR_POSIX)
725fi
726
727
728AC_MSG_CHECKING([whether to enable the PPP character driver])
729AC_ARG_ENABLE(char-ppp,
730 [AS_HELP_STRING([--enable-char-ppp], [Enable the PPP character driver [guessed]])],
731 [
732 if test "x$enableval" = "xyes" ; then
733 PCE_ENABLE_CHAR_PPP=1
734 AC_MSG_RESULT([yes])
735 else
736 PCE_ENABLE_CHAR_PPP=0
737 AC_MSG_RESULT([no])
738 fi
739 ],[
740 if test "x$PCE_ENABLE_TUN" = "x1" ; then
741 PCE_ENABLE_CHAR_PPP=1
742 AC_MSG_RESULT([yes (guess)])
743 else
744 PCE_ENABLE_CHAR_PPP=0
745 AC_MSG_RESULT([no (guess)])
746 fi
747 ]
748)
749AC_SUBST(PCE_ENABLE_CHAR_PPP)
750if test "x$PCE_ENABLE_CHAR_PPP" = "x1" ; then
751 AC_DEFINE(PCE_ENABLE_CHAR_PPP)
752fi
753
754
755AC_MSG_CHECKING([whether to enable the pty character driver])
756AC_ARG_ENABLE(char-pty,
757 [AS_HELP_STRING([--enable-char-pty], [Enable the pty character driver [guessed]])],
758 [
759 if test "x$enableval" = "xyes" ; then
760 PCE_ENABLE_CHAR_PTY=1
761 AC_MSG_RESULT([yes])
762 else
763 PCE_ENABLE_CHAR_PTY=0
764 AC_MSG_RESULT([no])
765 fi
766 ],[
767 PCE_ENABLE_CHAR_PTY=1
768 test "x$ac_cv_header_fcntl_h" = "xyes" || PCE_ENABLE_CHAR_PTY=0
769 test "x$ac_cv_header_termios_h" = "xyes" || PCE_ENABLE_CHAR_PTY=0
770 test "x$ac_cv_header_unistd_h" = "xyes" || PCE_ENABLE_CHAR_PTY=0
771 if test "x$PCE_ENABLE_CHAR_PTY" = "x1" ; then
772 AC_MSG_RESULT([yes (guess)])
773 else
774 AC_MSG_RESULT([no (guess)])
775 fi
776 ]
777)
778AC_SUBST(PCE_ENABLE_CHAR_PTY)
779if test "x$PCE_ENABLE_CHAR_PTY" = "x1" ; then
780 AC_DEFINE(PCE_ENABLE_CHAR_PTY)
781fi
782
783
784AC_MSG_CHECKING([whether to enable the SLIP character driver])
785AC_ARG_ENABLE(char-slip,
786 [AS_HELP_STRING([--enable-char-slip], [Enable the SLIP character driver [guessed]])],
787 [
788 if test "x$enableval" = "xyes" ; then
789 PCE_ENABLE_CHAR_SLIP=1
790 AC_MSG_RESULT([yes])
791 else
792 PCE_ENABLE_CHAR_SLIP=0
793 AC_MSG_RESULT([no])
794 fi
795 ],[
796 if test "x$PCE_ENABLE_TUN" = "x1" ; then
797 PCE_ENABLE_CHAR_SLIP=1
798 AC_MSG_RESULT([yes (guess)])
799 else
800 PCE_ENABLE_CHAR_SLIP=0
801 AC_MSG_RESULT([no (guess)])
802 fi
803 ]
804)
805AC_SUBST(PCE_ENABLE_CHAR_SLIP)
806if test "x$PCE_ENABLE_CHAR_SLIP" = "x1" ; then
807 AC_DEFINE(PCE_ENABLE_CHAR_SLIP)
808fi
809
810
811AC_MSG_CHECKING([whether to enable the TCP character driver])
812AC_ARG_ENABLE(char-tcp,
813 [AS_HELP_STRING([--enable-char-tcp], [Enable the TCP character driver [guessed]])],
814 [
815 if test "x$enableval" = "xyes" ; then
816 PCE_ENABLE_CHAR_TCP=1
817 AC_MSG_RESULT([yes])
818 else
819 PCE_ENABLE_CHAR_TCP=0
820 AC_MSG_RESULT([no])
821 fi
822 ],[
823 PCE_ENABLE_CHAR_TCP=1
824 test "x$ac_cv_header_arpa_inet_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
825 test "x$ac_cv_header_fcntl_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
826 test "x$ac_cv_header_netinet_in_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
827 test "x$ac_cv_header_netdb_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
828 test "x$ac_cv_header_sys_socket_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
829 test "x$ac_cv_header_poll_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
830 test "x$ac_cv_header_unistd_h" = "xyes" || PCE_ENABLE_CHAR_TCP=0
831 if test "x$PCE_ENABLE_CHAR_TCP" = "x1" ; then
832 AC_MSG_RESULT([yes (guess)])
833 else
834 AC_MSG_RESULT([no (guess)])
835 fi
836 ]
837)
838AC_SUBST(PCE_ENABLE_CHAR_TCP)
839if test "x$PCE_ENABLE_CHAR_TCP" = "x1" ; then
840 AC_DEFINE(PCE_ENABLE_CHAR_TCP)
841fi
842
843
844AC_MSG_CHECKING([whether to enable the termios character driver])
845AC_ARG_ENABLE(char-termios,
846 [AS_HELP_STRING([--enable-char-termios], [Enable the termios character driver [guessed]])],
847 [
848 if test "x$enableval" = "xyes" ; then
849 PCE_ENABLE_CHAR_TIOS=1
850 AC_MSG_RESULT([yes])
851 else
852 PCE_ENABLE_CHAR_TIOS=0
853 AC_MSG_RESULT([no])
854 fi
855 ],[
856 PCE_ENABLE_CHAR_TIOS=1
857 test "x$ac_cv_header_fcntl_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
858 test "x$ac_cv_header_sys_ioctl_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
859 test "x$ac_cv_header_sys_poll_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
860 test "x$ac_cv_header_termios_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
861 test "x$ac_cv_header_unistd_h" = "xyes" || PCE_ENABLE_CHAR_TIOS=0
862 if test "x$PCE_ENABLE_CHAR_TIOS" = "x1" ; then
863 AC_MSG_RESULT([yes (guess)])
864 else
865 AC_MSG_RESULT([no (guess)])
866 fi
867 ]
868)
869AC_SUBST(PCE_ENABLE_CHAR_TIOS)
870if test "x$PCE_ENABLE_CHAR_TIOS" = "x1" ; then
871 AC_DEFINE(PCE_ENABLE_CHAR_TIOS)
872fi
873
874
875AC_MSG_CHECKING([whether to enable the windows COM character driver])
876AC_ARG_ENABLE(char-wincom,
877 [AS_HELP_STRING([--enable-char-wincom], [Enable the windows COM character driver [guessed]])],
878 [
879 if test "x$enableval" = "xyes" ; then
880 PCE_ENABLE_CHAR_WINCOM=1
881 AC_MSG_RESULT([yes])
882 else
883 PCE_ENABLE_CHAR_WINCOM=0
884 AC_MSG_RESULT([no])
885 fi
886 ],[
887 if test "x$PCE_HOST_WINDOWS" = "x1" ; then
888 PCE_ENABLE_CHAR_WINCOM=1
889 AC_MSG_RESULT([yes (guess)])
890 else
891 PCE_ENABLE_CHAR_WINCOM=0
892 AC_MSG_RESULT([no (guess)])
893 fi
894 ]
895)
896AC_SUBST(PCE_ENABLE_CHAR_WINCOM)
897if test "x$PCE_ENABLE_CHAR_WINCOM" = "x1" ; then
898 AC_DEFINE(PCE_ENABLE_CHAR_WINCOM)
899fi
900
901
902AC_MSG_CHECKING([whether to enable the OSS sound driver])
903AC_ARG_ENABLE(sound-oss,
904 [AS_HELP_STRING([--enable-sound-oss], [Enable the OSS sound driver driver [guessed]])],
905 [
906 if test "x$enableval" = "xyes" ; then
907 PCE_ENABLE_SOUND_OSS=1
908 AC_MSG_RESULT([yes])
909 else
910 PCE_ENABLE_SOUND_OSS=0
911 AC_MSG_RESULT([no])
912 fi
913 ],[
914 PCE_ENABLE_SOUND_OSS=1
915 test "x$ac_cv_header_fcntl_h" = "xyes" || PCE_ENABLE_SOUND_OSS=0
916 test "x$ac_cv_header_sys_ioctl_h" = "xyes" || PCE_ENABLE_SOUND_OSS=0
917 test "x$ac_cv_header_sys_soundcard_h" = "xyes" || PCE_ENABLE_SOUND_OSS=0
918 if test "x$PCE_ENABLE_SOUND_OSS" = "x1" ; then
919 AC_MSG_RESULT([yes (guess)])
920 else
921 AC_MSG_RESULT([no (guess)])
922 fi
923 ]
924)
925AC_SUBST(PCE_ENABLE_SOUND_OSS)
926if test "x$PCE_ENABLE_SOUND_OSS" = "x1" ; then
927 AC_DEFINE(PCE_ENABLE_SOUND_OSS)
928fi
929
930
931AC_MSG_CHECKING([whether to enable readline])
932AC_ARG_ENABLE(readline,
933 [AS_HELP_STRING([--enable-readline], [Enable readline [guessed]])],
934 [
935 if test "x$enableval" = "xyes" ; then
936 PCE_ENABLE_READLINE=1
937 PCE_READLINE_LIBS="-lreadline -lhistory -lncurses"
938 AC_MSG_RESULT([yes])
939 else
940 PCE_ENABLE_READLINE=0
941 PCE_READLINE_LIBS=""
942 AC_MSG_RESULT([no])
943 fi
944 ],
945 [
946 AC_MSG_RESULT([maybe])
947 AC_CHECK_LIB(ncurses, initscr, ok=1, ok=0)
948 if test "x$ok" = "x1" ; then
949 AC_CHECK_LIB(readline, rl_bind_key, ok=1, ok=0, -lncurses)
950 fi
951 if test "x$ok" = "x1" ; then
952 AC_CHECK_LIB(history, add_history, ok=1, ok=0)
953 fi
954 AC_MSG_CHECKING([whether to enable readline])
955 if test "x$ok" = "x1" ; then
956 PCE_ENABLE_READLINE=1
957 PCE_READLINE_LIBS="-lreadline -lhistory -lncurses"
958 AC_MSG_RESULT([yes (guess)])
959 else
960 PCE_ENABLE_READLINE=0
961 PCE_READLINE_LIBS=""
962 AC_MSG_RESULT([no (guess)])
963 fi
964 ]
965)
966AC_SUBST(PCE_ENABLE_READLINE)
967AC_SUBST(PCE_READLINE_LIBS)
968if test "x$PCE_ENABLE_READLINE" = "x1" ; then
969 AC_DEFINE(PCE_ENABLE_READLINE)
970fi
971
972
973eval "pce_etcdir=$sysconfdir"
974eval "pce_etcdir=$pce_etcdir"
975
976eval "pce_datdir=$datadir"
977eval "pce_datdir=$pce_datdir"
978
979PCE_DIR_ETC=$pce_etcdir
980PCE_DIR_DATA=$pce_datdir
981
982AC_SUBST(PCE_DIR_ETC)
983AC_SUBST(PCE_DIR_DATA)
984AC_DEFINE_UNQUOTED(PCE_DIR_ETC, "$pce_etcdir")
985AC_DEFINE_UNQUOTED(PCE_DIR_DATA, "$pce_datdir")
986
987
988dnl --------------------------------------------------------------------------
989
990emu1=""
991emu2=""
992
993if test "x$PCE_BUILD_ATARIST" = "x1" ; then
994 emu1="$emu1 atarist"
995else
996 emu2="$emu2 atarist"
997fi
998
999if test "x$PCE_BUILD_CPM80" = "x1" ; then
1000 emu1="$emu1 cpm80"
1001else
1002 emu2="$emu2 cpm80"
1003fi
1004
1005if test "x$PCE_BUILD_IBMPC" = "x1" ; then
1006 emu1="$emu1 ibmpc"
1007else
1008 emu2="$emu2 ibmpc"
1009fi
1010
1011if test "x$PCE_BUILD_MACPLUS" = "x1" ; then
1012 emu1="$emu1 macplus"
1013else
1014 emu2="$emu2 macplus"
1015fi
1016
1017if test "x$PCE_BUILD_RC759" = "x1" ; then
1018 emu1="$emu1 rc759"
1019else
1020 emu2="$emu2 rc759"
1021fi
1022
1023if test "x$PCE_BUILD_SIM405" = "x1" ; then
1024 emu1="$emu1 sim405"
1025else
1026 emu2="$emu2 sim405"
1027fi
1028
1029if test "x$PCE_BUILD_SIMARM" = "x1" ; then
1030 emu1="$emu1 simarm"
1031else
1032 emu2="$emu2 simarm"
1033fi
1034
1035if test "x$PCE_BUILD_SIMS32" = "x1" ; then
1036 emu1="$emu1 sims32"
1037else
1038 emu2="$emu2 sims32"
1039fi
1040
1041if test "x$PCE_BUILD_SPECTRUM" = "x1" ; then
1042 emu1="$emu1 spectrum"
1043else
1044 emu2="$emu2 spectrum"
1045fi
1046
1047if test "x$PCE_BUILD_VIC20" = "x1" ; then
1048 emu1="$emu1 vic20"
1049else
1050 emu2="$emu2 vic20"
1051fi
1052
1053
1054romext1=""
1055romext2=""
1056
1057if test "x$PCE_BUILD_IBMPC_ROM" = "x1" ; then
1058 romext1="$romext1 ibmpc"
1059else
1060 romext2="$romext2 ibmpc"
1061fi
1062
1063if test "x$PCE_BUILD_MACPLUS_ROM" = "x1" ; then
1064 romext1="$romext1 macplus"
1065else
1066 romext2="$romext2 macplus"
1067fi
1068
1069
1070term1=" null"
1071term2=""
1072
1073if test "x$PCE_ENABLE_X11" = "x1" ; then
1074 term1="$term1 x11"
1075else
1076 term2="$term2 x11"
1077fi
1078
1079if test "x$PCE_ENABLE_SDL1" = "x1" ; then
1080 term1="$term1 sdl1"
1081else
1082 term2="$term2 sdl1"
1083fi
1084
1085if test "x$PCE_ENABLE_SDL2" = "x1" ; then
1086 term1="$term1 sdl2"
1087else
1088 term2="$term2 sdl2"
1089fi
1090
1091
1092char1=" null stdio"
1093char2=""
1094
1095if test "x$PCE_ENABLE_CHAR_POSIX" = "x1" ; then
1096 char1="$char1 posix"
1097else
1098 char2="$char2 posix"
1099fi
1100
1101if test "x$PCE_ENABLE_CHAR_PPP" = "x1" ; then
1102 char1="$char1 ppp"
1103else
1104 char2="$char2 ppp"
1105fi
1106
1107if test "x$PCE_ENABLE_CHAR_PTY" = "x1" ; then
1108 char1="$char1 pty"
1109else
1110 char2="$char2 pty"
1111fi
1112
1113if test "x$PCE_ENABLE_CHAR_SLIP" = "x1" ; then
1114 char1="$char1 slip"
1115else
1116 char2="$char2 slip"
1117fi
1118
1119if test "x$PCE_ENABLE_CHAR_TCP" = "x1" ; then
1120 char1="$char1 tcp"
1121else
1122 char2="$char2 tcp"
1123fi
1124
1125if test "x$PCE_ENABLE_CHAR_TIOS" = "x1" ; then
1126 char1="$char1 termios"
1127else
1128 char2="$char2 termios"
1129fi
1130
1131if test "x$PCE_ENABLE_CHAR_WINCOM" = "x1" ; then
1132 char1="$char1 wincom"
1133else
1134 char2="$char2 wincom"
1135fi
1136
1137
1138sound1=" null wav"
1139sound2=""
1140
1141if test "x$PCE_ENABLE_SOUND_OSS" = "x1" ; then
1142 sound1="$sound1 oss"
1143else
1144 sound2="$sound2 oss"
1145fi
1146
1147if test "x$PCE_ENABLE_SDL" = "x1" ; then
1148 sound1="$sound1 sdl"
1149else
1150 sound2="$sound2 sdl"
1151fi
1152
1153
1154option1=""
1155option2=""
1156
1157if test "x$PCE_ENABLE_READLINE" = "x1" ; then
1158 option1="$option1 readline"
1159else
1160 option2="$option2 readline"
1161fi
1162
1163if test "x$PCE_ENABLE_TUN" = "x1" ; then
1164 option1="$option1 tun"
1165else
1166 option2="$option2 tun"
1167fi
1168
1169if test "x$PCE_ENABLE_VMNET" = "x1" ; then
1170 option1="$option1 vmnet"
1171else
1172 option2="$option2 vmnet"
1173fi
1174
1175
1176AC_CONFIG_FILES([Makefile Makefile.inc src/config.inc])
1177AC_OUTPUT
1178
1179
1180#-----------------------------------------------------------------------------
1181# info
1182
1183echo ""
1184echo "pce $PCE_VERSION_STR is now configured:"
1185
1186echo " CC: $CC $CFLAGS"
1187echo " LD: $CC $LDFLAGS"
1188echo
1189echo " prefix: $prefix"
1190echo
1191echo " Emulators built: $emu1"
1192echo " Emulators not built: $emu2"
1193echo " ROMs built: $romext1"
1194echo " ROMs not built: $romext2"
1195echo " Terminals built: $term1"
1196echo " Terminals not built: $term2"
1197echo " Char drivers built: $char1"
1198echo " Char drivers not built: $char2"
1199echo " Sound drivers built: $sound1"
1200echo " Sound drivers not built:$sound2"
1201echo " Enabled options: $option1"
1202echo " Disabled options: $option2"