Creating configure script pb

Hi,

I’d like to know how to create configure scripts with SDL. Actually when
I use autoconf tools, as soon as I run aclocal, I get an error as the
AM_PATH_SDL() macro is not supporting directly. What is the best way to
do configure script with SDL ?

Bye
Lawouach

Hi,

I’d like to know how to create configure scripts with SDL. Actually when
I use autoconf tools, as soon as I run aclocal, I get an error as the
AM_PATH_SDL() macro is not supporting directly. What is the best way to
do configure script with SDL ?

Here’s an example from mine (automake-2.52 fwiw)
note that SDL normally installs sdl.m4 into the aclocal directory
(/usr/share/aclocal on my Mandrake-8.2-Cooker system :slight_smile:

I’ve got a couple of other tests in here that are a bit fun too - SDL_image
and SDL_mixer fwiw. Oh, and in Makefile.am I’ve got:
_LDADD = @SDL_LIBS@
I’ve cut out my program name and replaced it with btw - that’s
not an Automake sub G. I’ve got some fun OpenGL tests too, hoping to try
it out on non-linux systems sometime soon, once I have a working bin g.

Oh, most of this is based on configure.in from /test/configure.in, with adjustment from a bunch of other projects
that depend on SDL… So it works for me.

dnl Check for SDL
SDL_VERSION=1.2.0
USE_SDL=1
AC_ARG_ENABLE(sdl, [ --enable-sdl build with SDL. [default=yes]],
if test “$enableval” = “no”; then
USE_SDL=
fi;)

have_sdl=no
if test x$USE_SDL = x1 ; then
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
have_sdl=yes
fi
dnl end of check for SDL
AC_SUBST(SDL_LIBS)

dnl check for SDL_Image
AC_CHECK_LIB(SDL_image, IMG_Load, [have_SDL_image=yes], , $SDL_LIBS)
if test x$have_SDL_image = xyes; then
AC_CHECK_HEADERS(SDL/SDL_image.h)
fi
AC_CHECK_LIB(SDL_mixer, Mix_PlayMusic, [have_SDL_mixer=yes], , $SDL_LIBS)
if test x$have_SDL_mixer = xyes; then
AC_CHECK_HEADERS(SDL/SDL_mixer.h)
fiOn Wed, 17 Oct 2001, sylvain.hellegouarch at etud.univ-ubs.fr wrote:

G’day, eh? :slight_smile:
- Teunis

winterlion wrote:

Hi,

I’d like to know how to create configure scripts with SDL. Actually when
I use autoconf tools, as soon as I run aclocal, I get an error as the
AM_PATH_SDL() macro is not supporting directly. What is the best way to
do configure script with SDL ?

Here’s an example from mine (automake-2.52 fwiw)
note that SDL normally installs sdl.m4 into the aclocal directory
(/usr/share/aclocal on my Mandrake-8.2-Cooker system :slight_smile:

I’ve got a couple of other tests in here that are a bit fun too - SDL_image
and SDL_mixer fwiw. Oh, and in Makefile.am I’ve got:
_LDADD = @SDL_LIBS@
I’ve cut out my program name and replaced it with btw - that’s
not an Automake sub G. I’ve got some fun OpenGL tests too, hoping to try
it out on non-linux systems sometime soon, once I have a working bin g.

Oh, most of this is based on configure.in from /test/configure.in, with adjustment from a bunch of other projects
that depend on SDL… So it works for me.

dnl Check for SDL
SDL_VERSION=1.2.0
USE_SDL=1
AC_ARG_ENABLE(sdl, [ --enable-sdl build with SDL. [default=yes]],
if test “$enableval” = “no”; then
USE_SDL=
fi;)

have_sdl=no
if test x$USE_SDL = x1 ; then
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
have_sdl=yes
fi
dnl end of check for SDL
AC_SUBST(SDL_LIBS)

dnl check for SDL_Image
AC_CHECK_LIB(SDL_image, IMG_Load, [have_SDL_image=yes], , $SDL_LIBS)
if test x$have_SDL_image = xyes; then
AC_CHECK_HEADERS(SDL/SDL_image.h)
fi
AC_CHECK_LIB(SDL_mixer, Mix_PlayMusic, [have_SDL_mixer=yes], , $SDL_LIBS)
if test x$have_SDL_mixer = xyes; then
AC_CHECK_HEADERS(SDL/SDL_mixer.h)
fi

G’day, eh? :slight_smile:
- Teunis

Great I’ll try that
Many thanx !> On Wed, 17 Oct 2001, @Sylvain.Hellegouarch wrote: