define lflags

This commit is contained in:
David Rose 2004-05-19 17:02:54 +00:00
parent e8d9b7a975
commit 925765d90a
3 changed files with 21 additions and 1 deletions

View File

@ -587,10 +587,11 @@
// $[sources] is the list of .o files. $[libs] is a space-separated
// list of dependent libraries, and $[lpath] is a space-separated list
// of directories in which those libraries can be found.
#defer LINK_BIN_C $[cc_ld] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]\
#defer LINK_BIN_C $[cc_ld] -o $[target] $[sources] $[flags] $[lpath:%=-L%] $[libs:%=-l%]\
$[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[frameworks]]
#defer LINK_BIN_C++ $[cxx_ld]\
-o $[target] $[sources]\
$[flags]\
$[lpath:%=-L%] $[libs:%=-l%]\
$[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[frameworks]]

View File

@ -89,6 +89,8 @@
#define python_ipath $[wildcard $[PYTHON_IPATH]]
#define python_lpath $[wildcard $[PYTHON_LPATH]]
#define python_fpath $[wildcard $[PYTHON_FPATH]]
#define python_cflags $[PYTHON_CFLAGS]
#define python_lflags $[PYTHON_LFLAGS]
#define python_libs $[PYTHON_LIBS]
#define python_framework $[PYTHON_FRAMEWORK]
#endif
@ -355,6 +357,20 @@
$[alt_cflags]
#end get_cflags
// This function returns the appropriate lflags for the target, based
// on the various external packages this particular target claims to
// require.
#defun get_lflags
// hack to add stl,nspr,python. should be removed
#define alt_lflags $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_lflags] $[nspr_lflags] $[python_lflags]]
#foreach package $[use_packages]
#set alt_lflags $[alt_lflags] $[$[package]_lflags]
#end package
$[alt_lflags]
#end get_lflags
// This function returns the appropriate include path for the target,
// based on the various external packages this particular target
// claims to require. This returns a space-separated set of directory

View File

@ -100,6 +100,7 @@
// These are the complete set of extra flags the compiler requires.
#defer cflags $[get_cflags] $[CFLAGS] $[CFLAGS_OPT$[OPTIMIZE]]
#defer c++flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]]
#defer lflags $[get_lflags] $[LFLAGS] $[LFLAGS_OPT$[OPTIMIZE]]
// $[complete_lpath] is rather like $[complete_ipath]: the list of
// directories (from within this tree) we should add to our -L list.
@ -515,6 +516,7 @@ $[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
#define sources $($[varname])
#define cc_ld $[or $[get_ld],$[CC]]
#define cxx_ld $[or $[get_ld],$[CXX]]
#define flags $[lflags]
$[target] : $[sources] $[static_lib_dependencies]
#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
$[TAB] $[LINK_BIN_C++]
@ -559,6 +561,7 @@ $[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
#define sources $($[varname])
#define cc_ld $[or $[get_ld],$[CC]]
#define cxx_ld $[or $[get_ld],$[CXX]]
#define flags $[lflags]
$[target] : $[sources] $[static_lib_dependencies]
#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
$[TAB] $[LINK_BIN_C++]