Skip to content

Instantly share code, notes, and snippets.

@yinyin
Last active December 4, 2018 23:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yinyin/54701f8caf3482ba2b125d9b840af32c to your computer and use it in GitHub Desktop.
Save yinyin/54701f8caf3482ba2b125d9b840af32c to your computer and use it in GitHub Desktop.
Set environment variables for autotools
#!/bin/bash
# source ~/bin/env-autotools.sh
OPT_BASE=/opt
which autoreconf
if [ "$?" != "0" ]; then
export PATH=${OPT_BASE}/autoconf-2.69/bin:$PATH
fi
which automake
if [ "$?" != "0" ]; then
export PATH=${OPT_BASE}/automake-1.15/bin:$PATH
fi
which libtoolize
if [ "$?" != "0" ]; then
export PATH=${OPT_BASE}/libtool-2.4.6/bin:$PATH
export ACLOCAL_PATH=${OPT_BASE}/libtool-2.4.6/share/aclocal:$ACLOCAL_PATH
fi
which pkg-config
if [ "$?" != "0" ]; then
export PATH=${OPT_BASE}/pkg-config-0.29.2/bin:$PATH
export PKG_CONFIG_PATH=${OPT_BASE}/pkg-config-data:$PKG_CONFIG_PATH
export ACLOCAL_PATH=${OPT_BASE}/pkg-config-0.29.2/share/aclocal:$ACLOCAL_PATH
fi
export ACLOCAL_PATH=${ACLOCAL_PATH%:}
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH%:}
echo "PATH=${PATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment