.. _packaging-guidelines: Packaging guidelines ==================== Hare depends on a POSIX-compatible C11 environment, and our compiler backend, `qbe `_. To provide the minimum level of support for Hare, you need at least qbe, `harec `_, and `hare `_ packages. Your distro's packages are our preferred means for users to install Hare and programs written in Hare. Your support is important to us. Please :ref:`reach out to us ` if you have any questions. Hare installation layout ------------------------ Assuming a typical Unix filesystem layout (you can configure this in config.mk if you need something different), Hare expects to be installed in the following places: - */usr/bin/hare*: The Hare build driver - */usr/bin/harec*: The Hare compiler - */usr/bin/haredoc*: The Hare documentation tool - */usr/src/hare/stdlib*: The standard library source code - */usr/src/hare/third-party*: Third-party library source code The source code for Hare dependencies must be present to build Hare packages or read their documentation. Timekeeping requirements ------------------------ Hare's timekeeping support in the standard library relies on a local installation of the IANA time zone database. .. warning:: Hare uses the local leap second list, located at ``/usr/share/zoneinfo/leap-seconds.list`` by default, which is often not installed by many distributions. Please update your tzdata package accordingly when packaging Hare. Customizing the toolchain ------------------------- You should provide a ``config.mk`` file suitable for your distribution for the "hare" package (i.e. the stdlib et al) which configures the default values for the toolchain as appropriate for your distribution. For each supported architecture, set e.g. ``AARCH64_AS`` to the appropriate binary name. For the native host, you will presumably use simply ``as``, ``ld``, and so on; for cross compiling you will provide something like ``aarch64-linux-gnu-as`` (assuming your distribution provides cross compilers). Once packaged, the build driver will use the toolchains configured by ``config.mk`` by default, but on a per-build basis this can be overridden with the standard LD, AS, and similar environment variables. If linking with libc, LDFLAGS are passed to the C compiler; if not, LDLINKFLAGS are passed to the linker. Hare programs are usually statically linked. We know you're not a fan of this. We're sorry. Linking to native dependencies ------------------------------ See :ref:`cffi`. Was your question not answered? ------------------------------- Please reach out and we'd be happy to help.