ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/configure.ac
Revision: 1.13
Committed: 2010-04-23T11:12:05Z (12 years, 7 months ago) by cebix
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +21 -1 lines
Log Message:
added resizable display using OpenGL

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([Frodo], [4.2])
4 AC_CONFIG_SRCDIR(main.cpp)
5 AC_PREREQ(2.52)
6 AC_CONFIG_HEADER(sysconfig.h)
7
8 dnl Checks for programs.
9 AC_PROG_CC
10 AC_PROG_CXX
11 AC_PROG_CPP
12 AC_PROG_MAKE_SET
13 AC_PROG_INSTALL
14 PKG_PROG_PKG_CONFIG
15
16 dnl Configure options.
17 AC_ARG_ENABLE(opengl, [ --enable-opengl use SDL/OpenGL for rendering [default=yes]], , enable_opengl=yes)
18
19 dnl -fomit-frame-pointer makes things faster
20 if [[ x"$GXX" = "xyes" ]]; then
21 CFLAGS="$CFLAGS -fomit-frame-pointer -fno-exceptions"
22 fi
23
24 AC_AIX
25 AC_ISC_POSIX
26
27 dnl Checks for libraries.
28 AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=yes, HAVE_SVGA_LIB=no)
29 AM_PATH_SDL(1.2.0, HAVE_SDL=yes, HAVE_SDL=no)
30
31 EMBEDDED_EXTENSION=none
32 AC_MSG_CHECKING([if Frodo should be compiled with extensions for an embedded device])
33 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.])])
34 if [[ x"$with_embedded_extension" == "xqtopia" ]]; then
35 EMBEDDED_EXTENSION=$with_embedded_extension
36 AC_DEFINE(QTOPIA, 1, [Extension for Qtopia is enabled])
37 elif [[ x"$with_embedded_extension" == "xmaemo" ]]; then
38 EMBEDDED_EXTENSION=$with_embedded_extension
39 AC_DEFINE(MAEMO, 1, [Extension for Maemo is enabled])
40 fi
41 AC_MSG_RESULT([$EMBEDDED_EXTENSION])
42
43 if [[ x"$EMBEDDED_EXTENSION" == "xmaemo" ]]; then
44 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.])])
45 fi
46
47 if [[ x"$EMBEDDED_EXTENSION" == "xnone" ]]; then
48 HAVE_GLADE=no
49 PKG_CHECK_MODULES(GLADE, [libglade-2.0 libgnomeui-2.0 >= 1.110.0], HAVE_GLADE=yes)
50 if [[ $HAVE_GLADE = yes ]]; then
51 AC_DEFINE(HAVE_GLADE, 1, [Glade support is enabled])
52 LDFLAGS="$LDFLAGS -Wl,-E"
53 fi
54 else
55 GUIOBJS="sdlgui.o file.o dlgFileSelect.o dlgMain.o dlgDrives.o dlgOptions.o dlgVideoSound.o dlgAdvanced.o dlgInput.o"
56 GUISRCS="sdlgui.cpp file.cpp dlgFileSelect.cpp dlgMain.cpp dlgDrives.cpp dlgOptions.cpp dlgVidoSound.cpp dlgAdvanced.cpp dlgInput.cpp"
57 fi
58
59 AC_PATH_XTRA
60
61 AC_HEADER_DIRENT
62 AC_HEADER_STDC
63 AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h ncurses.h)
64 AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/select.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h)
65
66 dnl Checks for types.
67 AC_CHECK_SIZEOF(char)
68 AC_CHECK_SIZEOF(short)
69 AC_CHECK_SIZEOF(int)
70 AC_CHECK_SIZEOF(long)
71 AC_CHECK_SIZEOF(long long)
72 AC_CHECK_SIZEOF(void *)
73
74 dnl Checks for typedefs, structures, and compiler characteristics.
75 AC_TYPE_MODE_T
76 AC_TYPE_OFF_T
77 AC_TYPE_PID_T
78 AC_STRUCT_ST_BLOCKS
79 AC_HEADER_TIME
80 AC_STRUCT_TM
81
82 dnl Checks for library functions.
83 AC_PROG_GCC_TRADITIONAL
84 AC_FUNC_MEMCMP
85 AC_TYPE_SIGNAL
86 AC_FUNC_UTIME_NULL
87 AC_CHECK_FUNCS(gettimeofday sigaction mkdir rmdir select strerror strstr statfs usleep)
88
89 KBD_LANG=0
90 AC_ARG_ENABLE(kbd-lang-de,[ --enable-kbd-lang-de Use german keyboard layout],[KBD_LANG=1],[])
91 AC_ARG_ENABLE(kbd-lang-us,[ --enable-kbd-lang-us Use american keyboard layout],[KBD_LANG=0],[])
92
93 AC_MSG_CHECKING(which target to use)
94 if [[ x"$no_x" = "xyes" ]]; then
95 if [[ x"$HAVE_SVGA_LIB" = "xyes" ]]; then
96 AC_MSG_RESULT([SVGAlib])
97 TARGET=svgalib
98 CFLAGS="$CFLAGS -D__svgalib__"
99 LIBS="$LIBS -lvga"
100 else
101 AC_MSG_RESULT([Ummm...])
102 AC_MSG_ERROR([Neither X nor SVGAlib found, don't know what target to use.])
103 fi
104 elif [[ x"$HAVE_SDL" = "xyes" ]]; then
105 AC_MSG_RESULT([SDL])
106 TARGET=sdl
107 CFLAGS="$CFLAGS $SDL_CFLAGS -DHAVE_SDL"
108 LIBS="$LIBS $SDL_LIBS"
109 if [[ "x$enable_opengl" = "xyes" ]]; then
110 AC_MSG_CHECKING(for OpenGL support)
111 have_opengl=no
112 AC_TRY_COMPILE([
113 #include <GL/glew.h>
114 ],[
115 ],[
116 have_opengl=yes
117 ])
118 AC_MSG_RESULT($have_opengl)
119 if test x$have_opengl = xyes; then
120 AC_DEFINE(ENABLE_OPENGL, 1, [OpenGL support is enabled])
121 LIBS="$LIBS -lGLEW"
122 else
123 AC_MSG_WARN([Could not find OpenGL, ignoring --enable-opengl.])
124 fi
125 fi
126 else
127 AC_MSG_RESULT([X Window System])
128 TARGET=x11
129 CFLAGS="$CFLAGS $X_CFLAGS -I$ac_cv_x_include"
130 LIBS="$LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
131 fi
132
133 AC_SUBST(TARGET)
134 AC_SUBST(SET_MAKE)
135 AC_SUBST(top_srcdir)
136 AC_SUBST(HPUX_REV)
137 AC_SUBST(KBD_LANG)
138 AC_SUBST(GUIOBJS)
139 AC_SUBST(GUISRCS)
140
141 dnl Generate Makefile.
142 AC_CONFIG_FILES([Makefile])
143 AC_OUTPUT
144
145 dnl Print summary.
146 echo
147 echo "Configuration done. Now type \"make\"."