| |
| |
| |
| |
|
|
| module curlppvars { } |
|
|
| if [ option.get "no-curlpp" : : yes ] |
| { |
| rule curlpp ( what ? ) { } |
| } |
| else |
| { |
| local version ; |
| local prefix ; |
| |
| local curlpp = [ option.get "with-curlpp" ] ; |
| if ! $(curlpp) |
| { |
| local where = [ os.environ "CURLPP_ROOT" ] ; |
| if $(where) |
| { |
| option.set "with-curlpp" : $(where) ; |
| local msg = "CURLPP: setting --with-curlpp=$(where) via environment" ; |
| echo "$(msg) variable CURLPP_ROOT" ; |
| } |
| curlpp = [ option.get "with-curlpp" ] ; |
| } |
| |
| local config ; |
| if $(curlpp) |
| { |
| config = $(curlpp)/bin/curlpp-config ; |
| } |
| else |
| { |
| local curlpp-check = [ _shell "curlpp-config 2>/dev/null" : exit-status ] ; |
| if $(curlpp-check[2]) = 0 { config = curlpp-config ; } |
| } |
| |
| if $(config) |
| { |
| prefix = [ shell_or_die "$(config) --prefix" ] ; |
| version = [ shell_or_die "$(config) --version" ] ; |
| version = [ SPLIT_BY_CHARACTERS $(version) : " " ] ; |
| version = [ trim-nl $(version[2]) ] ; |
| modules.poke curlppvars : prefix : $(prefix) ; |
| modules.poke curlppvars : version : $(version) ; |
|
|
| requirements += <define>HAVE_CURLPP ; |
| local cpp-cflags = [ shell_or_die "$(config) --cflags" ] ; |
| for local i in [ SPLIT_BY_CHARACTERS $(cpp-cflags) : " " ] |
| { |
| local incpath = [ MATCH "-I(.*)" : $(i) ] ; |
| if $(incpath) |
| { |
| |
| requirements += <cxxflags>"-isystem $(incpath)" ; |
| |
| } |
| } |
| local cpp-libs = [ shell_or_die "$(config) --libs" ] ; |
| local cpp-prefix = [ shell_or_die "$(config) --prefix" ] ; |
| for local i in [ SPLIT_BY_CHARACTERS $(cpp-libs) : " " ] |
| { |
| local libpath = [ MATCH "^-L(.*)" : $(i) ] ; |
| if $(libpath) { requirements += <library-path>$(libpath) ; } |
| local libname = [ MATCH "^-l(.*)" : $(i) ] ; |
| if $(libname) |
| { |
| |
| |
| |
| |
| |
| |
| |
| |
| external-lib $(libname) : $(cpp-prefix)/lib ; |
| |
| requirements += <library>$(libname)/<link>shared ; |
| |
| } |
| else |
| { |
| requirements += <linkflags>$(i) ; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| rule curlpp ( what ? ) |
| { |
| if $(what) |
| { |
| retval = [ modules.peek curlppvars : $(what) ] ; |
| if $(retval) { return $(retval) ; } |
| } |
| else { return "yes" ; } |
| } |
| } |
| else { rule curlpp { } } |
| } |
|
|
| if [ curlpp ] |
| { |
| local prefix = [ curlpp prefix ] ; |
| local version = [ curlpp version ] ; |
| echo "CULRPP: USING VERSION $(version) FROM $(prefix)" ; |
| } |
|
|