|
Boost-Build : |
Subject: Re: [Boost-build] How to implement extra --prefix installation if designated by command line
From: Moritz Hassert (mhassert_at_[hidden])
Date: 2011-06-08 05:57:23
Hi Dmitry,
you could do something like this (untested code written in mail-client!):
local prefix-dir = [ MATCH "^--prefix=(.*)" : [ modules.peek : ARGV ] ] ;
if $(prefix-dir)
{
path-constant PREFIX_DIR : $(prefix-dir) ;
install unicomm_prefix_install
: ### sources
unicomm
: ### requirements
<location>$(PREFIX_DIR)/lib
<install-type>LIB
;
}
else
{
alias unicomm_prefix_install ;
}
alias unicomm_install : unicomm_native_install unicomm_prefix_install ;
[...]
This makes "unicomm_prefix_install" a no-op when no "--prefix" ist given.
Greetings
Moritz
Am Montag, 6. Juni 2011, um 21:22:29 schrieb Dmitry Timoshenko:
> Hello,
>
> There is a library, it's always installed into predefined subfolder, I
> setup this within bjam script.
> It's also wanted to have extra installation but only if --prefix=xx
> parameter is specified.
>
> I realize how to get the parameter, something like this may be:
>
> #-------------------------------------------------------------------------
> local prefix-dir = [ MATCH "^--prefix=(.*)" : [ modules.peek : ARGV ] ] ;
> if $(prefix-dir)
> {
> path-constant PREFIX_DIR : $(prefix-dir) ;
> }
>
> then I would like to declare something like this:
>
> alias unicomm_install : unicomm_native_install [HERE wanted to place
> unicomm_prefix_install if $(PREFIX_DIR) != 0 else NOTHING ] ;
>
> Where unicomm_native_install - is predefined installation,
> install unicomm_native_install
>
> : ### sources
>
> unicomm
>
> : ### requirements
>
> <location>$(UNICOMM_ROOT)/lib
> <install-type>LIB
> ;
>
> and unicomm_prefix_install looks like
>
> install unicomm_prefix_install
>
> : ### sources
>
> unicomm
>
> : ### requirements
>
> <location>$(PREFIX_DIR)/lib
> <install-type>LIB
> ;
>
> How to achieve the goal correcly? It seems I'm wrong with my guess.
>
> It's also interested to know how can I also copy header files?
>
> Thank you.
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
-- -- AB+M GmbH Haid-und-Neu-Straße 7 76131 Karlsruhe Telefon: (0721) 66488-0 Telefax: (0721) 66488-18 Geschaeftsfuehrer: Dipl.-Inform. Christopher Asp Amtsgericht Mannheim HRB 105845 Geschaeftsfuehrer: Dipl.-Inform. Christopher Asp Amtsgericht Mannheim HRB 105845
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk