1 dnl Process this file with autoconf to produce a configure script.
11 AM_INIT_AUTOMAKE(VisualBoyAdvance, 1.8.0)
14 AC_HELP_STRING([--enable-c-core],[enable C core (default is no on x86 targets)]),
15 , enable_c_core=$VBA_USE_C_CORE)
17 AC_ARG_ENABLE(profiling,
18 AC_HELP_STRING([--enable-profiling],[enable profiling (default is yes)]),
19 , enable_profiling=no)
22 AC_HELP_STRING([--with-mmx],[use MMX (default is yes on x86 targets)]),
23 , with_mmx=$VBA_USE_MMX)
26 AC_HELP_STRING([--enable-sdl],[build the SDL interface (default is yes)]),
30 [ --enable-gtk=[[VERSION]] build the GTK+ interface (default is no)],[
31 if test "x$enable_gtk" != xno; then
33 if test "x$enableval" = xyes; then
36 gtk_version=$enableval
44 AC_HELP_STRING([--enable-dev],[enable development features (default is yes)]),
47 dnl Checks for programs.
53 AC_PATH_PROG(NASM, nasm)
55 dnl Checks for libraries.
56 AC_CHECK_LIB(z, gzopen,
57 , AC_MSG_ERROR([*** Cannot compile without zlib.]))
58 AC_CHECK_LIB(pthread, pthread_yield)
60 PKG_CHECK_MODULES(LIBPNG, libpng)
61 CPPFLAGS="$CPPFLAGS $LIBPNG_CFLAGS"
62 LIBS="$LIBS $LIBPNG_LIBS"
64 dnl Checks for header files.
67 AC_CHECK_HEADERS(malloc.h strings.h unistd.h arpa/inet.h netinet/in.h zutil.h)
69 dnl Checks for typedefs, structures, and compiler characteristics.
74 AC_MSG_CHECKING(for socklen_t)
76 #include <sys/socket.h>
83 #include <sys/socket.h>
84 int accept (int, struct sockaddr *, size_t *);
88 AC_DEFINE(socklen_t,size_t)
91 AC_DEFINE(socklen_t,int)
97 VBA_LIBS="../gb/libgb.a"
99 CXXFLAGS="$CXXFLAGS -DBKPT_SUPPORT"
100 CFLAGS="$CFLAGS -DBKPT_SUPPORT -std=gnu99"
102 if test "x$enable_c_core" = xyes; then
103 CXXFLAGS="$CXXFLAGS -DC_CORE"
104 CFLAGS="$CFLAGS -DC_CORE"
107 if test "x$enable_profiling" = xyes; then
108 CXXFLAGS="$CXXFLAGS -DPROFILING"
109 VBA_SRC_EXTRA="$VBA_SRC_EXTRA prof"
110 VBA_LIBS="$VBA_LIBS ../prof/libprof.a"
113 if test "x$with_mmx" = xyes; then
114 if test "x$NASM" = x; then
115 AC_MSG_ERROR([*** Couldn't find nasm program.])
117 CXXFLAGS="$CXXFLAGS -DMMX"
118 VBA_SRC_EXTRA="$VBA_SRC_EXTRA i386"
119 VBA_LIBS="$VBA_LIBS ../i386/lib386.a"
122 if test "x$enable_sdl" = xyes || test "x$enable_gtk" = xyes; then
124 AM_PATH_SDL($SDL_VERSION,[
126 AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).])
130 if test "x$enable_sdl" = xyes; then
131 VBA_SRC_EXTRA="$VBA_SRC_EXTRA sdl"
134 if test "x$enable_gtk" = xyes; then
135 dnl Internationalisation support.
137 AM_GNU_GETTEXT(external)
138 AC_CHECK_HEADERS(libintl.h)
139 GETTEXT_PACKAGE=vba-1.8.0
140 AC_SUBST(GETTEXT_PACKAGE)
142 PKG_CHECK_MODULES(GTKMM, gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0)
143 AC_SUBST(GTKMM_CFLAGS)
145 if test "x$gtk_version" = x2.0; then
146 GTKMM_CPPFLAGS="-DGTKMM20"
148 AC_SUBST(GTKMM_CPPFLAGS)
149 VBA_EXTRA="$VBA_EXTRA po"
150 VBA_SRC_EXTRA="$VBA_SRC_EXTRA gtk"
153 if test "x$enable_dev" = xyes; then
154 CXXFLAGS="$CXXFLAGS -DDEV_VERSION"
157 if test "x$enable_sdl" != xyes && test "x$enable_gtk" != xyes; then
158 AC_MSG_WARN([*** You have chosen not to build any frontend.])
162 AC_SUBST(VBA_SRC_EXTRA)
173 src/gtk/images/Makefile