automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SDL, automake, autoconf


From: Mattias Brändström
Subject: SDL, automake, autoconf
Date: Tue, 27 May 2003 16:58:59 +0200 (CEST)

Hello!

I have recently started to learn how to use autoconf and automake and
I'm finding the task a bit daunting to say the least. =) Therefore I
have a couple pf questions that I hope that someone on this list will
have the time to answer.

Some parts of my project uses SDL and I would like to find out where
the SDL libs are located in my ./configure script. I found this
snippet in a FAQ at www.libsdl.org:


dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
            :,
            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

This is all well and good and I think this will work. But, shouldn't
the last two lines be something like this:

AM_CFLAGS="$AM_CFLAGS $SDL_CFLAGS"
AM_LDFLAGS="$AM_LDFLAGS $SDL_LIBS"

I am asking since I read somewhere in the automake documentation that
some variables, CFLAGS being one of them, was reserved for the user
who is building the package.

Another thing is that only some parts of my project needs SDL in order
to work so I guess that I should set variables such as prog_CFLAGS and
prog_LDFLAGS where it is necessary?

I also have a question relating to autoconf which might be a bit
off-topic but I'll include it here anyway. When I run atoconf with
these contents in configure.ac:

--- configure.ac ---
AC_INIT(src/rkcone/log/FileLogger.cpp)

AM_INIT_AUTOMAKE(rkcone, 0.1)

AC_PROG_CXX

AC_PROG_RANLIB

AC_PROG_INSTALL

dnl Check for SDL
SDL_VERSION=1.2.5
AM_PATH_SDL($SDL_VERSION,
            :,
            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
AM_CFLAGS="$AM_CFLAGS $SDL_CFLAGS"
AM_LDFLAGS="$AM_LDFLAGS $SDL_LIBS"

AC_OUTPUT(Makefile src/Makefile src/rkcone/Makefile
src/rkcone/log/Makefile)
--------------------

I get this warning:
configure.ac:16: warning: AC_ARG_PROGRAM was called before
AC_CANONICAL_TARGET

I tried to add AC_CANONICAL_TARGET before the AM_PATH_SDL macro but I
got the same warning, this time refering to the line at where the
AC_CANONICAL_TARGET was located. Is this something I should be worried
about?

One last question. =)
I will be using the xml parser xerces from apache later on. Does
anyone here know of some handy autoconf macros to use in order to be
able to find those libs fom ./configure?

Any help will be very helpful! =)

Regards,
Mattias





reply via email to

[Prev in Thread] Current Thread [Next in Thread]