Autoconf issue

I am trying to port an app to SDL and I’m also trying to add autoconf and
automake at the same time.

I have very basic configure.in and Makefile.am files. I copied sdl.m4 to
acinclude.m4. The check works when I run ./configure but it doesn’t
get configured quite right.

sdl-config --cflags gives me:

-I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT

But this doesn’t get included in compilation… for instance it tries:

c++ -DPACKAGE=“fblocks” -DVERSION=“0.06” -I. -I. -g -O2 -c
group.cpp

Note the missing -I arguments. When it tries to link, the libs are
included correctly:

c++ -g -O2 -o fblocks app.o block.o field.o game.o graphics.o group.o
piece.o -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

So I can’t figure out why the cflags aren’t being used. Here are the two
files:

=== configure.in ===

AC_INIT(app.cpp)
AM_INIT_AUTOMAKE(fblocks, 0.06)
AC_PROG_CC
AC_PROG_CXX

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"

AC_OUTPUT(Makefile)

=== Makefile.am ===

bin_PROGRAMS = fblocks
fblocks_SOURCES =app.cpp block.cpp block.h field.cpp field.h game.cpp
game.h graphics.cpp graphics.h group.cpp group.h images.h piece.cpp
piece.h speed.h timing.h–
@Daniel_W_Lemon

=== configure.in ===

AC_INIT(app.cpp)
AM_INIT_AUTOMAKE(fblocks, 0.06)
AC_PROG_CC
AC_PROG_CXX

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"

Doesn’t it use CXXFLAGS for compiling C++ targets? How about:

CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"

LIBS="$LIBS $SDL_LIBS"

AC_OUTPUT(Makefile)

  • Mike

Yes. Thank you.On Sun, 10 Jun 2001, Mike Battersby wrote:

CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"


@Daniel_W_Lemon