@@ -20,6 +20,7 @@ libcaca_la_SOURCES = \ | |||||
caca_types.h \ | caca_types.h \ | ||||
caca_internals.h \ | caca_internals.h \ | ||||
caca_debug.h \ | caca_debug.h \ | ||||
caca_prof.h \ | |||||
caca_stubs.h \ | caca_stubs.h \ | ||||
caca_conio.c \ | caca_conio.c \ | ||||
caca_conio.h \ | caca_conio.h \ | ||||
@@ -17,6 +17,7 @@ | |||||
#include "caca_stubs.h" | #include "caca_stubs.h" | ||||
#include "caca_debug.h" | #include "caca_debug.h" | ||||
#include "caca_prof.h" | |||||
typedef struct caca_timer caca_timer_t; | typedef struct caca_timer caca_timer_t; | ||||
typedef struct caca_privevent caca_privevent_t; | typedef struct caca_privevent caca_privevent_t; | ||||
@@ -0,0 +1,33 @@ | |||||
/* | |||||
* libcaca Colour ASCII-Art library | |||||
* Copyright (c) 2009 Sam Hocevar <sam@hocevar.net> | |||||
* All Rights Reserved | |||||
* | |||||
* $Id$ | |||||
* | |||||
* This library is free software; you can redistribute it and/or | |||||
* modify it under the terms of the Do What The Fuck You Want To | |||||
* Public License, Version 2, as published by Sam Hocevar. See | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | |||||
*/ | |||||
/* | |||||
* This file contains profiling functions. | |||||
*/ | |||||
#ifndef __CACA_PROF_H__ | |||||
#define __CACA_PROF_H__ | |||||
#if defined PROF && !defined __KERNEL__ | |||||
# define PROFILING_VARS | |||||
# define START_PROF(obj, fn) | |||||
# define STOP_PROF(obj, fn) | |||||
#else | |||||
# define PROFILING_VARS | |||||
# define START_PROF(obj, fn) do { } while(0) | |||||
# define STOP_PROF(obj, fn) do { } while(0) | |||||
#endif | |||||
#endif /* __CACA_PROF_H__ */ | |||||
@@ -412,6 +412,10 @@ | |||||
RelativePath="caca_internals.h" | RelativePath="caca_internals.h" | ||||
> | > | ||||
</File> | </File> | ||||
<File | |||||
RelativePath="caca_prof.h" | |||||
> | |||||
</File> | |||||
<File | <File | ||||
RelativePath="caca_stubs.h" | RelativePath="caca_stubs.h" | ||||
> | > | ||||
@@ -92,6 +92,8 @@ AC_ARG_ENABLE(imlib2, | |||||
dnl conditional builds | dnl conditional builds | ||||
AC_ARG_ENABLE(debug, | AC_ARG_ENABLE(debug, | ||||
[ --enable-debug build debug versions of the library (default no)]) | [ --enable-debug build debug versions of the library (default no)]) | ||||
AC_ARG_ENABLE(prof, | |||||
[ --enable-prof activate built-in profiling (default no)]) | |||||
AC_ARG_ENABLE(plugins, | AC_ARG_ENABLE(plugins, | ||||
[ --enable-plugins make X11 and GL drivers plugins (default disabled)]) | [ --enable-plugins make X11 and GL drivers plugins (default disabled)]) | ||||
AC_ARG_ENABLE(doc, | AC_ARG_ENABLE(doc, | ||||
@@ -321,6 +323,10 @@ if test "${enable_debug}" = "yes"; then | |||||
AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) | AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) | ||||
fi | fi | ||||
if test "${enable_prof}" = "yes"; then | |||||
AC_DEFINE(PROF, 1, Define to 1 to activate profiling) | |||||
fi | |||||
if test "${enable_plugins}" = "yes"; then | if test "${enable_plugins}" = "yes"; then | ||||
ac_cv_my_have_plugins="yes" | ac_cv_my_have_plugins="yes" | ||||
AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins) | AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins) | ||||