12 |
|
AC_PROG_MAKE_SET |
13 |
|
AC_PROG_INSTALL |
14 |
|
|
15 |
< |
dnl Don't want the default "-O2 -g" that autoconf uses for gcc. |
15 |
> |
dnl -fomit-frame-pointer makes things faster |
16 |
|
if [[ x"$GXX" = "xyes" ]]; then |
17 |
< |
CFLAGS="-O2 -g -fomit-frame-pointer -Wall -Wno-unused -Wno-format" |
18 |
< |
fi |
19 |
< |
|
20 |
< |
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
21 |
< |
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
22 |
< |
|
23 |
< |
HPUX_REV=0 |
24 |
< |
if [[ x$UNAME_SYSTEM = "xHP-UX" ]]; then |
25 |
< |
HPUX_REV=`echo $UNAME_RELEASE | sed -e 's/[^.]*.[0B]*//' -e 's/\..*$//'` |
17 |
> |
CFLAGS="$CFLAGS -fomit-frame-pointer -fno-exceptions" |
18 |
|
fi |
19 |
|
|
20 |
|
AC_AIX |
21 |
|
AC_ISC_POSIX |
22 |
|
|
23 |
|
dnl Checks for libraries. |
32 |
– |
HAVE_BEBOX=no |
33 |
– |
AC_CHECK_LIB(amiga, OpenLibrary, HAVE_AMIGA_LIB=yes, HAVE_AMIGA_LIB=no) |
24 |
|
AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=yes, HAVE_SVGA_LIB=no) |
25 |
|
AM_PATH_SDL(1.2.0, HAVE_SDL=yes, HAVE_SDL=no) |
26 |
|
|
27 |
+ |
EMBEDDED_EXTENSION=none |
28 |
+ |
AC_MSG_CHECKING([if Frodo should be compiled with extensions for an embedded device]) |
29 |
+ |
AC_ARG_WITH([embedded-extension], [AS_HELP_STRING([--with-embedded-extension=qtopia|maemo],[Specify which extension for Frodo on an embedded device should be used.])]) |
30 |
+ |
if [[ x"$with_embedded_extension" == "xqtopia" ]]; then |
31 |
+ |
EMBEDDED_EXTENSION=$with_embedded_extension |
32 |
+ |
AC_DEFINE(QTOPIA, 1, [Extension for Qtopia is enabled]) |
33 |
+ |
elif [[ x"$with_embedded_extension" == "xmaemo" ]]; then |
34 |
+ |
EMBEDDED_EXTENSION=$with_embedded_extension |
35 |
+ |
AC_DEFINE(MAEMO, 1, [Extension for Maemo is enabled]) |
36 |
+ |
fi |
37 |
+ |
AC_MSG_RESULT([$EMBEDDED_EXTENSION]) |
38 |
+ |
|
39 |
+ |
if [[ x"$EMBEDDED_EXTENSION" == "xmaemo" ]]; then |
40 |
+ |
PKG_CHECK_MODULES(OSSO, [libosso >= 0.9.19], AC_DEFINE(HAVE_LIBOSSO, [], [Weather libosso is present on the system]), [AC_MSG_NOTICE([libosso not present.])]) |
41 |
+ |
fi |
42 |
+ |
|
43 |
+ |
if [[ x"$EMBEDDED_EXTENSION" == "xnone" ]]; then |
44 |
+ |
HAVE_GLADE=no |
45 |
+ |
PKG_CHECK_MODULES(GLADE, libglade-2.0 libgnomeui-2.0 >= 1.110.0, HAVE_GLADE=yes) |
46 |
+ |
if [[ $HAVE_GLADE = yes ]]; then |
47 |
+ |
AC_DEFINE(HAVE_GLADE, 1, [Glade support is enabled]) |
48 |
+ |
fi |
49 |
+ |
else |
50 |
+ |
GUIOBJS="sdlgui.o file.o dlgFileSelect.o dlgMain.o dlgDrives.o dlgOptions.o dlgVideoSound.o dlgAdvanced.o dlgInput.o" |
51 |
+ |
GUISRCS="sdlgui.cpp file.cpp dlgFileSelect.cpp dlgMain.cpp dlgDrives.cpp dlgOptions.cpp dlgVidoSound.cpp dlgAdvanced.cpp dlgInput.cpp" |
52 |
+ |
fi |
53 |
+ |
|
54 |
|
AC_PATH_XTRA |
55 |
|
|
56 |
|
AC_HEADER_DIRENT |
57 |
|
AC_HEADER_STDC |
58 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h ncurses.h) |
59 |
< |
AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/select.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h linux/joystick.h) |
59 |
> |
AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/select.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h) |
60 |
|
|
61 |
+ |
dnl Checks for types. |
62 |
|
AC_CHECK_SIZEOF(char) |
63 |
|
AC_CHECK_SIZEOF(short) |
64 |
|
AC_CHECK_SIZEOF(int) |
65 |
|
AC_CHECK_SIZEOF(long) |
66 |
|
AC_CHECK_SIZEOF(long long) |
67 |
+ |
AC_CHECK_SIZEOF(void *) |
68 |
|
|
69 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
70 |
|
AC_TYPE_MODE_T |
86 |
|
AC_ARG_ENABLE(kbd-lang-us,[ --enable-kbd-lang-us Use american keyboard layout],[KBD_LANG=0],[]) |
87 |
|
|
88 |
|
AC_MSG_CHECKING(which target to use) |
89 |
< |
if [[ x"$HAVE_BEBOX" = "xyes" ]]; then |
71 |
< |
AC_MSG_RESULT([BeBox]) |
72 |
< |
TARGET=be |
73 |
< |
elif [[ x"$HAVE_AMIGA_LIB" = "xyes" ]]; then |
74 |
< |
AC_MSG_RESULT([AmigaOS]) |
75 |
< |
TARGET=amigaos |
76 |
< |
elif [[ x"$no_x" = "xyes" ]]; then |
89 |
> |
if [[ x"$no_x" = "xyes" ]]; then |
90 |
|
if [[ x"$HAVE_SVGA_LIB" = "xyes" ]]; then |
91 |
|
AC_MSG_RESULT([SVGAlib]) |
92 |
|
TARGET=svgalib |
108 |
|
LIBS="$LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" |
109 |
|
fi |
110 |
|
|
98 |
– |
dnl Find out some things about the system |
99 |
– |
dnl - whether we have GCC 2.7 or better. |
100 |
– |
dnl - what CPU we have (to use some assembly hacks on the x86) |
101 |
– |
|
102 |
– |
HAVEGCC27=n |
103 |
– |
HAVEI386=n |
104 |
– |
|
105 |
– |
cat >conftest.cpp << EOF |
106 |
– |
#include <stdio.h> |
107 |
– |
int main() |
108 |
– |
{ |
109 |
– |
#if defined(__GNUC__) && defined(__GNUC_MINOR__) |
110 |
– |
#if __GNUC__ > 2 || __GNUC_MINOR__ > 6 |
111 |
– |
printf("GNU\n"); |
112 |
– |
#endif |
113 |
– |
#endif |
114 |
– |
return 0; |
115 |
– |
} |
116 |
– |
EOF |
117 |
– |
|
118 |
– |
$CXX conftest.cpp -c -o conftest.o |
119 |
– |
$CXX conftest.o -o conftest |
120 |
– |
./conftest >conftest.file |
121 |
– |
if grep GNU conftest.file >/dev/null; then |
122 |
– |
HAVEGCC27=y |
123 |
– |
echo "Good news. Found GCC 2.7 or better." |
124 |
– |
elif [[ "$CC" = "gcc" ]]; then |
125 |
– |
echo "I suggest you upgrade to at least version 2.7 of GCC" |
126 |
– |
else |
127 |
– |
echo "Couldn't find GCC. Frodo may or may not compile and run correctly." |
128 |
– |
fi |
129 |
– |
|
130 |
– |
cat >conftest.c << EOF |
131 |
– |
#include <stdio.h> |
132 |
– |
int main() |
133 |
– |
{ |
134 |
– |
#ifdef __i386__ |
135 |
– |
printf("386\n"); |
136 |
– |
#endif |
137 |
– |
return 0; |
138 |
– |
} |
139 |
– |
EOF |
140 |
– |
|
141 |
– |
$CC conftest.c -c -o conftest.o |
142 |
– |
$CC conftest.o -o conftest |
143 |
– |
./conftest >conftest.file |
144 |
– |
if grep 386 conftest.file >/dev/null; then |
145 |
– |
HAVEI386=y |
146 |
– |
echo "You seem to be using a x86 CPU" |
147 |
– |
else |
148 |
– |
echo "No special hacks for your CPU, sorry." |
149 |
– |
fi |
150 |
– |
|
151 |
– |
rm -f conftest* |
152 |
– |
|
153 |
– |
if [[ "$HAVEGCC27" = "y" -a "$HAVEI386" = "y" ]]; then |
154 |
– |
# Don't want strength-reduce on the i386, makes the code slower usually. |
155 |
– |
CFLAGS="$CFLAGS -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\"" |
156 |
– |
elif [[ "$TARGET" = "amigaos" ]]; then |
157 |
– |
CFLAGS="$CFLAGS -DREGPARAM=\"__attribute__((regargs(4)))\" " |
158 |
– |
else |
159 |
– |
CFLAGS="$CFLAGS -DREGPARAM=" |
160 |
– |
fi |
161 |
– |
|
162 |
– |
CC=$CXX |
163 |
– |
|
111 |
|
AC_SUBST(TARGET) |
112 |
|
AC_SUBST(SET_MAKE) |
113 |
|
AC_SUBST(top_srcdir) |
114 |
|
AC_SUBST(HPUX_REV) |
115 |
|
AC_SUBST(KBD_LANG) |
116 |
+ |
AC_SUBST(GUIOBJS) |
117 |
+ |
AC_SUBST(GUISRCS) |
118 |
|
|
119 |
|
dnl Generate Makefile. |
120 |
|
AC_CONFIG_FILES([Makefile]) |