Fix python detection

This commit is contained in:
Isaac Clerencia Perez 2005-12-27 22:08:55 +00:00
parent c1ab66507a
commit 389b63d0e8
2 changed files with 12 additions and 7 deletions

View file

@ -349,24 +349,27 @@ You should install Python development package.])])
CPPFLAGS="$OLD_CPPFLAGS"
CXXFLAGS="$OLD_CXXFLAGS"
AC_SUBST([PYTHON_CFLAGS])
found=no
for pylibpath in '' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
eval `echo unset ac_cv_lib_python$PYTHON_VERSION'_'Py_Finalize | tr '.' '_'`
save_LIBS=$LIBS
if test "x$pylibpath" != "x"; then
LIBS="$LIBS -L$pylibpath"
fi
LIBS="$LIBS -L$pylibpath"
AC_CHECK_LIB(python$PYTHON_VERSION, Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; found=yes,,$PYTHON_DEPS)
LIBS=$save_LIBS
if test "x$found" = "xyes"; then
break
fi
done
if test "x$found" != "xyes"; then
AC_ERROR(Python development libraries required)
fi
AC_SUBST([PYTHON_LIBS])
# libpng-config
AC_PATH_PROGS([PNG_CONFIG], [libpng-config libpng12-config], [none])

View file

@ -27,7 +27,7 @@ noinst_LIBRARIES = libwesnoth-core.a
pkgdatadir=$(datadir)/@DATADIR@
THELIBS = -L. -lwesnoth-core $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) $(SDL_NET_LIBS) \
$(SDL_TTF_LIBS) $(SDL_LIBS) $(LIBZIPIOS) $(FREETYPE_LIBS) $(LIBINTL)
$(SDL_TTF_LIBS) $(SDL_LIBS) $(PYTHON_LIBS) $(LIBZIPIOS) $(FREETYPE_LIBS) $(LIBINTL)
#############################################################################
# Wesnoth #
@ -40,6 +40,7 @@ wesnoth_SOURCES = \
ai_dfool.cpp \
ai_attack.cpp \
ai_move.cpp \
ai_python.cpp \
animated.cpp \
astarnode.cpp \
builder.cpp \
@ -304,6 +305,7 @@ noinst_HEADERS = \
statistics.hpp \
network.hpp \
ai2.hpp \
ai_python.hpp \
cursor.hpp \
tooltips.hpp \
halo.hpp \
@ -422,10 +424,10 @@ libwesnoth_core_a_SOURCES = \
serialization/tokenizer.cpp \
zipios++/xcoll.cpp
AM_CXXFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
AM_CXXFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ @PYTHON_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) -DFIFODIR=\"$(fifodir)\"
AM_CFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
AM_CFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ @PYTHON_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR)
if FRIBIDI