about summary refs log tree commit diff
path: root/third_party/nix/config.h.in
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-27T21·03+0100
committerVincent Ambo <tazjin@google.com>2020-05-27T23·11+0100
commit25393d80806f7c7caed188130d3f7c9574e61ece (patch)
tree1b62bd0547eca920a845820c8142a7cc1962b6bb /third_party/nix/config.h.in
parent3d7537da7fbb37cb043eaa28acc7ffade9bec99d (diff)
refactor(3p/nix): Introduce CMake as the build system for Nix r/868
Completes the switch from Meson to CMake for the core build system in
Nix.

Meson was added originally because someone else had already done the
work for integrating it in Nix and it was an upgrade from the previous
setup.

However over time it became clear that Meson is not quite mature
enough for projects like Nix that have occasionally peculiar
configuration constraints.

Some issues encountered with Meson (some of these are due to the Meson
setup in Nix):

* Difficulty with generating correct compile_commands.json for
  external tools like clangd
* Difficulty linking to libc++ when using clang
* Ugly shell invocations for certain parts of the build system (I want
  these to be gone!!!)

This CMake setup mimics the Meson configuration, but there are some
differences (some temporary):

* headers are now included separately for each library (see a previous
  commit that changes includes appropriately)
* autoheaders-style configuration is currently hardcoded. Before
  blindly copying this I want to evaluate how much of it actually exists
  for portability concerns that I don't have (such as support for OS
  X).
* Nix is built with libc++ by default.
* [libstore] SQL schema is now inlined via a generated header, not an
  included string literal

Abseil is still built as part of this build, rather than an external
dependency, because it chokes on differently configured compiler
invocations.

Note that because of the move to libc++ an unwanted behaviour is
introduced: glog log messages no longer have a body. I have yet to
debug what is going on there.
Diffstat (limited to 'third_party/nix/config.h.in')
-rw-r--r--third_party/nix/config.h.in128
1 files changed, 128 insertions, 0 deletions
diff --git a/third_party/nix/config.h.in b/third_party/nix/config.h.in
new file mode 100644
index 000000000000..54855763d238
--- /dev/null
+++ b/third_party/nix/config.h.in
@@ -0,0 +1,128 @@
+// This file configures various build-time settings in Nix. In
+// previous iterations it was mostly responsible for configuring
+// OS-dependent settings, which are still preserved below but should
+// be removed.
+
+#ifndef NIX_CONFIG_H
+#define NIX_CONFIG_H
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.3.4"
+
+/* Platform identifier (`cpu-os`) */
+// TODO(tazjin): generate
+#define SYSTEM "x86_64-linux"
+
+ // TODO(tazjin): some of these values are nonsensical for Nix
+#define NIX_PREFIX "/usr/local"
+#define NIX_STORE_DIR "/nix/store"
+#define NIX_DATA_DIR "/usr/local/share"
+#define NIX_LOG_DIR "/nix/var/log/nix"
+#define NIX_STATE_DIR "/nix/var/nix"
+#define NIX_CONF_DIR "/usr/local/etc/nix"
+#define NIX_LIBEXEC_DIR "/usr/local/libexec"
+#define NIX_BIN_DIR "/usr/local/bin"
+#define NIX_MAN_DIR "/usr/local/share/man"
+#define SANDBOX_SHELL "/nix/store/zq8biwi5mj2lrn68kx0lk0fkpbqypyxd-busybox-1.31.1-x86_64-unknown-linux-musl/bin/busybox"
+
+
+// These are hardcoded either because support for non-Linux is being
+// dropped, or because a decision was made to make inclusion of these
+// libraries mandatory.
+
+#define HAVE_STRUCT_DIRENT_D_TYPE 1
+
+#define HAVE_LUTIMES 1
+
+// Whether link() works on symlinks
+#define CAN_LINK_SYMLINK 1
+
+/* Whether to use the Boehm garbage collector. */
+#define HAVE_BOEHMGC 1
+
+/* Define if the Boost library is available. */
+#define HAVE_BOOST 1
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+#define HAVE_BZLIB_H 1
+
+/* Define if the compiler supports basic C++17 syntax */
+#define HAVE_CXX17 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR` */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR` */
+#define HAVE_DIR_H 1
+
+/* Define to 1 if you have the <editline.h> header file. */
+#define HAVE_EDITLINE_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `lchown` function. */
+#define HAVE_LCHOWN 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE 1
+
+/* Define to 1 if you have the `lutimes` function. */
+#define HAVE_LUTIMES 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `pipe2` function. */
+#define HAVE_PIPE2 1
+
+/* Define to 1 if you have the `posix_fallocate` function. */
+#define HAVE_POSIX_FALLOCATE 1
+
+/* Define to 1 if you have the `pubsetbuf` function. */
+#define HAVE_PUBSETBUF 1
+
+/* Whether seccomp is available and should be used for sandboxing. */
+#define HAVE_SECCOMP 1
+
+/* Define to 1 if you have the `setresuid` function. */
+#define HAVE_SETRESUID 1
+
+/* Define to 1 if you have the `setreuid` function. */
+#define HAVE_SETREUID 1
+
+/* Whether to use libsodium for cryptography. */
+#define HAVE_SODIUM 1
+
+/* Define to 1 if you have the `statvfs` function. */
+#define HAVE_STATVFS 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strsignal` function. */
+#define HAVE_STRSIGNAL 1
+
+/* Define to 1 if you have the `sysconf` function. */
+#define HAVE_SYSCONF 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+
+#endif