ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/configure.in
Revision: 1.2
Committed: 2002-04-21T11:21:26Z (22 years, 7 months ago) by gbeauche
Branch: MAIN
Changes since 1.1: +6 -1 lines
Log Message:
- Invert AC_CHECK_LIB for readline and termcap  so that the test program
  for readline detection is actually linked against -ltermcap -lreadline.
  Also add other term libs and finally prefer ncurses over the rest.

File Contents

# User Rev Content
1 cebix 1.1 dnl Process this file with autoconf to produce a configure script.
2     dnl Written in 2002 by Christian Bauer
3    
4     AC_INIT(main_unix.cpp)
5     AC_PREREQ(2.12)
6     AC_CONFIG_HEADER(config.h)
7    
8     dnl Options.
9     AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
10     AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
11     AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
12     AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
13     AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
14    
15     dnl Checks for programs.
16     AC_PROG_CC
17     AC_PROG_CPP
18     AC_PROG_CXX
19     AC_PROG_MAKE_SET
20     AC_PROG_INSTALL
21    
22     dnl Check for PowerPC target CPU.
23     HAVE_PPC=no
24     AC_MSG_CHECKING(for PowerPC target CPU)
25     AC_EGREP_CPP(yes,
26     [
27     #ifdef __powerpc__
28     yes
29     #endif
30     ], [AC_MSG_RESULT(yes); HAVE_PPC=yes], AC_MSG_RESULT(no))
31    
32     dnl We use mon if possible.
33     MONSRCS=
34     if [[ "x$WANT_MON" = "xyes" ]]; then
35     AC_MSG_CHECKING(for mon)
36     mon_srcdir=../../../mon/src
37     if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
38     AC_MSG_RESULT(yes)
39     AC_DEFINE(ENABLE_MON)
40     MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
41     CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
42 gbeauche 1.2 AC_CHECK_LIB(ncurses, tgetent, ,
43     AC_CHECK_LIB(termcap, tgetent, ,
44     AC_CHECK_LIB(termlib, tgetent, ,
45     AC_CHECK_LIB(terminfo, tgetent, ,
46     AC_CHECK_LIB(Hcurses, tgetent, ,
47     AC_CHECK_LIB(curses, tgetent))))))
48 cebix 1.1 AC_CHECK_LIB(readline, readline)
49     AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
50     else
51     AC_MSG_RESULT(no)
52     AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
53     WANT_MON=no
54     fi
55     fi
56    
57     dnl Checks for libraries.
58     AC_CHECK_LIB(posix4, sem_init)
59    
60     dnl We need X11.
61     AC_PATH_XTRA
62     if [[ "x$no_x" = "xyes" ]]; then
63     AC_MSG_ERROR([You need X11 to run SheepShaver.])
64     fi
65     CFLAGS="$CFLAGS $X_CFLAGS"
66     CXXFLAGS="$CXXFLAGS $X_CFLAGS"
67     LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
68    
69     dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
70     HAVE_PTHREADS=yes
71     if [[ "x$HAVE_PPC" = "xno" ]]; then
72     AC_CHECK_LIB(pthread, pthread_create, , [
73     AC_CHECK_LIB(c_r, pthread_create, , [
74     AC_CHECK_LIB(PTL, pthread_create, , [
75     AC_MSG_ERROR([You need pthreads to run Basilisk II.])
76     ])
77     ])
78     ])
79     AC_CHECK_FUNCS(pthread_cancel)
80     fi
81    
82     dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
83     SEMSRC=
84     AC_CHECK_FUNCS(sem_init, , [
85     if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
86     SEMSRC=posix_sem.cpp
87     fi
88     ])
89    
90     dnl We use XFree86 DGA if possible.
91     if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
92     AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
93     AC_DEFINE(ENABLE_XF86_DGA)
94     LIBS="$LIBS -lXxf86dga"
95     ], [
96     AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.])
97     WANT_XF86_DGA=no
98     ])
99     fi
100    
101     dnl We use XFree86 VidMode if possible.
102     if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then
103     AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [
104     AC_DEFINE(ENABLE_XF86_VIDMODE)
105     LIBS="$LIBS -lXxf86vm"
106     ], [
107     AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.])
108     WANT_XF86_VIDMODE=no
109     ])
110     fi
111    
112     dnl We use GTK+ if possible.
113     UISRCS=
114     if [[ "x$WANT_GTK" = "xyes" ]]; then
115     AM_PATH_GTK(1.2.0, [
116     AC_DEFINE(ENABLE_GTK)
117     CFLAGS="$CFLAGS $GTK_CFLAGS"
118     CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
119     LIBS="$LIBS $GTK_LIBS"
120     UISRCS=prefs_editor_gtk.cpp
121     ], [
122     AC_MSG_WARN([Could not find GTK+, disabling user interface.])
123     WANT_GTK=no
124     ])
125     fi
126    
127     dnl We use ESD if possible.
128     if [[ "x$WANT_ESD" = "xyes" ]]; then
129     AM_PATH_ESD(0.2.8, [
130     AC_DEFINE(ENABLE_ESD)
131     CFLAGS="$CFLAGS $ESD_CFLAGS"
132     CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
133     LIBS="$LIBS $ESD_LIBS"
134     ], [
135     AC_MSG_WARN([Could not find ESD, disabling ESD support.])
136     WANT_ESD=no
137     ])
138     fi
139    
140     dnl Checks for header files.
141     AC_HEADER_STDC
142     AC_HEADER_SYS_WAIT
143     AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h)
144    
145     dnl Checks for typedefs, structures, and compiler characteristics.
146     AC_C_BIGENDIAN
147     AC_C_CONST
148     AC_C_INLINE
149     AC_CHECK_SIZEOF(short, 2)
150     AC_CHECK_SIZEOF(int, 4)
151     AC_CHECK_SIZEOF(long, 4)
152     AC_CHECK_SIZEOF(long long, 8)
153     AC_TYPE_OFF_T
154     AC_CHECK_TYPE(loff_t, off_t)
155     AC_TYPE_SIZE_T
156     AC_HEADER_TIME
157     AC_STRUCT_TM
158    
159     dnl Checks for library functions.
160     AC_CHECK_FUNCS(strdup cfmakeraw)
161     AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
162    
163     dnl Select system-dependant sources.
164     if [[ "x$HAVE_PPC" = "xyes" ]]; then
165     SYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
166     else
167     SYSSRCS="../emul_ppc/emul_ppc.cpp"
168     fi
169     SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
170    
171     dnl Generate Makefile.
172     AC_SUBST(SYSSRCS)
173     AC_OUTPUT(Makefile)
174    
175     dnl Print summary.
176     echo
177     echo SheepShaver configuration summary:
178     echo
179     echo XFree86 DGA support .............. : $WANT_XF86_DGA
180     echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
181     echo ESD sound support ................ : $WANT_ESD
182     echo GTK user interface ............... : $WANT_GTK
183     echo mon debugger support ............. : $WANT_MON
184     echo
185     echo "Configuration done. Now type \"make\"."