pocl's build system is influenced by the following environment
variables:

Since pocl is a compiler, it both compiles (producing code) and is
compiled (it consists of code). This distinction typically called
"host" and "target": The host is where pocl is running, the target is
where the OpenCL code will be running. These two systems can be wildly
different.



=== Building pocl itself, i.e. host flags ===

Since pocl extends Clang/LLVM, these flags probably need to be
compatible with the way Clang/LLVM was built. Since Clang/LLVM are
written in C++, this is in particular the case for C++ code. C code is
fairly portable and could be compiled with different settings. Not
that Clang/LLVM may not be built by Clang, but may e.g. be built by
GCC -- in this case, you probably want to use GCC for building pocl as
well.

Note that there are no flags for building OpenCL code. While it would
theoretically be possible to write parts of pocl in OpenCL, it would
be very strange to do so since pocl itself is not running on a device.

Compile C:
   CC
   CPPFLAGS
   CFLAGS

Compile C++:
   CXX
   CXXCPPFLAGS
   CXXFLAGS

Link:
   LD (???)
   LDFLAGS



=== Building kernels and the kernel library, i.e. target flags ===

Since pocl extends Clang for building kernels, and since this heavily
relies on bytecode files, the kernel library needs to be built by
Clang as well. While part of the kernel library is written in OpenCL,
there are other parts written in C, in bytecode, or in C++.

Compile C to bytecode (why are these the same as OpenCL?):
   CLANG
   CLFLAGS (should this be CLANG_CFLAGS instead?)

Compile C++ to bytecode:
   CLANGXX
   CLANGXX_FLAGS (should this be CLANG_CXXFLAGS instead?)

Compile OpenCL to bytecode:
   CLANG
   CLFLAGS (should this be CLANG_CLFLAGS instead?)

Optimize bytecode:
   OPT

Convert bytecode to assembler:
   LLC
   HOST_LLC_FLAGS

Convert assembler to object file:
   CLANG
   HOST_CLANG_FLAGS

Post-process object file:
   LINK_CMD
   HOST_LD_FLAGS

Fine-tune the host CPU:
   LLC_HOST_CPU 
    This overrides LLVM's autodetected host CPU at configure time. The CPU is used
    to fine-tune the host-based devices' ('basic' and 'pthread') kernel code.
    Useful when llc makes a mistake. See 'llvm-as < /dev/null -o - | llc -mcpu=help'
    for valid variables.
    If the host cpu is "(unknown)", then "-march=" is not passed to clang, and 
    "-mcpu=" is not passed to llc.




TARGET_CLANG_FLAGS (???)
