summaryrefslogtreecommitdiff
path: root/cloog-0.17.0/osl/configure.in
blob: 9440bbb3cb131033410d5d06beaac4c551367ac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
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)."