how-lix-os-defaults/default-env.sh

47 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# define some variables that will be useful to package scripts.
# for now, each of these can be overridden by pre-existing variables.
export CC="${CC:-gcc}"
export CXX="g++"
export SHARED_LDFLAGS="${SHARED_LDFLAGS:--z now -z relro}"
export SHARED_CFLAGS="${SHARED_CFLAGS:--fPIC}"
export SHARED_CXXFLAGS="${SHARED_CXXFLAGS:--fPIC}"
export STATIC_LDFLAGS="${STATIC_LDFLAGS:-$SHARED_LDFLAGS --static -static}"
export STATIC_CFLAGS="${STATIC_CFLAGS:-$SHARED_CFLAGS --static -static}"
export STATIC_CXXFLAGS="${STATIC_CXXFLAGS:-$SHARED_CXXFLAGS --static -static}"
export LDFLAGS="${LDFLAGS:-$STATIC_LDFLAGS}"
export CFLAGS="${CFLAGS:-$STATIC_CFLAGS}"
export CXXFLAGS="${CXXFLAGS:-$STATIC_CXXFLAGS}"
export ARCH="$(uname -m)"
export BUILD="$ARCH-lix-linux-musl"
export HOST="$ARCH-lix-linux-musl"
export PREFIX="/usr" # some packages need a prefix; "" doesn't work for them.
if [ -e /etc/ssl/ca-bundle.crt ]; then
export SSL_CERT_FILE=/etc/ssl/ca-bundle.crt
fi
if [ "$(which python3 2> /dev/null)" ]; then
export PY3VER="$(python3 -V | sed -n 's/^Python \(\w\+\.\w\+\).*/\1/p')"
export PY3PKGS="/lib/python$PY3VER/site-packages"
export PYTHONHOME="/usr:/usr"
export PYTHONPATH="/lib/python/$PY3VER:$PY3PKGS"
fi
if [ "$(which pkgconf 2> /dev/null)" ]; then
export PKG_CONFIG="pkgconf"
fi
# TODO: remove the need for these lines by making musl-cross-make build a gcc
# with a header search path of /include only, with all headers contained there.
export CPATH="${CPATH:-/include}"
export C_INCLUDE_PATH="/powerpc64le-lix-linux-musl/include"
export CPLUS_INCLUDE_PATH="/include/c++/9.2.0/powerpc64le-lix-linux-musl:/include/c++/9.2.0"
export LD_LIBRARY_PATH="/lib"
export LD_RUN_PATH="/lib" # sway won't build without this set