Clean build system

SVN revision: 32534
This commit is contained in:
Sebastian Dransfeld 2007-11-10 12:17:07 +00:00
parent 57331eae88
commit 1ec701e87e
13 changed files with 225 additions and 252 deletions

View File

@ -46,83 +46,120 @@ AC_SUBST(PACKAGE_DATA_DIR)
PKG_CHECK_MODULES([EVAS], evas)
PCFLAGS=$CFLAGS
CFLAGS="$EVAS_CFLAGS $CFLAGS"
have_glew_opengl="no"
AC_CHECK_HEADER(Evas_Engine_GL_Glew.h,
[ AC_DEFINE(HAVE_EVAS_GL_GLEW, 1, [Evas GL Glew Engine Support])
have_glew_opengl="yes"
glew_libs="-lglew32 -lgdi32" ],
[ dummy=no ],
[ #include <Evas.h> ]
dnl OpenGL GLEW
PKG_CHECK_EXISTS(evas-opengl-glew,
[
AC_DEFINE(HAVE_EVAS_OPENGL_GLEW, 1, [Evas GL Glew Engine Support])
have_opengl_glew="yes"
glew_libs="-lglew32 -lgdi32"
],
[ have_opengl_glew="no" ]
)
AM_CONDITIONAL(BUILD_OPENGL_GLEW, test "x$have_opengl_glew" = "xyes")
have_xlib_opengl="no"
AC_CHECK_HEADER(Evas_Engine_GL_X11.h,
[ AC_DEFINE(HAVE_EVAS_GL, 1, [Evas GL Engine Support])
have_xlib_opengl="yes" ],
[ dummy=no ],
[ #include <Evas.h> ]
dnl OpenGL X11
PKG_CHECK_EXISTS(evas-opengl-x11,
[
AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas GL X11 Engine Support])
have_opengl_x11="yes"
],
[ have_opengl_x11="no" ]
)
AM_CONDITIONAL(BUILD_OPENGL_X11, test "x$have_opengl_x11" = "xyes")
have_xlib="no"
AC_CHECK_HEADER(Evas_Engine_Software_X11.h,
[ AC_DEFINE(HAVE_SOFTWARE_X11, 1, [Evas Software X11 Engine Support])
have_xlib="yes" ],
[ dummy=no ],
[ #include <Evas.h> ]
dnl Software X11
PKG_CHECK_EXISTS(evas-software-x11,
[
AC_DEFINE(HAVE_EVAS_SOFTWARE_X11, 1, [Evas Software X11 Engine Support])
have_software_x11="yes"
],
[ have_software_x11="no" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_X11, test "x$have_software_x11" = "xyes")
have_xlib_render="no"
AC_CHECK_HEADER(Evas_Engine_XRender_X11.h,
[ AC_DEFINE(HAVE_XRENDER_X11, 1, [Evas XRender X11 Engine Support])
have_xlib_render="yes" ],
[ dummy=no ],
[ #include <Evas.h> ]
dnl XRender X11
PKG_CHECK_EXISTS(evas-xrender-x11,
[
AC_DEFINE(HAVE_EVAS_XRENDER_X11, 1, [Evas XRender X11 Engine Support])
have_xrender_x11="yes"
],
[ have_xrender_x11="no" ]
)
AM_CONDITIONAL(BUILD_XRENDER_X11, test "x$have_xrender_x11" = "xyes")
have_xlib_16="no"
AC_CHECK_HEADER(Evas_Engine_Software_16_X11.h,
[ AC_DEFINE(HAVE_SOFTWARE_16_X11, 1, [Evas Software 16bit X11 Engine Support])
have_xlib_16="yes" ],
[ dummy=no ],
[ #include <Evas.h> ]
dnl Software 16bit X11
PKG_CHECK_EXISTS(evas-software-16-x11,
[
AC_DEFINE(HAVE_EVAS_SOFTWARE_16_X11, 1, [Evas Software 16bit X11 Engine Support])
have_software_16_x11="yes"
],
[ have_software_16_x11="no" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_16_X11, test "x$have_software_16_x11" = "xyes")
have_ddraw="no"
AC_CHECK_HEADER(Evas_Engine_Software_DDraw.h,
[ AC_DEFINE(HAVE_SOFTWARE_DDRAW, 1, [Evas Software DirectDraw Engine Support])
have_ddraw="yes"
ddraw_libs="-lddraw -ldxguid" ],
[ dummy=no ],
[ #include <Evas.h> ]
# TODO: Check availability of libs
dnl DirectDraw
PKG_CHECK_EXISTS(evas-software-ddraw,
[
AC_DEFINE(HAVE_EVAS_SOFTWARE_DDRAW, 1, [Evas Software DirectDraw Engine Support])
have_software_ddraw="yes"
ddraw_libs="-lddraw -ldxguid"
],
[ have_software_ddraw="no" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_DDRAW, test "x$have_software_ddraw" = "xyes")
have_ddraw_16="no"
AC_CHECK_HEADER(Evas_Engine_Software_16_DDraw.h,
[ AC_DEFINE(HAVE_SOFTWARE_16_DDRAW, 1, [Evas 16bit Software DirectDraw Engine Support])
have_ddraw_16="yes"
ddraw_16_libs="-lddraw -ldxguid" ],
[ dummy=no ],
[ #include <Evas.h> ]
# TODO: Check availability of libs
dnl 16bit DirectDraw
PKG_CHECK_EXISTS(evas-software-16-ddraw,
[
AC_DEFINE(HAVE_EVAS_SOFTWARE_16_DDRAW, 1, [Evas Software 16bit DirectDraw Engine Support])
have_software_16_ddraw="yes"
ddraw_libs="-lddraw -ldxguid"
],
[ have_software_16_ddraw="no" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_16_DDRAW, test "x$have_software_16_ddraw" = "xyes")
have_d3d="no"
AC_CHECK_HEADER(Evas_Engine_Direct3D.h,
[ AC_DEFINE(HAVE_DIRECT3D, 1, [Evas Direct3D Engine Support])
have_d3d="yes"
d3d_libs="-ld3d9 -ld3dx9d" ],
[ dummy=no ],
[ #include <Evas.h> ]
# TODO: Check availability of libs
dnl Direct3D
PKG_CHECK_EXISTS(evas-direct3d,
[
AC_DEFINE(HAVE_EVAS_DIRECT3D, 1, [Evas Direct3D Engine Support])
have_direct3d="yes"
d3d_libs="-ld3d9 -ld3dx9d"
],
[ have_direct3d="no" ]
)
AM_CONDITIONAL(BUILD_DIRECT3D, test "x$have_direct3d" = "xyes")
if test "x$have_xlib" = "xyes" -o "x$have_xlib_16" = "xyes" -o "x$have_xlib_render" = "xyes" -o "x$have_xlib_opengl" = "xyes" ; then
AC_PATH_XTRA
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
dnl Software SDL
PKG_CHECK_EXISTS(evas-software-sdl,
[
AC_DEFINE(HAVE_EVAS_SOFTWARE_SDL, 1, [Evas Software SDL Engine Support])
have_software_sdl="yes"
],
[ have_direct3d="no" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_SDL, test "x$have_software_sdl" = "xyes")
if test "x$have_software_x11" = "xyes" -o "x$have_software_16_x11" = "xyes" -o "x$have_xrender_x11" = "xyes" -o "x$have_opengl_x11" = "xyes"; then
AC_PATH_XTRA
AC_CHECK_HEADERS(X11/Xlib.h X11/Xutil.h,
[ have_x11="yes" ],
[ have_x11="no" ])
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
fi
AM_CONDITIONAL(BUILD_X11, test "x$have_x11" = "xyes")
if test "x$have_software_sdl" = "xyes"; then
PKG_CHECK_MODULES([SDL], sdl,
[ have_sdl="yes" ],
[ have_sdl="no" ])
fi
AM_CONDITIONAL(BUILD_SDL, test "x$have_sdl" = "xyes")
AC_SUBST(x_cflags)
AC_SUBST(x_libs)
@ -131,35 +168,6 @@ AC_SUBST(ddraw_16_libs)
AC_SUBST(d3d_libs)
AC_SUBST(glew_libs)
#######################################
## SDL
AC_ARG_WITH(sdl-config, [ --with-sdl-config=SDL_CONFIG use sdl-config specified],
[ SDL_CONFIG=$withval;
echo "using "$SDL_CONFIG" for sdl-config"; ],
[ if test -z "$SDL_CONFIG"; then
AC_PATH_PROG(SDL_CONFIG, "sdl-config", "", $PATH)
fi
])
if test -z "$SDL_CONFIG" ; then SDL_CONFIG="sdl-config"; fi
sdl_cflags=""
sdl_libs=""
have_sdl="no"
AC_CHECK_HEADER(Evas_Engine_SDL.h,
[ AC_DEFINE(HAVE_SOFTWARE_SDL, 1, [Evas Software SDL Support])
have_sdl="yes"
sdl_cflags=`$SDL_CONFIG --cflags`
sdl_libs=`$SDL_CONFIG --libs` ],
[ dummy=no ],
[ #include <Evas.h> ]
)
AC_SUBST(sdl_cflags)
AC_SUBST(sdl_libs)
CFLAGS=$PCFLAGS
AC_OUTPUT([
Makefile
src/Makefile
@ -171,15 +179,15 @@ echo
echo " $PACKAGE $VERSION"
echo
echo " Engines:"
echo " Software Xlib................: ${have_xlib}"
echo " Software Xlib 16 bits........: ${have_xlib_16}"
echo " X Render Xlib................: ${have_xlib_render}"
echo " Open GL Glew.................: ${have_glew_opengl}"
echo " Open GL Xlib.................: ${have_xlib_opengl}"
echo " Software DirectDraw..........: ${have_ddraw}"
echo " Software DirectDraw 16 bits..: ${have_ddraw}"
echo " Direct3D.....................: ${have_d3d}"
echo " Software SDL.................: ${have_sdl}"
echo " Software X11.................: ${have_software_x11}"
echo " Software X11 16 bits.........: ${have_software_16_x11}"
echo " X Render X11.................: ${have_xrender_x11}"
echo " Open GL X11..................: ${have_opengl_x11}"
echo " Open GL Glew.................: ${have_opengl_glew}"
echo " Software DirectDraw..........: ${have_software_ddraw}"
echo " Software DirectDraw 16 bits..: ${have_software_16_ddraw}"
echo " Direct3D.....................: ${have_direct3d}"
echo " Software SDL.................: ${have_software_sdl}"
echo
echo " Installation:"
echo " prefix.......................: ${prefix}"

View File

@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(includedir) \
-I$(top_srcdir) \
-I$(top_srcdir)/src/bin \
@EVAS_CFLAGS@ @x_cflags@ @sdl_cflags@ \
@EVAS_CFLAGS@ @x_cflags@ @SDL_CFLAGS@ \
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
-DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \
-DPACKAGE_DATA_DIR=\"@PACKAGE_DATA_DIR@\"
@ -11,15 +11,6 @@ bin_PROGRAMS = expedite
expedite_SOURCES = \
main.c main.h \
engine_software_x11.c engine_software_x11.h \
engine_gl_glew.c engine_gl_glew.h \
engine_gl_x11.c engine_gl_x11.h \
engine_xrender_x11.c engine_xrender_x11.h \
engine_software_16_x11.c engine_software_16_x11.h \
engine_software_ddraw.c engine_software_ddraw.h \
engine_software_16_ddraw.c engine_software_16_ddraw.h \
engine_direct3d.cpp engine_direct3d.h \
engine_software_sdl.c engine_software_sdl.h \
ui.c ui.h \
about.c about.h \
tests.h \
@ -62,4 +53,49 @@ image_blend_occlude2_very_many.c \
image_blend_occlude3_very_many.c \
poly_blend.c
expedite_LDFLAGS = @EVAS_LIBS@ @sdl_libs@ @x_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @glew_libs@ -lm
expedite_LDFLAGS = @EVAS_LIBS@ @SDL_LIBS@ @x_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @glew_libs@ -lm
if BUILD_SOFTWARE_X11
expedite_SOURCES += \
engine_software_x11.c engine_software_x11.h
endif
if BUILD_OPENGL_X11
expedite_SOURCES += \
engine_gl_x11.c engine_gl_x11.h
endif
if BUILD_SOFTWARE_16_X11
expedite_SOURCES += \
engine_software_16_x11.c engine_software_16_x11.h
endif
if BUILD_XRENDER_X11
expedite_SOURCES += \
engine_xrender_x11.c engine_xrender_x11.h
endif
if BUILD_OPENGL_GLEW
expedite_SOURCES += \
engine_gl_glew.c engine_gl_glew.h
endif
if BUILD_SOFTWARE_DDRAW
expedite_SOURCES += \
engine_software_ddraw.c engine_software_ddraw.h
endif
if BUILD_SOFTWARE_16_DDRAW
expedite_SOURCES += \
engine_software_16_ddraw.c engine_software_16_ddraw.h
endif
if BUILD_DIRECT3D
expedite_SOURCES += \
engine_direct3d.cpp engine_direct3d.h
endif
if BUILD_SOFTWARE_SDL
expedite_SOURCES += \
engine_software_sdl.c engine_software_sdl.h
endif

View File

@ -1,28 +1,7 @@
#include "main.h"
#ifndef HAVE_DIRECT3D
extern "C" {
int
engine_direct3d_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Direct3D Engine built\n");
return 0;
}
void
engine_direct3d_loop(void)
{
}
}
#else
# include <windowsx.h>
# include <Evas_Engine_Direct3D.h>
#include <windowsx.h>
#include <Evas_Engine_Direct3D.h>
static HWND window;
@ -388,5 +367,3 @@ engine_direct3d_loop(void)
}
#endif /* HAVE_DIRECT3D */

View File

@ -1,19 +1,5 @@
#include "main.h"
#ifndef HAVE_EVAS_GL_GLEW
int
engine_gl_glew_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No GL Glew Engine built\n");
return 0;
}
void
engine_gl_glew_loop(void)
{
}
#else
#include <windows.h>
#include <windowsx.h>
#include <GL/glew.h>
@ -321,5 +307,3 @@ engine_gl_glew_loop(void)
goto again;
}
#endif /* HAVE_EVAS_GL_GLEW */

View File

@ -1,17 +1,5 @@
#include "main.h"
#ifndef HAVE_EVAS_GL
int
engine_gl_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No GL X11 Engine built\n");
return 0;
}
void
engine_gl_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_GL_X11.h>
@ -203,4 +191,3 @@ engine_gl_x11_loop(void)
}
goto again;
}
#endif

View File

@ -1,19 +1,5 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_16_DDRAW
int
engine_software_16_ddraw_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No 16bits Software DirectDraw Engine built\n");
return 0;
}
void
engine_software_16_ddraw_loop(void)
{
}
#else
#include <windows.h>
#include <windowsx.h>
#include <ddraw.h>
@ -386,5 +372,3 @@ engine_software_16_ddraw_loop(void)
goto again;
}
#endif /* HAVE_SOFTWARE_DDRAW */

View File

@ -1,17 +1,5 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_16_X11
int
engine_software_16_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Software 16bit X11 Engine built\n");
return 0;
}
void
engine_software_16_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_Software_16_X11.h>
@ -200,4 +188,3 @@ engine_software_16_x11_loop(void)
}
goto again;
}
#endif

View File

@ -1,19 +1,5 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_DDRAW
int
engine_software_ddraw_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Software DirectDraw Engine built\n");
return 0;
}
void
engine_software_ddraw_loop(void)
{
}
#else
#include <windows.h>
#include <windowsx.h>
#include <ddraw.h>
@ -374,5 +360,3 @@ engine_software_ddraw_loop(void)
goto again;
}
#endif /* HAVE_SOFTWARE_DDRAW */

View File

@ -1,20 +1,5 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_SDL
int
engine_software_sdl_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Software SDL Engine built\n");
return 0;
}
void
engine_software_sdl_loop(void)
{
}
#else
#include <SDL/SDL.h>
#include <Evas_Engine_SDL.h>
@ -44,6 +29,7 @@ engine_software_sdl_args(int argc, char **argv)
einfo->info.noframe = 0;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
return 1;
}
void
@ -122,6 +108,8 @@ engine_software_sdl_loop(void)
else
evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
break;
default:
break;
}
break;
case SDL_KEYUP:
@ -154,6 +142,8 @@ engine_software_sdl_loop(void)
else
evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
break;
default:
break;
}
break;
case SDL_QUIT:
@ -170,5 +160,3 @@ engine_software_sdl_loop(void)
}
}
}
#endif

View File

@ -1,17 +1,5 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_X11
int
engine_software_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Software X11 Engine built\n");
return 0;
}
void
engine_software_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_Software_X11.h>
@ -205,4 +193,3 @@ engine_software_x11_loop(void)
}
goto again;
}
#endif

