dnl -*- Autoconf -*- fragment for the C++ daemon. AC_MSG_CHECKING([whether to build daemon]) AC_MSG_RESULT([$guix_build_daemon]) dnl C++ environment. This macro must be used unconditionnaly. AC_PROG_CXX AM_PROG_AR AC_LANG([C++]) if test "x$guix_build_daemon" = "xyes"; then GUIX_ASSERT_CXX11 AC_PROG_RANLIB AC_CONFIG_HEADERS([nix/config.h]) dnl Use 64-bit file system calls so that we can support files > 2 GiB. AC_SYS_LARGEFILE dnl Look for zlib, a required dependency. AC_CHECK_LIB([z], [gzdopen], [true], [AC_MSG_ERROR([Guix requires zlib. See http://www.zlib.net/.])]) AC_CHECK_HEADERS([zlib.h], [true], [AC_MSG_ERROR([Guix requires zlib. See http://www.zlib.net/.])]) dnl Look for libbz2, an optional dependency. AC_CHECK_LIB([bz2], [BZ2_bzWriteOpen], [HAVE_LIBBZ2=yes], [HAVE_LIBBZ2=no]) if test "x$HAVE_LIBBZ2" = xyes; then AC_CHECK_HEADERS([bzlib.h]) HAVE_LIBBZ2="$ac_cv_header_bzlib_h" fi dnl Look for SQLite, a required dependency. PKG_CHE
aboutsummaryrefslogtreecommitdiff
#!/bin/sh

# GNU Guix --- Functional package management for GNU
# Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2017 Eric Bavier <bavier@cray.com>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

# Usage: ./pre-inst-env COMMAND ARG...
#
# Run COMMAND in a pre-installation environment.  Typical use is
# "./pre-inst-env guix build hello".

# By default we may end up with absolute directory names that contain '..',
# which get into $GUILE_LOAD_PATH, leading to '..' in the module file names
# recorded by Guile.  To avoid that, make sure we get a real absolute
# directory name.  Additionally, use '-P' to get the canonical directory name
# so that Guile's 'relative' %file-port-name-canonicalization can actually
# work (see <http://bugs.gnu.org/17935>.)
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`"
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`"

GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH

# Define $PATH so that `guix' and friends are easily found.

PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
export PATH

# The daemon invokes 'guix'; tell it which one to use.
GUIX="$abs_top_builddir/scripts/guix"
export GUIX

# Define $GUIX_UNINSTALLED to prevent `guix' from
# prepending @guilemoduledir@ to the Guile load paths.

GUIX_UNINSTALLED=1
export GUIX_UNINSTALLED

exec "$@"