[asterisk-dev] confused about AST_LIBS vs LIBS vs SOLINK vs ASTLDFLAGS

Luigi Rizzo rizzo at icir.org
Tue Sep 18 16:08:28 CDT 2007


I am a bit confused on what is the proper usage of the variables
AST_LIBS, LIBS, SOLINK and ASTLDFLAGS in the Asterisk's Makefiles.

At the top of the main level Makefile there is a comment that i
wrote some time ago, basing on my understanding at the time,
but the content is probably stale if not wrong due to more recent
changes in the build system, the introduction of embedded modules,
and the like:

    # All Makefiles use the following variables:
    #
    # ASTCFLAGS - compiler options
    # ASTLDFLAGS - linker flags (not libraries)
    # AST_LIBS - libraries to build binaries XXX
    # LIBS - additional libraries, at top-level for all links,
    #      on a single object just for that object
    # SOLINK - linker flags used only for creating shared objects (.so files),
    #      used for all .so links


In particular:
- I am not clear if/how LIBS is used at all;
- what's the appropriate content for SOLINK (e.g. can it contain
  paths e.g. -L/my/special/lib ) given that it is not used when
  building with embedded modules ?

I made a wrong use of SOLINK in my video_v2 branch, but i see
there is another suspect use in the top level makefile,
and some instances of LIBS are highly suspect

My best guess is that:
- LIB and SOLINK should almost never be used (and we should explain
  why and how it makes sense);

- ASTLDFLAGS should contain only generic linker flags
  (probably excluding -L... and -l...)

- AST_LIBS should contain only -L... -l... and similar

Additionally, we should probably avoid specialized variables such as
H323LDFLAGS, PTHREAD_CFLAGS and so on.

Makes sense ?

	cheers
	luigi



More information about the asterisk-dev mailing list