2 dnl /*+------------------------------------------------------------------**
3 dnl ** OpenScop Library **
4 dnl **------------------------------------------------------------------**
6 dnl **------------------------------------------------------------------**
7 dnl ** First version: 30/04/2008 **
8 dnl **------------------------------------------------------------------**
11 dnl **************************************************************************
12 dnl * OpenScop: Structures and formats for polyhedral tools to talk together *
13 dnl **************************************************************************
14 dnl * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, *
15 dnl * / / / // // // // / / / // // / / // / /|,_, *
16 dnl * / / / // // // // / / / // // / / // / / / /\ *
17 dnl * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ *
18 dnl * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ *
19 dnl * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ *
20 dnl * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ *
21 dnl * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ *
22 dnl * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ *
23 dnl * | I | | | | e | | | | | | | | | | | | | \ \ \ *
24 dnl * | T | | | | | | | | | | | | | | | | | \ \ \ *
25 dnl * | E | | | | | | | | | | | | | | | | | \ \ \ *
26 dnl * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ *
27 dnl * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / *
28 dnl * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' *
30 dnl * Copyright (C) 2008 University Paris-Sud 11 and INRIA *
32 dnl * (3-clause BSD license) *
33 dnl * Redistribution and use in source and binary forms, with or without *
34 dnl * modification, are permitted provided that the following conditions *
37 dnl * 1. Redistributions of source code must retain the above copyright *
38 dnl * notice, this list of conditions and the following disclaimer. *
39 dnl * 2. Redistributions in binary form must reproduce the above copyright *
40 dnl * notice, this list of conditions and the following disclaimer in the *
41 dnl * documentation and/or other materials provided with the distribution.*
42 dnl * 3. The name of the author may not be used to endorse or promote *
43 dnl * products derived from this software without specific prior written *
46 dnl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
47 dnl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
48 dnl * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
49 dnl * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, *
50 dnl * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
51 dnl * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
52 dnl * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
53 dnl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, *
54 dnl * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING *
55 dnl * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
56 dnl * POSSIBILITY OF SUCH DAMAGE. *
58 dnl * OpenScop Library, a library to manipulate OpenScop formats and data *
59 dnl * structures. Written by: *
60 dnl * Cedric Bastoul <Cedric.Bastoul@u-psud.fr> and *
61 dnl * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr> *
63 dnl **************************************************************************/
65 dnl Input file for autoconf to build a configuration shellscript.
69 dnl Fill here the @bug email adress.
70 AC_INIT([openscop], [0.6.0], [cedric.bastoul@u-psud.fr,pouchet@cse.ohio-state.edu])
71 dnl A common file, which serve as a test.
72 AC_CONFIG_SRCDIR([include/openscop/macros.h])
73 dnl Put as most as possible configuration files to an auxialiry
75 AC_CONFIG_AUX_DIR([autoconf])
76 dnl Initialize automake. Here, a special tar version that enables
77 dnl (very) long filenames.
78 AM_INIT_AUTOMAKE([1.9 tar-ustar no-define foreign dist-bzip2])
85 dnl /**************************************************************************
87 dnl **************************************************************************/
90 dnl Checks for programs.
96 AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
98 dnl Checks for typedefs, structures, and compiler characteristics.
102 dnl Checks for header files.
104 AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
106 dnl Checks for library functions.
107 AC_CHECK_FUNCS(strtol)
110 dnl /**************************************************************************
111 dnl * Option setting *
112 dnl **************************************************************************/
114 dnl Some default values cause I'm not sure whether autoconf set them, while
115 dnl documentation says it does...
117 gmp_include_package="yes"
118 gmp_library_package="yes"
119 gmp_flag="OPENSCOP_GMP_IS_HERE"
123 dnl --with-gmp=gmp-path
125 [ --with-gmp=DIR DIR where the gmp package is installed],
126 [ echo "Package gmp : $withval" &&
127 gmp_package=$withval &&
128 GMP_INC=$gmp_package/include &&
129 GMP_LIB=$gmp_package/lib &&
130 ASKED_FOR_GMP="yes"])
132 AC_ARG_WITH(gmp-include,
133 [ --with-gmp-include=DIR DIR where gmp.h is installed],
134 [ echo "Package gmp-include : $withval" &&
135 gmp_include_package=$withval &&
136 GMP_INC=$gmp_include_package &&
137 ASKED_FOR_GMP="yes"])
139 AC_ARG_WITH(gmp-library,
140 [ --with-gmp-library=DIR DIR where the gmp library is installed],
141 [ echo "Package gmp-library : $withval" &&
142 gmp_library_package=$withval &&
143 GMP_LIB=$gmp_library_package &&
144 ASKED_FOR_GMP="yes"])
147 dnl /**************************************************************************
148 dnl * Where is GMP? *
149 dnl **************************************************************************/
153 AC_MSG_CHECKING(whether gmp works)
154 if test "$gmp_package" = "no"; then
155 echo "GMP package not defined"
158 if test "$ASKED_FOR_GMP" = "no"; then
159 echo "Mode normal GMP"
160 AC_CHECK_HEADER(gmp.h,
163 [LIBS="$LIBS -lgmp" &&
164 CPPFLAGS="-D$gmp_flag $CPPFLAGS"],
165 [echo "Cannot find gmp library." &&
166 echo "MP precision will not be supported."])],
167 [echo "Can't find gmp headers." &&
168 echo "MP precision will not be supported."])
170 dnl Default given by --with-X is "yes", --without-X is "no". We also
171 dnl initialized manually all gmp_package* variables to "yes" (thus they are
172 dnl supposed to be "yes" except if the user set them himself).
174 if test "$gmp_package" != "yes" ; then
175 echo "(GMP path has been set by user)"
177 CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
178 LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
181 if test "$gmp_include_package" != "yes" ; then
182 CPPFLAGS="-I$GMP_INC $CPPFLAGS"
185 if test "$gmp_library_package" != "yes" ; then
186 LDFLAGS="-L$GMP_LIB $LDFLAGS"
189 AC_CHECK_HEADER(gmp.h,
191 [AC_MSG_ERROR("Cannot find gmp headers.")])
194 [LIBS="$LIBS -lgmp" &&
195 CPPFLAGS="-D$gmp_flag $CPPFLAGS"],
196 [AC_MSG_ERROR("Cannot find gmp library.")])
203 dnl /**************************************************************************
204 dnl * Substitutions *
205 dnl **************************************************************************/
208 dnl Substitutions to do.
212 dnl Configure Makefiles.
218 include/openscop/scop.h
222 [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
227 echo " /*-----------------------------------------------*"
228 echo " * OpenScop Library configuration is OK *"
229 echo " *-----------------------------------------------*/"
230 echo "It appears that your system is OK to start the OpenScop Library compilation."
231 echo "You need now to type \"make\". Then type \"make install\" to install it on your"
232 echo "system (log as root if necessary)."