View File

@ -1,17 +1,5 @@
#include "main.h"
#ifndef HAVE_XRENDER_X11
int
engine_xrender_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No XRender X11 Engine built\n");
return 0;
}
void
engine_xrender_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_XRender_X11.h>
@ -200,4 +188,3 @@ engine_xrender_x11_loop(void)
}
goto again;
}
#endif

View File

@ -1136,24 +1136,42 @@ _engine_args(int argc, char **argv)
/* FIXME: parse args for geometry, engine etc. */
profile_ok = _profile_parse(argc, argv);
#if HAVE_EVAS_SOFTWARE_X11
if (engine_software_x11_args(argc, argv))
loop_func = engine_software_x11_loop;
#endif
#if HAVE_EVAS_OPENGL_GLEW
if (engine_gl_glew_args(argc, argv))
loop_func = engine_gl_glew_loop;
#endif
#if HAVE_EVAS_OPENGL_X11
if (engine_gl_x11_args(argc, argv))
loop_func = engine_gl_x11_loop;
#endif
#if HAVE_EVAS_XRENDER_X11
if (engine_xrender_x11_args(argc, argv))
loop_func = engine_xrender_x11_loop;
#endif
#if HAVE_EVAS_SOFTWARE_X11
if (engine_software_16_x11_args(argc, argv))
loop_func = engine_software_16_x11_loop;
#endif
#if HAVE_EVAS_SOFTWARE_DDRAW
if (engine_software_ddraw_args(argc, argv))
loop_func = engine_software_ddraw_loop;
#endif
#if HAVE_EVAS_SOFTWARE_16_DDRAW
if (engine_software_16_ddraw_args(argc, argv))
loop_func = engine_software_16_ddraw_loop;
#endif
#if HAVE_EVAS_SOFTWARE_SDL
if (engine_software_sdl_args(argc, argv))
loop_func = engine_software_sdl_loop;
#endif
#if HAVE_EVAS_DIRECT3D
if (engine_direct3d_args(argc, argv))
loop_func = engine_direct3d_loop;
#endif
if ((!loop_func) || (!profile_ok))
{
fprintf(stderr,
@ -1164,7 +1182,35 @@ _engine_args(int argc, char **argv)
" -p PROFILE\n"
"\n"
"Where ENGINE can be one of:\n"
" x11 xr gl-glew gl x11-16 ddraw ddraw-16 direct3d sdl\n"
" "
#if HAVE_EVAS_SOFTWARE_X11
" x11"
#endif
#if HAVE_EVAS_XRENDER_X11
" xr"
#endif
#if HAVE_EVAS_OPENGL_GLEW
" gl-glew"
#endif
#if HAVE_EVAS_OPENGL_X11
" gl"
#endif
#if HAVE_EVAS_SOFTWARE_16_X11
" x11-16"
#endif
#if HAVE_EVAS_SOFTWARE_DDRAW
" ddraw"
#endif
#if HAVE_EVAS_SOFTWARE_16_DDRAW
" ddraw-16"
#endif
#if HAVE_EVAS_DIRECT3D
" direct3d"
#endif
#if HAVE_EVAS_SOFTWARE_SDL
" sdl"
#endif
"\n"
"Where PROFILE can be one of:\n"
" qvga qvga-p vga vga-p wvga wvga-p svga svga-p xga xga-p wxga wxga-p\n"
" n800\n"

View File

@ -14,15 +14,33 @@
#include <Evas.h>
#include "config.h"
#if HAVE_EVAS_SOFTWARE_X11
#include "engine_software_x11.h"
#endif
#if HAVE_EVAS_OPENGL_GLEW
#include "engine_gl_glew.h"
#endif
#if HAVE_EVAS_OPENGL_X11
#include "engine_gl_x11.h"
#endif
#if HAVE_EVAS_XRENDER_X11
#include "engine_xrender_x11.h"
#endif
#if HAVE_EVAS_SOFTWARE_16_X11
#include "engine_software_16_x11.h"
#endif
#if HAVE_EVAS_SOFTWARE_DDRAW
#include "engine_software_ddraw.h"
#endif
#if HAVE_EVAS_SOFTWARE_16_DDRAW
#include "engine_software_16_ddraw.h"
#endif
#if HAVE_EVAS_DIRECT3D
#include "engine_direct3d.h"
#endif
#if HAVE_EVAS_SOFTWARE_SDL
#include "engine_software_sdl.h"
#endif
#include "ui.h"
#include "about.h"