autoconf
[Top][All Lists]
Advanced

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

Correct use of CPPFLAGS, LIBS, and LDFLAGS


From: Bill Moseley
Subject: Correct use of CPPFLAGS, LIBS, and LDFLAGS
Date: Thu, 19 Sep 2002 11:39:57 -0700

In my current configure.in I create new substitution variables for each
library that may be optionally included.  For example, a test might set:

  LIBFOO_CPPFLAGS = "-Ifoo/include"
  LIBFOO_LDFLAGS  = "-Lfoo/lib"
  LIB_FOO_LIBS    = "-lfoo"

The problem is then in Makefile.in I do something like

  libs = @LIBS@ @LIB_FOO_LIBS@ @LIB_OTHERLIB_LIBS@ ...

Is there any reason not to do this in configure.in:

  CPPFLAGS = "${CPPFLAGS} -Ifoo/include"
  LDFLAGS  = "${LDFLAGS} -Lfoo/lib"
  LIBS     = "${LIBS} -lfoo"

and then in Makefile.in simply:
  
  cppflags = @CPPFLAGS@
  ldflags  = @LDFLAGS@
  libs     = @LIBS@

Or is that setting myself up for problems if I need to use more than one
Makefile (e.g. don't want the same @LIBS@ for various Makefiles)?

Thanks,


-- 
Bill Moseley
mailto:address@hidden




reply via email to

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