<div dir="ltr">Thanks! That answers my last high-level build2 question for now. I'm gonna see if I can make a JUCE package...<br><div><br></div><div>Off-topic now: I'll be looking at existing bpkgs to see how they handle native libraries. Comment and question:<br><br>Comment: the src-url of <a href="https://cppget.org/libodb" target="_blank">https://cppget.org/libodb</a> is broken (<a href="https://git.codesynthesis.com/cgit/?p=odb/libodb.git;a=tree" target="_blank">https://git.codesynthesis.<wbr>com/cgit/?p=odb/libodb.git;a=<wbr>tree</a> says 'invalid request')<br><br></div><div>Question: if package A depends on a semi-popular package B being installed (e.g. libcurl, webkit, gtk headers on Linux), is it ever preferable for package B to be a bpkg too?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 6, 2017 at 3:34 PM, Boris Kolpackov <span dir="ltr"><<a href="mailto:boris@codesynthesis.com" target="_blank">boris@codesynthesis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Joshua Olson <<a href="mailto:0joshua.olson1@gmail.com" target="_blank">0joshua.olson1@gmail.com</a>> writes:<br>
<br>
> To rephrase, can the build system extract macros from a project's source,<br>
> whether that means printing a list, making a config header. or something<br>
> else? Or is that out of scope for now?<br>
><br>
> I imagine one could look for #ifdef, #ifndef, and all-caps identifiers, but<br>
> almost anything could be changed a la -D define flags so there's no<br>
> completely 'correct' way to do this.<br>
<br>
Yes, to handle this automatically will require quite a bit of magic.<br>
<br>
Generally, when porting an existing project to build2 we use the<br>
following procedure:<br>
<br>
1. Identify how the existing build system communicates configuration<br>
   to the source code. This is usually in the form of preprocessor<br>
   macros either via a configuration files (e.g., config.h) and/or<br>
   command line (e.g., -D options).<br>
<br>
2. If necessary, narrow down the above set of macros to the actually<br>
   used ones. This is necessary if the build system has a "kitchen<br>
   sink" configuration file, like autotools-based projects often do.<br>
<br>
   The way we achieve this is by grepping the project's source code<br>
   for the use of each macro. We also use this as an opportunity to<br>
   understand the exact meaning of each macro (which is  not always<br>
   evident from #1).<br>
<br>
3. Appropriately define each macro when building with build2. This<br>
   can done either via the command line (-D) from buildfiles or<br>
   from a configuration file.<br>
<br>
   In our work we try hard to come up with what we call a "static<br>
   configuration file". It determines the configuration based on<br>
   predefined macros for the target compiler/platform/standard<br>
   library as opposed to, say, running some compilation tests<br>
   like autoconf.<br>
<br>
   In the future we also plan to support generating configuration<br>
   files from .in templates.<br>
<br>
You can see some examples of real libraries that we have converted<br>
here:<br>
<br>
<a href="https://git.build2.org/cgit/packaging/" rel="noreferrer" target="_blank">https://git.build2.org/cgit/pa<wbr>ckaging/</a><br>
<span class="m_1796758961944277920HOEnZb"><font color="#888888"><br>
Boris<br>
</font></span></blockquote></div><br></div></div>