ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.in
(Generate patch)

Comparing BasiliskII/src/Unix/configure.in (file contents):
Revision 1.1 by cebix, 1999-10-03T14:16:25Z vs.
Revision 1.11 by cebix, 1999-10-25T08:07:58Z

# Line 6 | Line 6 | AC_PREREQ(2.12)
6   AC_CONFIG_HEADER(config.h)
7  
8   dnl Options.
9 < WANT_DGA=yes
9 > WANT_XF86_DGA=yes
10 > WANT_FBDEV_DGA=yes
11 > WANT_ESD=yes
12   WANT_UI=yes
13 < AC_ARG_ENABLE(dga, [  --enable-dga            use the DGA extension (default)], [WANT_DGA=$enableval], [])
14 < AC_ARG_ENABLE(ui,  [  --enable-ui             use GTK user interface (default)], [WANT_UI=$enableval], [])
13 > AC_ARG_ENABLE(xf86-dga, [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [])
14 > AC_ARG_ENABLE(fbdev-dga, [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [])
15 > AC_ARG_ENABLE(esd, [  --enable-esd            Enlightened Sound Daemon support [default=yes]], [WANT_ESD=$enableval], [])
16 > AC_ARG_ENABLE(ui,  [  --enable-ui             use GTK user interface [default=yes]], [WANT_UI=$enableval], [])
17  
18   dnl Checks for programs.
19   AC_PROG_CC
16 AC_PROG_CXX
20   AC_PROG_CPP
21 + AC_PROG_CXX
22   AC_PROG_MAKE_SET
23   AC_PROG_INSTALL
24  
25 + dnl We use mon if possible.
26 + MONSRCS=
27 + AC_MSG_CHECKING(for mon)
28 + if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then
29 +  AC_MSG_RESULT(yes)
30 +  DEFINES="$DEFINES -DENABLE_MON=1"
31 +  MONSRCS="../../../mon/src/mon.cpp ../../../mon/src/mon_6502.cpp ../../../mon/src/mon_68k.cpp ../../../mon/src/mon_8080.cpp ../../../mon/src/mon_cmd.cpp ../../../mon/src/mon_ppc.cpp ../../../mon/src/mon_x86.cpp"
32 +  CXXFLAGS="$CXXFLAGS -I../../../mon/src"
33 + else
34 +  AC_MSG_RESULT(no)
35 +  DEFINES="$DEFINES -DENABLE_MON=0"
36 + fi
37 +
38   dnl Checks for libraries.
39 + AC_CHECK_LIB(posix4, sem_init)
40 +
41 + dnl We need X11.
42   AC_PATH_XTRA
43   if [[ "x$no_x" = "xyes" ]]; then
44    AC_MSG_ERROR([You need X11 to run Basilisk II.])
45   fi
26
46   CFLAGS="$CFLAGS $X_CFLAGS"
47   CXXFLAGS="$CXXFLAGS $X_CFLAGS"
48   LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
30 STATICLIBS=
49  
50 < dnl We need pthreads.
51 < AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no)
52 < if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
53 <  dnl Check even the libc_r (FreeBSD)
54 <  AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no)
55 <  if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
56 <     AC_MSG_ERROR([You need libpthreads to run Basilisk II.])
57 <  else
40 <     LIBS="$LIBS -lc_r"
41 <  fi
42 < else
43 <  LIBS="$LIBS -lpthread"
44 < fi
45 < AC_CHECK_FUNCS(pthread_cancel)
50 > dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
51 > AC_CHECK_LIB(pthread, pthread_create, , [
52 >  AC_CHECK_LIB(c_r, pthread_create, , [
53 >    AC_CHECK_LIB(PTL, pthread_create, , [
54 >      AC_MSG_ERROR([You need pthreads to run Basilisk II.])
55 >    ])
56 >  ])
57 > ])
58  
59 < dnl We use DGA if possible.
60 < if [[ "x$WANT_DGA" = "xyes" ]]; then
61 <  AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no)
62 <  if [[ "x$HAVE_DGA" = "xno" ]]; then
63 <    AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga.])
64 <  else
65 <    DEFINES="$DEFINES -DENABLE_DGA=1"
59 > dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
60 > SEMSRCS=
61 > AC_CHECK_FUNCS(sem_init, , [
62 >  SEMSRCS=posix_sem.cpp
63 > ])
64 >
65 > dnl We use DGA (XFree86 or fbdev) if possible.
66 > if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
67 >  AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
68 >    DEFINES="$DEFINES -DENABLE_XF86_DGA=1"
69      LIBS="$LIBS -lXxf86dga"
70 <  fi
70 >    if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
71 >      AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.])
72 >      WANT_FBDEV_DGA=no
73 >    fi
74 >  ], [
75 >    AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.])
76 >    DEFINES="$DEFINES -DENABLE_XF86_DGA=0"
77 >  ])
78 > else
79 >  DEFINES="$DEFINES -DENABLE_XF86_DGA=0"
80 > fi
81 > if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
82 >  DEFINES="$DEFINES -DENABLE_FBDEV_DGA=1"
83 > else
84 >  DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0"
85   fi
86  
87   dnl We use GTK+ if possible.
88 + UISRCS=../dummy/prefs_editor_dummy.cpp
89   if [[ "x$WANT_UI" = "xyes" ]]; then
90 <  AM_PATH_GTK(1.2.0)
61 <  if [[ "x$no_gtk" = "xyes" ]]; then
62 <    echo "Did not find gtk+, disabling user interface."
63 <    WANT_UI=no
64 <    GTK_CFLAGS=
65 <    GTK_LIBS=
66 <  else
90 >  AM_PATH_GTK(1.2.0, [
91      DEFINES="$DEFINES -DENABLE_GTK=1"
92 <  fi
93 <  CFLAGS="$CFLAGS $GTK_CFLAGS"
94 <  CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
95 <  LIBS="$LIBS $GTK_LIBS"
92 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
93 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
94 >    LIBS="$LIBS $GTK_LIBS"
95 >    UISRCS=prefs_editor_gtk.cpp
96 >  ], [
97 >    AC_MSG_WARN([Could not find GTK+, disabling user interface.])
98 >    WANT_UI=no
99 >  ])
100   fi
101  
102 < dnl We need POSIX.4 semaphores (and other POSIX.4 blessings).
103 < SEMSRCS=
104 < AC_CHECK_FUNCS(sem_init)
105 < if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then
106 <  AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no)
107 <  if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then
108 <    dnl Checks for the existance of semget
109 <    AC_CHECK_FUNCS(semget)
110 <    if [[ "x$ac_cv_func_semget" = "xno" ]]; then
111 <      AC_MSG_ERROR([You need POSIX.4 semaphores to run Basilisk II.])
112 <    else
85 <      SEMSRCS="posix_sem.cpp"
86 <    fi
87 <  else
88 <    LIBS="$LIBS -lposix4"
89 <  fi
102 > dnl We use ESD if possible.
103 > if [[ "x$WANT_ESD" = "xyes" ]]; then
104 >  AM_PATH_ESD(0.2.8, [
105 >    DEFINES="$DEFINES -DENABLE_ESD=1"
106 >    CFLAGS="$CFLAGS $ESD_CFLAGS"
107 >    CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
108 >    LIBS="$LIBS $ESD_LIBS"
109 >  ], [
110 >    AC_MSG_WARN([Could not find ESD, disabling ESD support.])
111 >    WANT_ESD=no
112 >  ])
113   fi
114  
115   dnl Checks for header files.
# Line 110 | Line 133 | AC_STRUCT_TM
133   dnl Checks for library functions.
134   AC_CHECK_FUNCS(strdup cfmakeraw)
135   AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
136 + AC_CHECK_FUNCS(pthread_cancel)
137  
138   dnl Select system-dependant source files.
139   SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp"
140   if MACHINE=`uname -a 2>/dev/null`; then
141    case "$MACHINE" in
142    Linux*)
143 <    SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp"
143 >    SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp"
144      ;;
145    FreeBSD*3.*)
146      dnl Check for the CAM library
# Line 131 | Line 155 | if MACHINE=`uname -a 2>/dev/null`; then
155          dnl to access directly to the functions in the kernel :) --Orlando
156          AC_MSG_ERROR([Cannot find kernel includes for CAM library.])
157        fi
158 <      SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp"
158 >      SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp"
159        CXXFLAGS="$CXXFLAGS -I/sys"
160        CFLAGS="$CFLAGS -I/sys"
161        LIBS="$LIBS -lcam"
# Line 164 | Line 188 | if MACHINE=`uname -a 2>/dev/null`; then
188      LIBS="$LIBS -lm"
189      ;;
190    esac
167  if [[ "x$WANT_UI" = "xyes" ]]; then
168    SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp"
169  else
170    SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp"
171  fi
191   fi
192 < if [[ "x$SEMSRCS" != "x" ]]; then
174 <  SYSSRCS="$SYSSRCS $SEMSRCS"
175 < fi
176 <
177 < dnl Defaults for UAE CPU.
178 < CPUINCLUDES="-I../uae_cpu"
179 < CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp ../uae_cpu/fpp.cpp cpustbl.cpp cpudefs.cpp"
192 > SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
193  
194 < dnl Check for i386.
194 > dnl Check for i386 CPU.
195   HAVE_I386=no
196   AC_MSG_CHECKING(for x86 target CPU)
197   AC_EGREP_CPP(yes,
# Line 188 | Line 201 | AC_EGREP_CPP(yes,
201   #endif
202   ], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no))
203  
204 < dnl Check for GAS
204 > dnl Check for SPARC CPU.
205 > HAVE_SPARC=no
206 > AC_MSG_CHECKING(for SPARC target CPU)
207 > AC_EGREP_CPP(yes,
208 > [
209 > #ifdef __sparc__
210 >  yes
211 > #endif
212 > ], [AC_MSG_RESULT(yes); HAVE_SPARC=yes], AC_MSG_RESULT(no))
213 >
214 > dnl Check for GAS.
215   HAVE_GAS=no
216   AC_MSG_CHECKING(for GAS .p2align feature)
217   cat >conftest.S << EOF
# Line 198 | Line 221 | EOF
221   if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
222   AC_MSG_RESULT($HAVE_GAS)
223  
224 < dnl Check for GCC 2.7 or higher
224 > dnl Check for GCC 2.7 or higher.
225   HAVE_GCC27=no
226   AC_MSG_CHECKING(for GCC 2.7 or higher)
227   AC_EGREP_CPP(yes,
# Line 207 | Line 230 | AC_EGREP_CPP(yes,
230   #endif
231   ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
232  
233 < dnl Set "-fomit-frame-pointer" on GCC
233 > dnl Set "-fomit-frame-pointer" on GCC 2.7 or higher.
234   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
235    CFLAGS="$CFLAGS -fomit-frame-pointer"
236    CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
237   fi
238  
239 < dnl Select appropriate CPU source and REGPARAM define
239 > dnl Select appropriate CPU source and REGPARAM define.
240 > CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
241   if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
242 +  dnl i386 CPU
243    DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
244    if [[ "x$HAVE_GAS" = "xyes" ]]; then
245      DEFINES="$DEFINES -DX86_ASSEMBLY"
246 <    CPUSRCS="$CPUSRCS cpufast.s"
222 <  else
223 <    CPUSRCS="$CPUSRCS cpuemu.cpp"
246 >    CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
247    fi
248 < else
249 <  CPUSRCS="$CPUSRCS cpuemu.cpp"
248 > elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
249 >  dnl SPARC CPU
250 >  case "$MACHINE" in
251 >  SunOS*)
252 >    AC_MSG_CHECKING(SPARC CPU architecture)
253 >    SPARC_TYPE=`Solaris/which_sparc`
254 >    AC_MSG_RESULT($SPARC_TYPE)
255 >    case "$SPARC_TYPE" in
256 >    SPARC_V8)
257 >      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY"
258 >      CFLAGS="$CFLAGS -Wa,-Av8"
259 >      CXXFLAGS="$CXXFLAGS -Wa,-Av8"
260 >      ;;
261 >    SPARC_V9)
262 >      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY"
263 >      CFLAGS="$CFLAGS -Wa,-Av9"
264 >      CXXFLAGS="$CXXFLAGS -Wa,-Av9"
265 >      ;;
266 >    esac
267 >    ;;
268 >  esac
269   fi
270  
271 < dnl Generate Makefile
271 > dnl UAE CPU sources for all architectures.
272 > CPUINCLUDES="-I../uae_cpu"
273 > CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp ../uae_cpu/fpp.cpp cpustbl.cpp cpudefs.cpp $CPUSRCS"
274 >
275 > dnl Generate Makefile.
276   AC_SUBST(DEFINES)
231 AC_SUBST(STATICLIBS)
277   AC_SUBST(SYSSRCS)
278   AC_SUBST(CPUINCLUDES)
279   AC_SUBST(CPUSRCS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines