blob: 9440bbb3cb131033410d5d06beaac4c551367ac1 [file] [log] [blame]
dnl
dnl /*+------------------------------------------------------------------**
dnl ** OpenScop Library **
dnl **------------------------------------------------------------------**
dnl ** configure.in **
dnl **------------------------------------------------------------------**
dnl ** First version: 30/04/2008 **
dnl **------------------------------------------------------------------**
dnl
dnl
dnl **************************************************************************
dnl * OpenScop: Structures and formats for polyhedral tools to talk together *
dnl **************************************************************************
dnl * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, *
dnl * / / / // // // // / / / // // / / // / /|,_, *
dnl * / / / // // // // / / / // // / / // / / / /\ *
dnl * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ *
dnl * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ *
dnl * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ *
dnl * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ *
dnl * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ *
dnl * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ *
dnl * | I | | | | e | | | | | | | | | | | | | \ \ \ *
dnl * | T | | | | | | | | | | | | | | | | | \ \ \ *
dnl * | E | | | | | | | | | | | | | | | | | \ \ \ *
dnl * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ *
dnl * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / *
dnl * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' *
dnl * *
dnl * Copyright (C) 2008 University Paris-Sud 11 and INRIA *
dnl * *
dnl * (3-clause BSD license) *
dnl * Redistribution and use in source and binary forms, with or without *
dnl * modification, are permitted provided that the following conditions *
dnl * are met: *
dnl * *
dnl * 1. Redistributions of source code must retain the above copyright *
dnl * notice, this list of conditions and the following disclaimer. *
dnl * 2. Redistributions in binary form must reproduce the above copyright *
dnl * notice, this list of conditions and the following disclaimer in the *
dnl * documentation and/or other materials provided with the distribution.*
dnl * 3. The name of the author may not be used to endorse or promote *
dnl * products derived from this software without specific prior written *
dnl * permission. *
dnl * *
dnl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
dnl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
dnl * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
dnl * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, *
dnl * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
dnl * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
dnl * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
dnl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, *
dnl * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING *
dnl * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
dnl * POSSIBILITY OF SUCH DAMAGE. *
dnl * *
dnl * OpenScop Library, a library to manipulate OpenScop formats and data *
dnl * structures. Written by: *
dnl * Cedric Bastoul <Cedric.Bastoul@u-psud.fr> and *
dnl * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr> *
dnl * *
dnl **************************************************************************/
dnl
dnl Input file for autoconf to build a configuration shellscript.
AC_PREREQ(2.13)
dnl Fill here the @bug email adress.
AC_INIT([osl], [0.8.1], [cedric.bastoul@u-psud.fr,pouchet@cse.ohio-state.edu])
dnl A common file, which serve as a test.
AC_CONFIG_SRCDIR([include/osl/macros.h])
dnl Put as most as possible configuration files to an auxialiry
dnl directory.
AC_CONFIG_AUX_DIR([autoconf])
dnl Initialize automake. Here, a special tar version that enables
dnl (very) long filenames.
AM_INIT_AUTOMAKE([1.9 tar-ustar no-define foreign dist-bzip2])
dnl /**************************************************************************
dnl * Checking *
dnl **************************************************************************/
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG(CD, cd)
AC_PROG_LIBTOOL
AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)
dnl /**************************************************************************
dnl * Option setting *
dnl **************************************************************************/
dnl Some default values cause I'm not sure whether autoconf set them, while
dnl documentation says it does...
gmp_package="yes"
gmp_include_package="yes"
gmp_library_package="yes"
gmp_flag="OSL_GMP_IS_HERE"
ASKED_FOR_GMP="no"
dnl --with-gmp=gmp-path
AC_ARG_WITH(gmp,
[ --with-gmp=DIR DIR where the gmp package is installed],
[ echo "Package gmp : $withval" &&
gmp_package=$withval &&
GMP_INC=$gmp_package/include &&
GMP_LIB=$gmp_package/lib &&
ASKED_FOR_GMP="yes"])
AC_ARG_WITH(gmp-include,
[ --with-gmp-include=DIR DIR where gmp.h is installed],
[ echo "Package gmp-include : $withval" &&
gmp_include_package=$withval &&
GMP_INC=$gmp_include_package &&
ASKED_FOR_GMP="yes"])
AC_ARG_WITH(gmp-library,
[ --with-gmp-library=DIR DIR where the gmp library is installed],
[ echo "Package gmp-library : $withval" &&
gmp_library_package=$withval &&
GMP_LIB=$gmp_library_package &&
ASKED_FOR_GMP="yes"])
dnl /**************************************************************************
dnl * Where is GMP? *
dnl **************************************************************************/
dnl Checking for gmp
AC_MSG_CHECKING(whether gmp works)
if test "$gmp_package" = "no"; then
echo "GMP package not defined"
AC_MSG_RESULT(no)
else
if test "$ASKED_FOR_GMP" = "no"; then
echo "Mode normal GMP"
AC_CHECK_HEADER(gmp.h,
[AC_CHECK_LIB(gmp,
__gmpz_init,
[LIBS="$LIBS -lgmp" &&
CPPFLAGS="-D$gmp_flag $CPPFLAGS"],
[echo "Cannot find gmp library." &&
echo "MP precision will not be supported."])],
[echo "Can't find gmp headers." &&
echo "MP precision will not be supported."])
else
dnl Default given by --with-X is "yes", --without-X is "no". We also
dnl initialized manually all gmp_package* variables to "yes" (thus they are
dnl supposed to be "yes" except if the user set them himself).
if test "$gmp_package" != "yes" ; then
echo "(GMP path has been set by user)"
GMP_DIR=$gmp_package
CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
fi
if test "$gmp_include_package" != "yes" ; then
CPPFLAGS="-I$GMP_INC $CPPFLAGS"
fi
if test "$gmp_library_package" != "yes" ; then
LDFLAGS="-L$GMP_LIB $LDFLAGS"
fi
AC_CHECK_HEADER(gmp.h,
[],
[AC_MSG_ERROR("Cannot find gmp headers.")])
AC_CHECK_LIB(gmp,
__gmpz_init,
[LIBS="$LIBS -lgmp" &&
CPPFLAGS="-D$gmp_flag $CPPFLAGS"],
[AC_MSG_ERROR("Cannot find gmp library.")])
AC_MSG_RESULT(yes)
fi
fi
dnl /**************************************************************************
dnl * Substitutions *
dnl **************************************************************************/
dnl Substitutions to do.
AC_SUBST(ac_aux_dir)
dnl Configure Makefiles.
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/Doxyfile
include/Makefile
include/osl/scop.h
source/Makefile
tests/Makefile
],
[test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
AC_OUTPUT
echo " /*-----------------------------------------------*"
echo " * OpenScop Library configuration is OK *"
echo " *-----------------------------------------------*/"
echo "It appears that your system is OK to start the OpenScop Library compilation."
echo "You need now to type \"make\". Then type \"make install\" to install it on your"
echo "system (log as root if necessary)."