Browse Source

Proper detection of libcaca and libpipi.

legacy
Sam Hocevar sam 14 years ago
parent
commit
3e266b5dce
5 changed files with 33 additions and 12 deletions
  1. +17
    -2
      configure.ac
  2. +2
    -0
      gfx/font/Makefile.am
  3. +2
    -2
      src/Makefile.am
  4. +5
    -5
      src/debugrecord.cpp
  5. +7
    -3
      tools/Makefile.am

+ 17
- 2
configure.ac View File

@@ -67,9 +67,24 @@ if test "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no"; then
AC_MSG_ERROR([[cannot find SDL_Image or GTK+, please install one of them]])
fi

if test "${enable_debug}" = "yes"; then
AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)

# Use libcaca? (required for font generation)
ac_cv_my_have_caca="no"
PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
if test "${ac_cv_my_have_caca}" != "no"; then
AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
fi
AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")


# Use libpipi? (required for video recording)
ac_cv_my_have_pipi="no"
PKG_CHECK_MODULES(PIPI, pipi, [ac_cv_my_have_pipi="yes"], [:])
if test "${ac_cv_my_have_pipi}" != "no"; then
AC_DEFINE(USE_PIPI, 1, Define to 1 to use libpipi)
fi
AM_CONDITIONAL(USE_PIPI, test "${ac_cv_my_have_pipi}" != "no")


if test "${enable_release}" = "yes"; then
AC_DEFINE(FINAL_RELEASE, 1, Define to 1 to activate final release)


+ 2
- 0
gfx/font/Makefile.am View File

@@ -1,4 +1,5 @@

if USE_CACA
all: ascii.png

ascii.png:
@@ -6,4 +7,5 @@ ascii.png:

clean:
rm -f ascii.png
endif


+ 2
- 2
src/Makefile.am View File

@@ -14,9 +14,9 @@ libcommon_a_SOURCES = \
libcommon_a_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image`

test_map_SOURCES = test-map.cpp sdlinput.cpp sdlinput.h
test_map_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image`
test_map_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image` @PIPI_CFLAGS@
test_map_LDADD = libcommon.a
test_map_LDFLAGS = `pkg-config --libs sdl gl SDL_image` -lpipi
test_map_LDFLAGS = `pkg-config --libs sdl gl SDL_image` @PIPI_LIBS@

editor_SOURCES = gtk/editor.cpp gtk/glmapview.cpp gtk/glmapview.h
editor_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image gtk+-2.0 gtkgl-2.0`


+ 5
- 5
src/debugrecord.cpp View File

@@ -10,7 +10,7 @@
#include <cstdio>
#include <cstring>

#if defined HAVE_PIPI_H
#if defined USE_PIPI
# include <pipi.h>
#endif

@@ -28,7 +28,7 @@ class DebugRecordData
private:
char const *path;
int width, height;
#if defined HAVE_PIPI_H
#if defined USE_PIPI
pipi_sequence_t *sequence;
#endif
};
@@ -43,7 +43,7 @@ DebugRecord::DebugRecord(char const *path)
data->path = strdup(path);
data->width = 0;
data->height = 0;
#if defined HAVE_PIPI_H
#if defined USE_PIPI
data->sequence = NULL;
#endif
}
@@ -70,7 +70,7 @@ void DebugRecord::TickDraw(float deltams)
data->width = width;
data->height = height;

#if defined HAVE_PIPI_H
#if defined USE_PIPI
if (data->sequence)
pipi_close_sequence(data->sequence);

@@ -78,7 +78,7 @@ void DebugRecord::TickDraw(float deltams)
#endif
}

#if defined HAVE_PIPI_H
#if defined USE_PIPI
if (data->sequence)
{
uint32_t *buffer = new uint32_t[width * height];


+ 7
- 3
tools/Makefile.am View File

@@ -1,7 +1,11 @@

noinst_PROGRAMS = make-font
noinst_PROGRAMS = $(make_font)

make_font_SOURCES = make-font.cpp
make_font_CXXFLAGS = `pkg-config --cflags caca`
make_font_LDFLAGS = `pkg-config --libs caca`
make_font_CXXFLAGS = @CACA_CFLAGS@
make_font_LDFLAGS = @CACA_LIBS@

if USE_CACA
make_font = make-font
endif


Loading…
Cancel
Save