Permalink
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
Cannot retrieve contributors at this time
# -*- Autoconf -*- | |
# Process this file with autoconf to produce a configure script. | |
AC_PREREQ([2.69]) | |
AC_INIT([graphpass], [0.0.1], [ryan.deschamps@gmail.com]) | |
AC_COPYRIGHT([Ryan Deschamps 2018, Apache License 2.0]) | |
AC_CONFIG_SRCDIR([graphpass.c]) | |
#AC_CONFIG_HEADERS([config.h]) | |
# Checks for programs. | |
AC_PROG_CC | |
# Checks for libraries. | |
AC_CHECK_LIB([libxml2], [xmlNewTextWriter], [], [ | |
echo "No libxml2, needed to import Graphml..." | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
sudo apt-get install libxml2-dev build-essential | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
echo "libxml is supposed to come with OSX. Something is wrong." | |
exit -1 | |
else | |
echo "unknown problem installing libxml, required for system." | |
exit -1 | |
fi | |
]) | |
AC_CHECK_LIB([igraph], [igraph_hub_score],[ | |
echo "found igraph, which is required for graphpass"], [ | |
echo "this program requires igraph 0.7.1. Getting..." | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
wget http://igraph.org/nightly/get/c/igraph-0.7.1.tar.gz | |
tar -xvzf igraph-0.7.1.tar.gz | |
cd igraph-0.7.1 | |
./configure | |
make | |
sudo make install | |
sudo ldconfig | |
cd .. | |
echo "cleaning up... " | |
rm igraph-0.7.1.tar.gz | |
rm -rf igraph-0.7.1 | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
if [[which brew == "/usr/local/bin/brew"]]; then | |
brew install igraph | |
else | |
echo "Problem installing igraph. You may need to do this manually." | |
echo "See http://igraph.org/c/ for instructions, if installation fails." | |
echo "Or install igraph with homebrew using: brew install igraph" | |
wget http://igraph.org/nightly/get/c/igraph-0.7.1.tar.gz | |
tar -xvzf igraph-0.7.1.tar.gz | |
cd igraph-0.7.1 | |
./configure | |
make | |
sudo make install | |
sudo ldconfig | |
cd .. | |
echo "cleaning up... " | |
rm igraph-0.7.1.tar.gz | |
rm -rf igraph-0.7.1 | |
fi | |
else | |
echo "Graphpass is only configured for OSX and Linux systems." | |
echo "It is possible to install Graphpass on Windows, but it would" | |
echo "require some manual configuration work." | |
exit -1 | |
fi | |
]) | |
AC_CHECK_LIB([m], [main]) | |
# Checks for header files. | |
AC_CHECK_HEADERS([limits.h stddef.h stdint.h stdlib.h string.h unistd.h]) | |
# Checks for typedefs, structures, and compiler characteristics. | |
AC_CHECK_HEADER_STDBOOL | |
# Checks for library functions. | |
AC_FUNC_MALLOC | |
AC_CHECK_FUNCS([mkdir sqrt]) | |
AC_CONFIG_FILES([Docs/latex/Makefile | |
Makefile]) | |
AC_OUTPUT | |
AM_INIT_AUTOMAKE([graphpass], [0.0.1]) |