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.12 by cebix, 1999-10-25T19:01:43Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines