1 dnl Process this file with autoconf to produce a configure script.
19 AM_INIT_AUTOMAKE(VisualBoyAdvance, 1.8.0)
22 AC_HELP_STRING([--enable-c-core],[enable C core (default is no on x86 targets)]),
23 , enable_c_core=$VBA_USE_C_CORE)
25 AC_ARG_ENABLE(profiling,
26 AC_HELP_STRING([--enable-profiling],[enable profiling (default is yes)]),
27 , enable_profiling=no)
30 AC_HELP_STRING([--with-mmx],[use MMX (default is yes on x86 targets)]),
31 , with_mmx=$VBA_USE_MMX)
34 AC_HELP_STRING([--enable-sdl],[build the SDL interface (default is yes)]),
38 [ --enable-gtk=[[VERSION]] build the GTK+ interface (default is no)],[
39 if test "x$enable_gtk" != xno; then
41 if test "x$enableval" = xyes; then
44 gtk_version=$enableval
52 AC_HELP_STRING([--enable-dev],[enable development features (default is yes)]),
55 dnl Checks for programs.
61 AC_PATH_PROG(NASM, nasm)
63 dnl Checks for libraries.
64 AC_CHECK_LIB(z, gzopen,
65 , AC_MSG_ERROR([*** Cannot compile without zlib.]))
66 AC_CHECK_LIB(pthread, pthread_yield)
68 PKG_CHECK_MODULES(LIBPNG, libpng)
69 CPPFLAGS="$CPPFLAGS $LIBPNG_CFLAGS"
70 LIBS="$LIBS $LIBPNG_LIBS"
72 dnl Checks for header files.
75 AC_CHECK_HEADERS(malloc.h strings.h unistd.h arpa/inet.h netinet/in.h zutil.h)
77 dnl Checks for typedefs, structures, and compiler characteristics.
82 AC_MSG_CHECKING(for socklen_t)
84 #include <sys/socket.h>
91 #include <sys/socket.h>
92 int accept (int, struct sockaddr *, size_t *);
96 AC_DEFINE(socklen_t,size_t)
99 AC_DEFINE(socklen_t,int)
105 VBA_LIBS="../gb/libgb.a"
107 CXXFLAGS="$CXXFLAGS -DBKPT_SUPPORT"
109 if test "x$enable_c_core" = xyes; then
110 CXXFLAGS="$CXXFLAGS -DC_CORE"
113 if test "x$enable_profiling" = xyes; then
114 CXXFLAGS="$CXXFLAGS -DPROFILING"
115 VBA_SRC_EXTRA="$VBA_SRC_EXTRA prof"
116 VBA_LIBS="$VBA_LIBS ../prof/libprof.a"
119 if test "x$with_mmx" = xyes; then
120 if test "x$NASM" = x; then
121 AC_MSG_ERROR([*** Couldn't find nasm program.])
123 CXXFLAGS="$CXXFLAGS -DMMX"
124 VBA_SRC_EXTRA="$VBA_SRC_EXTRA i386"
125 VBA_LIBS="$VBA_LIBS ../i386/lib386.a"
128 if test "x$enable_sdl" = xyes || test "x$enable_gtk" = xyes; then
130 AM_PATH_SDL($SDL_VERSION,[
132 AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).])
136 if test "x$enable_sdl" = xyes; then
137 VBA_SRC_EXTRA="$VBA_SRC_EXTRA sdl"
140 if test "x$enable_gtk" = xyes; then
141 dnl Internationalisation support.
143 AM_GNU_GETTEXT(external)
144 AC_CHECK_HEADERS(libintl.h)
145 GETTEXT_PACKAGE=vba-1.8.0
146 AC_SUBST(GETTEXT_PACKAGE)
148 PKG_CHECK_MODULES(GTKMM, gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0)
149 AC_SUBST(GTKMM_CFLAGS)
151 if test "x$gtk_version" = x2.0; then
152 GTKMM_CPPFLAGS="-DGTKMM20"
154 AC_SUBST(GTKMM_CPPFLAGS)
155 VBA_EXTRA="$VBA_EXTRA po"
156 VBA_SRC_EXTRA="$VBA_SRC_EXTRA gtk"
159 if test "x$enable_dev" = xyes; then
160 CXXFLAGS="$CXXFLAGS -DDEV_VERSION"
163 if test "x$enable_sdl" != xyes && test "x$enable_gtk" != xyes; then
164 AC_MSG_WARN([*** You have chosen not to build any frontend.])
168 AC_SUBST(VBA_SRC_EXTRA)
179 src/gtk/images/Makefile