comparison m4/acinclude.m4 @ 17034:8d84dc5f5b5d

acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR. Alphebetize macro list. Remove needless whitespace at end of lines. * m4/acinclude.m4: Use m4 quote '[' rather than '"' in AC_MSG_ERROR. Alphebetize macro list. Remove needless whitespace at end of lines.
author Rik <rik@octave.org>
date Sun, 21 Jul 2013 20:16:03 -0700
parents 38bcfd413db0
children bb713af2e1d9
comparison
equal deleted inserted replaced
17033:02679492b0c6 17034:8d84dc5f5b5d
1 dnl aclocal.m4 -- extra macros for configuring Octave 1 dnl aclocal.m4 -- extra macros for configuring Octave
2 dnl 2 dnl
3 dnl Copyright (C) 1995-2012 John W. Eaton 3 dnl Copyright (C) 1995-2012 John W. Eaton
4 dnl 4 dnl
5 dnl This file is part of Octave. 5 dnl This file is part of Octave.
6 dnl 6 dnl
7 dnl Octave is free software; you can redistribute it and/or modify it 7 dnl Octave is free software; you can redistribute it and/or modify it
8 dnl under the terms of the GNU General Public License as published by the 8 dnl under the terms of the GNU General Public License as published by the
9 dnl Free Software Foundation; either version 3 of the License, or (at 9 dnl Free Software Foundation; either version 3 of the License, or (at
10 dnl your option) any later version. 10 dnl your option) any later version.
11 dnl 11 dnl
12 dnl Octave is distributed in the hope that it will be useful, but WITHOUT 12 dnl Octave is distributed in the hope that it will be useful, but WITHOUT
13 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 dnl for more details. 15 dnl for more details.
16 dnl 16 dnl
17 dnl You should have received a copy of the GNU General Public License 17 dnl You should have received a copy of the GNU General Public License
18 dnl along with Octave; see the file COPYING. If not, see 18 dnl along with Octave; see the file COPYING. If not, see
19 dnl <http://www.gnu.org/licenses/>. 19 dnl <http://www.gnu.org/licenses/>.
20 dnl 20 dnl
21 dnl 21 dnl
82 CFLAGS="$ac_octave_save_CFLAGS" 82 CFLAGS="$ac_octave_save_CFLAGS"
83 AC_LANG_POP(C) 83 AC_LANG_POP(C)
84 ]) 84 ])
85 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then 85 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
86 AC_MSG_RESULT([yes]) 86 AC_MSG_RESULT([yes])
87 ifelse([$2], , 87 ifelse([$2], ,
88 [CFLAGS="$CFLAGS $1" 88 [CFLAGS="$CFLAGS $1"
89 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2]) 89 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2])
90 else 90 else
91 AC_MSG_RESULT([no]) 91 AC_MSG_RESULT([no])
92 ifelse([$3], , , [$3]) 92 ifelse([$3], , , [$3])
145 ]) 145 ])
146 dnl 146 dnl
147 dnl Check whether a math mapper function is available in <cmath>. 147 dnl Check whether a math mapper function is available in <cmath>.
148 dnl Will define HAVE_CMATH_FUNC if there is a double variant and 148 dnl Will define HAVE_CMATH_FUNC if there is a double variant and
149 dnl HAVE_CMATH_FUNCF if there is a float variant. 149 dnl HAVE_CMATH_FUNCF if there is a float variant.
150 dnl Currently capable of checking for functions with single 150 dnl Currently capable of checking for functions with single
151 dnl argument and returning bool/int/real. 151 dnl argument and returning bool/int/real.
152 dnl 152 dnl
153 AC_DEFUN([OCTAVE_CHECK_FUNC_CMATH], [ 153 AC_DEFUN([OCTAVE_CHECK_FUNC_CMATH], [
154 ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'` 154 ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'`
155 155
240 print *, 'y is NaN' 240 print *, 'y is NaN'
241 end if 241 end if
242 end program 242 end program
243 ]], 243 ]],
244 octave_cv_func_fortran_isnan=yes, octave_cv_func_fortran_isnan=no) 244 octave_cv_func_fortran_isnan=yes, octave_cv_func_fortran_isnan=no)
245 AC_LANG_POP(Fortran 77) 245 AC_LANG_POP(Fortran 77)
246 ]) 246 ])
247 ]) 247 ])
248 dnl 248 dnl
249 dnl Check if function gluTessCallback is called with "(...)". 249 dnl Check if function gluTessCallback is called with "(...)".
250 dnl 250 dnl
265 octave_cv_func_glutesscallback_threedots=yes, 265 octave_cv_func_glutesscallback_threedots=yes,
266 octave_cv_func_glutesscallback_threedots=no) 266 octave_cv_func_glutesscallback_threedots=no)
267 AC_LANG_POP(C++) 267 AC_LANG_POP(C++)
268 ]) 268 ])
269 if test $octave_cv_func_glutesscallback_threedots = yes; then 269 if test $octave_cv_func_glutesscallback_threedots = yes; then
270 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, 270 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1,
271 [Define to 1 if gluTessCallback is called with (...).]) 271 [Define to 1 if gluTessCallback is called with (...).])
272 fi 272 fi
273 ]) 273 ])
274 dnl 274 dnl
275 dnl Check whether Qscintilla SetPlaceholderText function exists. 275 dnl Check whether Qscintilla SetPlaceholderText function exists.
293 octave_cv_func_setplaceholdertext=no) 293 octave_cv_func_setplaceholdertext=no)
294 CPPFLAGS="$ac_octave_save_CPPFLAGS" 294 CPPFLAGS="$ac_octave_save_CPPFLAGS"
295 AC_LANG_POP(C++) 295 AC_LANG_POP(C++)
296 ]) 296 ])
297 if test $octave_cv_func_setplaceholdertext = yes; then 297 if test $octave_cv_func_setplaceholdertext = yes; then
298 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1, 298 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1,
299 [Define to 1 if you have the Qt SetPlaceholderText function.]) 299 [Define to 1 if you have the Qt SetPlaceholderText function.])
300 fi 300 fi
301 ]) 301 ])
302 dnl 302 dnl
303 dnl Check whether HDF5 library has version 1.6 API functions. 303 dnl Check whether HDF5 library has version 1.6 API functions.
468 ip[6] = 1; // mode 468 ip[6] = 1; // mode
469 ip[7] = 0; // ip[7] to ip[10] are return values 469 ip[7] = 0; // ip[7] to ip[10] are return values
470 ip[8] = 0; 470 ip[8] = 0;
471 ip[9] = 0; 471 ip[9] = 0;
472 ip[10] = 0; 472 ip[10] = 0;
473 473
474 int *ipntr = new int [14]; 474 int *ipntr = new int [14];
475 475
476 int k = 1; 476 int k = 1;
477 int p = 3; 477 int p = 3;
478 int lwork = 3 * p * (p + 2); 478 int lwork = 3 * p * (p + 2);
484 int ido = 0; 484 int ido = 0;
485 int info = 0; 485 int info = 0;
486 486
487 double tol = DBL_EPSILON; 487 double tol = DBL_EPSILON;
488 488
489 do 489 do
490 { 490 {
491 F77_FUNC (dnaupd, DNAUPD) (ido, "I", n, "LM", k, tol, resid, p, 491 F77_FUNC (dnaupd, DNAUPD) (ido, "I", n, "LM", k, tol, resid, p,
492 v, n, ip, ipntr, workd, workl, lwork, 492 v, n, ip, ipntr, workd, workl, lwork,
493 info, 1L, 2L); 493 info, 1L, 2L);
494 494
507 return; // Error 507 return; // Error
508 } 508 }
509 509
510 break; 510 break;
511 } 511 }
512 } 512 }
513 while (1); 513 while (1);
514 514
515 int *sel = new int [p]; 515 int *sel = new int [p];
516 516
517 // In Octave, the dimensions of dr and di are k+1, but k+2 avoids segfault 517 // In Octave, the dimensions of dr and di are k+1, but k+2 avoids segfault
650 #if defined (HAVE_GL_GL_H) 650 #if defined (HAVE_GL_GL_H)
651 # include <GL/gl.h> 651 # include <GL/gl.h>
652 #elif defined (HAVE_OPENGL_GL_H) 652 #elif defined (HAVE_OPENGL_GL_H)
653 # include <OpenGL/gl.h> 653 # include <OpenGL/gl.h>
654 #endif 654 #endif
655 ]], [[ 655 ]], [[
656 glEnable(GL_SMOOTH); 656 glEnable(GL_SMOOTH);
657 ]])], [OPENGL_LIBS="-lopengl32 -lglu32"]) 657 ]])], [OPENGL_LIBS="-lopengl32 -lglu32"])
658 658
659 LIBS="$save_LIBS" 659 LIBS="$save_LIBS"
660 if test "x$OPENGL_LIBS" != "x"; then 660 if test "x$OPENGL_LIBS" != "x"; then
713 ]], [[ 713 ]], [[
714 int dim = 2; 714 int dim = 2;
715 int n = 4; 715 int n = 4;
716 coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 }; 716 coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 };
717 boolT ismalloc = 0; 717 boolT ismalloc = 0;
718 return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); 718 return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr);
719 ]])], 719 ]])],
720 octave_cv_lib_qhull_ok=yes, 720 octave_cv_lib_qhull_ok=yes,
721 octave_cv_lib_qhull_ok=no, 721 octave_cv_lib_qhull_ok=no,
722 octave_cv_lib_qhull_ok=yes) 722 octave_cv_lib_qhull_ok=yes)
723 ]) 723 ])
738 AC_SEARCH_LIBS([tputs], 738 AC_SEARCH_LIBS([tputs],
739 [ncurses curses termcap terminfo termlib], 739 [ncurses curses termcap terminfo termlib],
740 [], []) 740 [], [])
741 LIBS="$ac_octave_save_LIBS" 741 LIBS="$ac_octave_save_LIBS"
742 case "$ac_cv_search_tputs" in 742 case "$ac_cv_search_tputs" in
743 -l*) 743 -l*)
744 TERM_LIBS="$ac_cv_search_tputs" 744 TERM_LIBS="$ac_cv_search_tputs"
745 ;; 745 ;;
746 no) 746 no)
747 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!" 747 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!"
748 AC_MSG_WARN([$warn_termlibs]) 748 AC_MSG_WARN([$warn_termlibs])
774 #include <omp.h> 774 #include <omp.h>
775 #include <stdio.h> 775 #include <stdio.h>
776 ]], [[ 776 ]], [[
777 int main(int argc, char* argv[]) 777 int main(int argc, char* argv[])
778 { 778 {
779 _Pragma("omp parallel") 779 _Pragma("omp parallel")
780 printf("Hello, world.\n"); 780 printf("Hello, world.\n");
781 return 0; 781 return 0;
782 } 782 }
783 ]])], 783 ]])],
784 octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no) 784 octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no)
826 # include <poly.h> 826 # include <poly.h>
827 # include <io.h> 827 # include <io.h>
828 #endif 828 #endif
829 ]], [[ 829 ]], [[
830 const char *tmp = qh_version; 830 const char *tmp = qh_version;
831 ]])], 831 ]])],
832 octave_cv_lib_qhull_version=yes, octave_cv_lib_qhull_version=no) 832 octave_cv_lib_qhull_version=yes, octave_cv_lib_qhull_version=no)
833 ]) 833 ])
834 if test $octave_cv_lib_qhull_version = no; then 834 if test $octave_cv_lib_qhull_version = no; then
835 AC_DEFINE(NEED_QHULL_VERSION, 1, 835 AC_DEFINE(NEED_QHULL_VERSION, 1,
836 [Define to 1 if the Qhull library needs a qh_version variable defined.]) 836 [Define to 1 if the Qhull library needs a qh_version variable defined.])
996 ]])], 996 ]])],
997 octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no) 997 octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no)
998 AC_LANG_POP(C++) 998 AC_LANG_POP(C++)
999 ]) 999 ])
1000 if test $octave_cv_cxx_complex_setters = yes; then 1000 if test $octave_cv_cxx_complex_setters = yes; then
1001 AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1, 1001 AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1,
1002 [Define to 1 if C++ complex class has void real (T) and void imag (T) methods.]) 1002 [Define to 1 if C++ complex class has void real (T) and void imag (T) methods.])
1003 fi 1003 fi
1004 ]) 1004 ])
1005 dnl 1005 dnl
1006 dnl Check if the compiler supports dynamic auto arrays. 1006 dnl Check if the compiler supports dynamic auto arrays.
1013 void test(char *); 1013 void test(char *);
1014 int length(); 1014 int length();
1015 char x[length()]; 1015 char x[length()];
1016 test(x); 1016 test(x);
1017 ]])], 1017 ]])],
1018 octave_cv_cxx_dynamic_auto_arrays=yes, 1018 octave_cv_cxx_dynamic_auto_arrays=yes,
1019 octave_cv_cxx_dynamic_auto_arrays=no) 1019 octave_cv_cxx_dynamic_auto_arrays=no)
1020 AC_LANG_POP(C++) 1020 AC_LANG_POP(C++)
1021 ]) 1021 ])
1022 if test $octave_cv_cxx_dynamic_auto_arrays = yes; then 1022 if test $octave_cv_cxx_dynamic_auto_arrays = yes; then
1023 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS, 1, 1023 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS, 1,
1085 octave_cv_cxx_iso_compliant_library=no) 1085 octave_cv_cxx_iso_compliant_library=no)
1086 AC_LANG_POP(C++) 1086 AC_LANG_POP(C++)
1087 ]) 1087 ])
1088 AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library]) 1088 AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library])
1089 if test $octave_cv_cxx_iso_compliant_library = yes; then 1089 if test $octave_cv_cxx_iso_compliant_library = yes; then
1090 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, 1090 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1,
1091 [Define to 1 if your C++ runtime library is ISO compliant.]) 1091 [Define to 1 if your C++ runtime library is ISO compliant.])
1092 fi 1092 fi
1093 ]) 1093 ])
1094 dnl 1094 dnl
1095 dnl Check if C++ compiler needs the new friend template declaration 1095 dnl Check if C++ compiler needs the new friend template declaration
1096 dnl syntax. 1096 dnl syntax.
1097 dnl 1097 dnl
1098 AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [ 1098 AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [
1099 AC_REQUIRE([AC_PROG_CXX]) 1099 AC_REQUIRE([AC_PROG_CXX])
1100 AC_MSG_CHECKING([for C++ support for new friend template declaration]) 1100 AC_MSG_CHECKING([for C++ support for new friend template declaration])
1101 AC_CACHE_VAL([octave_cv_cxx_new_friend_template_decl], 1101 AC_CACHE_VAL([octave_cv_cxx_new_friend_template_decl],
1139 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1139 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1140 #include <new> 1140 #include <new>
1141 ]], [[ 1141 ]], [[
1142 operator delete((void *)0, (void *)0); 1142 operator delete((void *)0, (void *)0);
1143 ]])], 1143 ]])],
1144 octave_cv_cxx_placement_delete=yes, 1144 octave_cv_cxx_placement_delete=yes,
1145 octave_cv_cxx_placement_delete=no) 1145 octave_cv_cxx_placement_delete=no)
1146 AC_LANG_POP(C++) 1146 AC_LANG_POP(C++)
1147 ]) 1147 ])
1148 if test $octave_cv_cxx_placement_delete = yes; then 1148 if test $octave_cv_cxx_placement_delete = yes; then
1149 AC_DEFINE(HAVE_PLACEMENT_DELETE, 1, 1149 AC_DEFINE(HAVE_PLACEMENT_DELETE, 1,
1228 [octave_cv_fast_int_ops], 1228 [octave_cv_fast_int_ops],
1229 [AC_LANG_PUSH(C++) 1229 [AC_LANG_PUSH(C++)
1230 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 1230 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1231 #include <limits> 1231 #include <limits>
1232 template<class UT, class ST> 1232 template<class UT, class ST>
1233 static bool 1233 static bool
1234 do_test (UT, ST) 1234 do_test (UT, ST)
1235 { 1235 {
1236 volatile ST s = std::numeric_limits<ST>::min () / 3; 1236 volatile ST s = std::numeric_limits<ST>::min () / 3;
1237 volatile UT u = static_cast<UT> (s); 1237 volatile UT u = static_cast<UT> (s);
1238 if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true; 1238 if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true;
1239 1239
1240 u = 0; u = ~u; 1240 u = 0; u = ~u;
1241 if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true; 1241 if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true;
1242 1242
1243 ST sx, sy; 1243 ST sx, sy;
1244 sx = std::numeric_limits<ST>::max () / 2 + 1; 1244 sx = std::numeric_limits<ST>::max () / 2 + 1;
1245 sy = std::numeric_limits<ST>::max () / 2 + 2; 1245 sy = std::numeric_limits<ST>::max () / 2 + 2;
1246 if (static_cast<ST> (static_cast<UT> (sx) + static_cast<UT> (sy)) 1246 if (static_cast<ST> (static_cast<UT> (sx) + static_cast<UT> (sy))
1247 != std::numeric_limits<ST>::min () + 1) return true; 1247 != std::numeric_limits<ST>::min () + 1) return true;
1248 if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy)) 1248 if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy))
1249 != -1) return true; 1249 != -1) return true;
1250 1250
1251 if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy))) 1251 if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy)))
1252 return true; 1252 return true;
1253 if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy))) 1253 if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy)))
1254 return true; 1254 return true;
1255 if ((sx ^ sy) != (static_cast<UT> (sx) ^ static_cast<UT> (sy))) 1255 if ((sx ^ sy) != (static_cast<UT> (sx) ^ static_cast<UT> (sy)))
1256 return true; 1256 return true;
1257 if ((-1 >> 1) != -1) return true; 1257 if ((-1 >> 1) != -1) return true;
1258 return false; 1258 return false;
1259 } 1259 }
1260 1260
1261 #define DO_TEST(T) \ 1261 #define DO_TEST(T) \
1262 if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0)))\ 1262 if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0)))\
1263 return sizeof (T); 1263 return sizeof (T);
1264 1264
1265 ]],[[ 1265 ]],[[
1303 LDFLAGS="$ac_octave_save_LDFLAGS" 1303 LDFLAGS="$ac_octave_save_LDFLAGS"
1304 ]) 1304 ])
1305 if test "$octave_cv_framework_$1" = yes; then 1305 if test "$octave_cv_framework_$1" = yes; then
1306 AC_MSG_RESULT([yes]) 1306 AC_MSG_RESULT([yes])
1307 AC_ARG_WITH(framework-m4_tolower($1), 1307 AC_ARG_WITH(framework-m4_tolower($1),
1308 [AS_HELP_STRING([--without-framework-m4_tolower($1)], 1308 [AS_HELP_STRING([--without-framework-m4_tolower($1)],
1309 [don't use framework $1])], 1309 [don't use framework $1])],
1310 with_have_framework=$withval, with_have_framework=yes) 1310 with_have_framework=$withval, with_have_framework=yes)
1311 if test "$with_have_framework" = yes; then 1311 if test "$with_have_framework" = yes; then
1312 [$4] 1312 [$4]
1313 : 1313 :
1347 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], [ 1347 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], [
1348 AC_MSG_CHECKING([for IEEE 754 data format]) 1348 AC_MSG_CHECKING([for IEEE 754 data format])
1349 AC_CACHE_VAL([octave_cv_ieee754_data_format], 1349 AC_CACHE_VAL([octave_cv_ieee754_data_format],
1350 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1350 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
1351 int 1351 int
1352 main (void) 1352 main (void)
1353 { 1353 {
1354 typedef union { unsigned char c[8]; double d; } ieeebytes; 1354 typedef union { unsigned char c[8]; double d; } ieeebytes;
1355 1355
1356 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}; 1356 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43};
1357 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}; 1357 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c};
1358 1358
1359 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0; 1359 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0;
1360 } 1360 }
1376 ## useful system, so we will abort here. Anyone wishing to 1376 ## useful system, so we will abort here. Anyone wishing to
1377 ## experiment with building Octave on a system without IEEE 1377 ## experiment with building Octave on a system without IEEE
1378 ## floating point should be capable of removing this check and 1378 ## floating point should be capable of removing this check and
1379 ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc. 1379 ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc.
1380 AC_MSG_ERROR([IEEE 754 data format required for building Octave]) 1380 AC_MSG_ERROR([IEEE 754 data format required for building Octave])
1381 fi
1382 ])
1383 dnl
1384 dnl Check for CallInst::addAttribute API
1385 dnl
1386 AC_DEFUN([OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API], [
1387 AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attributes],
1388 [octave_cv_callinst_addattribute_arg_is_attributes],
1389 [AC_LANG_PUSH(C++)
1390 AC_COMPILE_IFELSE(
1391 [AC_LANG_PROGRAM([[
1392 #include <llvm/Instructions.h>
1393 #include <llvm/Attributes.h>
1394 #include <llvm/LLVMContext.h>
1395 ]], [[
1396 llvm::CallInst *callinst;
1397 llvm::AttrBuilder attr_builder;
1398 attr_builder.addAttribute(llvm::Attributes::StructRet);
1399 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
1400 callinst->addAttribute (1, attrs);
1401 ]])],
1402 octave_cv_callinst_addattribute_arg_is_attributes=yes,
1403 octave_cv_callinst_addattribute_arg_is_attributes=no)
1404 AC_LANG_POP(C++)
1405 ])
1406 if test $octave_cv_callinst_addattribute_arg_is_attributes = yes; then
1407 AC_DEFINE(CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
1408 [Define to 1 if llvm::CallInst:addAttribute arg type is llvm::Attributes.])
1409 else
1410 AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attribute],
1411 [octave_cv_callinst_addattribute_arg_is_attribute],
1412 [AC_LANG_PUSH(C++)
1413 AC_COMPILE_IFELSE(
1414 [AC_LANG_PROGRAM([[
1415 #include <llvm/Instructions.h>
1416 #include <llvm/Attributes.h>
1417 ]], [[
1418 llvm::CallInst *callinst;
1419 callinst->addAttribute (1, llvm::Attribute::StructRet);
1420 ]])],
1421 octave_cv_callinst_addattribute_arg_is_attribute=yes,
1422 octave_cv_callinst_addattribute_arg_is_attribute=no)
1423 AC_LANG_POP(C++)
1424 ])
1425 if test $octave_cv_callinst_addattribute_arg_is_attribute = no; then
1426 AC_MSG_ERROR([llvm::CallInst::addAttribute is required.])
1427 fi
1428 fi
1429 ])
1430 dnl
1431 dnl Detect TargetData.h or DataLayout.h.
1432 dnl
1433 AC_DEFUN([OCTAVE_LLVM_DATALAYOUT_HEADER], [
1434 AC_CHECK_HEADER([llvm/DataLayout.h], [
1435 octave_is_datalayout_header=yes], [
1436 AC_CHECK_HEADER([llvm/Target/TargetData.h], [
1437 octave_is_datalayout_header=no], [
1438 AC_MSG_ERROR([DataLayout.h or Target/TargetData.h is required.])
1439 ])
1440 ])
1441 if test $octave_is_datalayout_header = yes; then
1442 AC_DEFINE(HAVE_DATALAYOUT, 1,
1443 [Define to 1 if DataLayout.h exist.])
1444 fi
1445 ])
1446 dnl
1447 dnl Check for Function::addAttribute API
1448 dnl
1449 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDATTRIBUTE_API], [
1450 AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attributes],
1451 [octave_cv_function_addattribute_arg_is_attributes],
1452 [AC_LANG_PUSH(C++)
1453 AC_COMPILE_IFELSE(
1454 [AC_LANG_PROGRAM([[
1455 #include <llvm/Function.h>
1456 #include <llvm/Attributes.h>
1457 #include <llvm/LLVMContext.h>
1458 ]], [[
1459 llvm::Function *llvm_function;
1460 llvm::AttrBuilder attr_builder;
1461 attr_builder.addAttribute(llvm::Attributes::StructRet);
1462 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
1463 llvm_function->addAttribute (1, attrs);
1464 ]])],
1465 octave_cv_function_addattribute_arg_is_attributes=yes,
1466 octave_cv_function_addattribute_arg_is_attributes=no)
1467 AC_LANG_POP(C++)
1468 ])
1469 if test $octave_cv_function_addattribute_arg_is_attributes = yes; then
1470 AC_DEFINE(FUNCTION_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
1471 [Define to 1 if llvm::Function:addAttribute arg type is llvm::Attributes.])
1472 else
1473 AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attribute],
1474 [octave_cv_function_addattribute_arg_is_attribute],
1475 [AC_LANG_PUSH(C++)
1476 AC_COMPILE_IFELSE(
1477 [AC_LANG_PROGRAM([[
1478 #include <llvm/Function.h>
1479 #include <llvm/Attributes.h>
1480 ]], [[
1481 llvm::Function *llvm_function;
1482 llvm_function->addAttribute (1, llvm::Attribute::StructRet);
1483 ]])],
1484 octave_cv_function_addattribute_arg_is_attribute=yes,
1485 octave_cv_function_addattribute_arg_is_attribute=no)
1486 AC_LANG_POP(C++)
1487 ])
1488 if test $octave_cv_function_addattribute_arg_is_attribute = no; then
1489 AC_MSG_ERROR([llvm::Function::addAttribute is required.])
1490 fi
1491 fi
1492 ])
1493 dnl
1494 dnl Check for Function::addFnAttr API
1495 dnl
1496 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDFNATTR_API], [
1497 AC_CACHE_CHECK([check LLVM::Function::addFnAttr arg type is llvm::Attributes],
1498 [octave_cv_function_addfnattr_arg_is_attributes],
1499 [AC_LANG_PUSH(C++)
1500 AC_COMPILE_IFELSE(
1501 [AC_LANG_PROGRAM([[
1502 #include <llvm/Function.h>
1503 #include <llvm/Attributes.h>
1504 ]], [[
1505 llvm::Function *llvm_function;
1506 llvm_function->addFnAttr (llvm::Attributes::AlwaysInline);
1507 ]])],
1508 octave_cv_function_addfnattr_arg_is_attributes=yes,
1509 octave_cv_function_addfnattr_arg_is_attributes=no)
1510 AC_LANG_POP(C++)
1511 ])
1512 if test $octave_cv_function_addfnattr_arg_is_attributes = yes; then
1513 AC_DEFINE(FUNCTION_ADDFNATTR_ARG_IS_ATTRIBUTES, 1,
1514 [Define to 1 if llvm::Function:addFnAttr arg type is llvm::Attributes.])
1515 else
1516 AC_CACHE_CHECK([check llvm::Function::addFnAttr arg type is llvm::Attribute],
1517 [octave_cv_function_addfnattr_arg_is_attribute],
1518 [AC_LANG_PUSH(C++)
1519 AC_COMPILE_IFELSE(
1520 [AC_LANG_PROGRAM([[
1521 #include <llvm/Function.h>
1522 #include <llvm/Attributes.h>
1523 ]], [[
1524 llvm::Function *llvm_function;
1525 llvm_function->addFnAttr (llvm::Attribute::AlwaysInline);
1526 ]])],
1527 octave_cv_function_addfnattr_arg_is_attribute=yes,
1528 octave_cv_function_addfnattr_arg_is_attribute=no)
1529 AC_LANG_POP(C++)
1530 ])
1531 if test $octave_cv_function_addfnattr_arg_is_attribute = no; then
1532 AC_MSG_ERROR([llvm::Function::addFnAttr is required.])
1533 fi
1534 fi
1535 ])
1536 dnl
1537 dnl Check whether IRBuilder.h is in Support directory.
1538 dnl
1539 AC_DEFUN([OCTAVE_LLVM_IRBUILDER_HEADER], [
1540 AC_CHECK_HEADER([llvm/IRBuilder.h], [
1541 octave_irbuilder_header_in_support_dir=no], [
1542 AC_CHECK_HEADER([llvm/Support/IRBuilder.h], [
1543 octave_irbuilder_header_in_support_dir=yes], [
1544 AC_MSG_ERROR([IRBuilder.h is required.])
1545 ])
1546 ])
1547 if test $octave_irbuilder_header_in_support_dir = yes; then
1548 AC_DEFINE(IRBUILDER_HEADER_IN_SUPPORT_DIR, 1,
1549 [Define to 1 if IRBuilder.h in Support directory.])
1381 fi 1550 fi
1382 ]) 1551 ])
1383 dnl 1552 dnl
1384 dnl Check for ar. 1553 dnl Check for ar.
1385 dnl 1554 dnl
1572 if test -z "$GPERF"; then 1741 if test -z "$GPERF"; then
1573 GPERF='$(top_srcdir)/build-aux/missing gperf' 1742 GPERF='$(top_srcdir)/build-aux/missing gperf'
1574 warn_gperf=" 1743 warn_gperf="
1575 1744
1576 I didn't find gperf, but it's only a problem if you need to 1745 I didn't find gperf, but it's only a problem if you need to
1577 reconstruct oct-gperf.h 1746 reconstruct oct-gperf.h
1578 " 1747 "
1579 OCTAVE_CONFIGURE_WARNING([warn_gperf]) 1748 OCTAVE_CONFIGURE_WARNING([warn_gperf])
1580 GPERF='$(top_srcdir)/build-aux/missing gperf' 1749 GPERF='$(top_srcdir)/build-aux/missing gperf'
1581 fi 1750 fi
1582 AC_SUBST(GPERF) 1751 AC_SUBST(GPERF)
1759 dnl UMFPACK >= 4 requires linking in another library for SuiteSparse_time. 1928 dnl UMFPACK >= 4 requires linking in another library for SuiteSparse_time.
1760 dnl 1929 dnl
1761 dnl Macro assumes that the check for umfpack has already been performed. 1930 dnl Macro assumes that the check for umfpack has already been performed.
1762 dnl 1931 dnl
1763 AC_DEFUN([OCTAVE_UMFPACK_NEED_SUITESPARSE_TIME], [ 1932 AC_DEFUN([OCTAVE_UMFPACK_NEED_SUITESPARSE_TIME], [
1764 AC_CACHE_CHECK([whether UMFPACK needs SuiteSparse_time function], 1933 AC_CACHE_CHECK([whether UMFPACK needs SuiteSparse_time function],
1765 [octave_cv_umfpack_need_suitesparse_time], 1934 [octave_cv_umfpack_need_suitesparse_time],
1766 [AC_LANG_PUSH(C) 1935 [AC_LANG_PUSH(C)
1767 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 1936 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1768 #if defined (HAVE_SUITESPARSE_UMFPACK_H) 1937 #if defined (HAVE_SUITESPARSE_UMFPACK_H)
1769 # include <suitesparse/umfpack.h> 1938 # include <suitesparse/umfpack.h>
1812 #define UMFPACK_NAME(name) umfpack_zi_ ## name 1981 #define UMFPACK_NAME(name) umfpack_zi_ ## name
1813 #endif 1982 #endif
1814 idx_type n = 5; 1983 idx_type n = 5;
1815 idx_type Ap[] = {0, 2, 5, 9, 10, 12}; 1984 idx_type Ap[] = {0, 2, 5, 9, 10, 12};
1816 idx_type Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4}; 1985 idx_type Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4};
1817 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., 1986 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0.,
1818 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.}; 1987 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.};
1819 double br[] = {8., 45., -3., 3., 19.}; 1988 double br[] = {8., 45., -3., 3., 19.};
1820 double bi[] = {0., 0., 0., 0., 0.}; 1989 double bi[] = {0., 0., 0., 0., 0.};
1821 int main (void) 1990 int main (void)
1822 { 1991 {
1825 idx_type i ; 1994 idx_type i ;
1826 void *Symbolic, *Numeric ; 1995 void *Symbolic, *Numeric ;
1827 (void) UMFPACK_NAME (symbolic) (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ; 1996 (void) UMFPACK_NAME (symbolic) (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ;
1828 (void) UMFPACK_NAME (numeric) (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ; 1997 (void) UMFPACK_NAME (numeric) (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ;
1829 UMFPACK_NAME (free_symbolic) (&Symbolic) ; 1998 UMFPACK_NAME (free_symbolic) (&Symbolic) ;
1830 (void) UMFPACK_NAME (solve) (0, Ap, Ai, Ax, null, x, null, br, bi, 1999 (void) UMFPACK_NAME (solve) (0, Ap, Ai, Ax, null, x, null, br, bi,
1831 Numeric, null, null) ; 2000 Numeric, null, null) ;
1832 UMFPACK_NAME (free_numeric) (&Numeric) ; 2001 UMFPACK_NAME (free_numeric) (&Numeric) ;
1833 for (i = 0; i < n; i++, x+=2) 2002 for (i = 0; i < n; i++, x+=2)
1834 if (fabs (*x - i - 1.) > 1.e-13) 2003 if (fabs (*x - i - 1.) > 1.e-13)
1835 return (1); 2004 return (1);
1836 return (0) ; 2005 return (0) ;
1837 } 2006 }
1838 ]])], 2007 ]])],
1844 AC_MSG_RESULT([$octave_cv_umfpack_separate_split assumed for cross compilation]) 2013 AC_MSG_RESULT([$octave_cv_umfpack_separate_split assumed for cross compilation])
1845 else 2014 else
1846 AC_MSG_RESULT([$octave_cv_umfpack_separate_split]) 2015 AC_MSG_RESULT([$octave_cv_umfpack_separate_split])
1847 fi 2016 fi
1848 if test $octave_cv_umfpack_separate_split = yes; then 2017 if test $octave_cv_umfpack_separate_split = yes; then
1849 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, 2018 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1,
1850 [Define to 1 if the UMFPACK Complex solver allows matrix and RHS to be split independently.]) 2019 [Define to 1 if the UMFPACK Complex solver allows matrix and RHS to be split independently.])
1851 fi 2020 fi
1852 ]) 2021 ])
1853 dnl 2022 dnl
1854 dnl Check for unordered map headers and whether tr1 namespace is 2023 dnl Check for unordered map headers and whether tr1 namespace is
1855 dnl required. 2024 dnl required.
1856 dnl 2025 dnl
1857 AC_DEFUN([OCTAVE_UNORDERED_MAP_HEADERS], [ 2026 AC_DEFUN([OCTAVE_UNORDERED_MAP_HEADERS], [
1858 AC_CHECK_HEADERS([unordered_map], [], 2027 AC_CHECK_HEADERS([unordered_map], [],
1859 [AC_CHECK_HEADERS([tr1/unordered_map])]) 2028 [AC_CHECK_HEADERS([tr1/unordered_map])])
1860 AC_CACHE_CHECK([whether unordered_map requires tr1 namespace], 2029 AC_CACHE_CHECK([whether unordered_map requires tr1 namespace],
1861 [octave_cv_header_require_tr1_namespace], 2030 [octave_cv_header_require_tr1_namespace],
1862 [AC_LANG_PUSH(C++) 2031 [AC_LANG_PUSH(C++)
1863 octave_cv_header_require_tr1_namespace=no 2032 octave_cv_header_require_tr1_namespace=no
1864 if test $ac_cv_header_unordered_map = yes; then 2033 if test $ac_cv_header_unordered_map = yes; then
1865 ## Have <unordered_map>, but still have to check whether 2034 ## Have <unordered_map>, but still have to check whether
1868 [AC_LANG_PROGRAM([[ 2037 [AC_LANG_PROGRAM([[
1869 #include <unordered_map> 2038 #include <unordered_map>
1870 ]], [[ 2039 ]], [[
1871 std::unordered_map<int,int> m; 2040 std::unordered_map<int,int> m;
1872 ]])], 2041 ]])],
1873 octave_cv_header_require_tr1_namespace=no, 2042 octave_cv_header_require_tr1_namespace=no,
1874 octave_cv_header_require_tr1_namespace=yes) 2043 octave_cv_header_require_tr1_namespace=yes)
1875 elif test $ac_cv_header_tr1_unordered_map = yes; then 2044 elif test $ac_cv_header_tr1_unordered_map = yes; then
1876 octave_cv_header_require_tr1_namespace=yes 2045 octave_cv_header_require_tr1_namespace=yes
1877 fi 2046 fi
1878 AC_LANG_POP(C++) 2047 AC_LANG_POP(C++)
1879 ]) 2048 ])
1880 if test $octave_cv_header_require_tr1_namespace = yes; then 2049 if test $octave_cv_header_require_tr1_namespace = yes; then
1881 AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1, 2050 AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1,
1882 [Define to 1 if unordered_map requires the use of tr1 namespace.]) 2051 [Define to 1 if unordered_map requires the use of tr1 namespace.])
1883 fi
1884 ])
1885 dnl
1886 dnl Check whether IRBuilder.h is in Support directory.
1887 dnl
1888 AC_DEFUN([OCTAVE_LLVM_IRBUILDER_HEADER], [
1889 AC_CHECK_HEADER([llvm/IRBuilder.h], [
1890 octave_irbuilder_header_in_support_dir=no], [
1891 AC_CHECK_HEADER([llvm/Support/IRBuilder.h], [
1892 octave_irbuilder_header_in_support_dir=yes], [
1893 AC_MSG_ERROR("IRBuilder.h is required.")
1894 ])
1895 ])
1896 if test $octave_irbuilder_header_in_support_dir = yes; then
1897 AC_DEFINE(IRBUILDER_HEADER_IN_SUPPORT_DIR, 1,
1898 [Define to 1 if IRBuilder.h in Support directory.])
1899 fi
1900 ])
1901 dnl
1902 dnl Detect TargetData.h or DataLayout.h.
1903 dnl
1904 AC_DEFUN([OCTAVE_LLVM_DATALAYOUT_HEADER], [
1905 AC_CHECK_HEADER([llvm/DataLayout.h], [
1906 octave_is_datalayout_header=yes], [
1907 AC_CHECK_HEADER([llvm/Target/TargetData.h], [
1908 octave_is_datalayout_header=no], [
1909 AC_MSG_ERROR("DataLayout.h or Target/TargetData.h is required.")
1910 ])
1911 ])
1912 if test $octave_is_datalayout_header = yes; then
1913 AC_DEFINE(HAVE_DATALAYOUT, 1,
1914 [Define to 1 if DataLayout.h exist.])
1915 fi
1916 ])
1917 dnl
1918 dnl Check for Function::addAttribute API
1919 dnl
1920 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDATTRIBUTE_API], [
1921 AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attributes],
1922 [octave_cv_function_addattribute_arg_is_attributes],
1923 [AC_LANG_PUSH(C++)
1924 AC_COMPILE_IFELSE(
1925 [AC_LANG_PROGRAM([[
1926 #include <llvm/Function.h>
1927 #include <llvm/Attributes.h>
1928 #include <llvm/LLVMContext.h>
1929 ]], [[
1930 llvm::Function *llvm_function;
1931 llvm::AttrBuilder attr_builder;
1932 attr_builder.addAttribute(llvm::Attributes::StructRet);
1933 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
1934 llvm_function->addAttribute (1, attrs);
1935 ]])],
1936 octave_cv_function_addattribute_arg_is_attributes=yes,
1937 octave_cv_function_addattribute_arg_is_attributes=no)
1938 AC_LANG_POP(C++)
1939 ])
1940 if test $octave_cv_function_addattribute_arg_is_attributes = yes; then
1941 AC_DEFINE(FUNCTION_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
1942 [Define to 1 if llvm::Function:addAttribute arg type is llvm::Attributes.])
1943 else
1944 AC_CACHE_CHECK([check llvm::Function::addAttribute arg type is llvm::Attribute],
1945 [octave_cv_function_addattribute_arg_is_attribute],
1946 [AC_LANG_PUSH(C++)
1947 AC_COMPILE_IFELSE(
1948 [AC_LANG_PROGRAM([[
1949 #include <llvm/Function.h>
1950 #include <llvm/Attributes.h>
1951 ]], [[
1952 llvm::Function *llvm_function;
1953 llvm_function->addAttribute (1, llvm::Attribute::StructRet);
1954 ]])],
1955 octave_cv_function_addattribute_arg_is_attribute=yes,
1956 octave_cv_function_addattribute_arg_is_attribute=no)
1957 AC_LANG_POP(C++)
1958 ])
1959 if test $octave_cv_function_addattribute_arg_is_attribute = no; then
1960 AC_MSG_ERROR("llvm::Function::addAttribute is required.")
1961 fi
1962 fi
1963 ])
1964 dnl
1965 dnl Check for Function::addFnAttr API
1966 dnl
1967 AC_DEFUN([OCTAVE_LLVM_FUNCTION_ADDFNATTR_API], [
1968 AC_CACHE_CHECK([check LLVM::Function::addFnAttr arg type is llvm::Attributes],
1969 [octave_cv_function_addfnattr_arg_is_attributes],
1970 [AC_LANG_PUSH(C++)
1971 AC_COMPILE_IFELSE(
1972 [AC_LANG_PROGRAM([[
1973 #include <llvm/Function.h>
1974 #include <llvm/Attributes.h>
1975 ]], [[
1976 llvm::Function *llvm_function;
1977 llvm_function->addFnAttr (llvm::Attributes::AlwaysInline);
1978 ]])],
1979 octave_cv_function_addfnattr_arg_is_attributes=yes,
1980 octave_cv_function_addfnattr_arg_is_attributes=no)
1981 AC_LANG_POP(C++)
1982 ])
1983 if test $octave_cv_function_addfnattr_arg_is_attributes = yes; then
1984 AC_DEFINE(FUNCTION_ADDFNATTR_ARG_IS_ATTRIBUTES, 1,
1985 [Define to 1 if llvm::Function:addFnAttr arg type is llvm::Attributes.])
1986 else
1987 AC_CACHE_CHECK([check llvm::Function::addFnAttr arg type is llvm::Attribute],
1988 [octave_cv_function_addfnattr_arg_is_attribute],
1989 [AC_LANG_PUSH(C++)
1990 AC_COMPILE_IFELSE(
1991 [AC_LANG_PROGRAM([[
1992 #include <llvm/Function.h>
1993 #include <llvm/Attributes.h>
1994 ]], [[
1995 llvm::Function *llvm_function;
1996 llvm_function->addFnAttr (llvm::Attribute::AlwaysInline);
1997 ]])],
1998 octave_cv_function_addfnattr_arg_is_attribute=yes,
1999 octave_cv_function_addfnattr_arg_is_attribute=no)
2000 AC_LANG_POP(C++)
2001 ])
2002 if test $octave_cv_function_addfnattr_arg_is_attribute = no; then
2003 AC_MSG_ERROR("llvm::Function::addFnAttr is required.")
2004 fi
2005 fi
2006 ])
2007 dnl
2008 dnl Check for CallInst::addAttribute API
2009 dnl
2010 AC_DEFUN([OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API], [
2011 AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attributes],
2012 [octave_cv_callinst_addattribute_arg_is_attributes],
2013 [AC_LANG_PUSH(C++)
2014 AC_COMPILE_IFELSE(
2015 [AC_LANG_PROGRAM([[
2016 #include <llvm/Instructions.h>
2017 #include <llvm/Attributes.h>
2018 #include <llvm/LLVMContext.h>
2019 ]], [[
2020 llvm::CallInst *callinst;
2021 llvm::AttrBuilder attr_builder;
2022 attr_builder.addAttribute(llvm::Attributes::StructRet);
2023 llvm::Attributes attrs = llvm::Attributes::get(llvm::getGlobalContext(), attr_builder);
2024 callinst->addAttribute (1, attrs);
2025 ]])],
2026 octave_cv_callinst_addattribute_arg_is_attributes=yes,
2027 octave_cv_callinst_addattribute_arg_is_attributes=no)
2028 AC_LANG_POP(C++)
2029 ])
2030 if test $octave_cv_callinst_addattribute_arg_is_attributes = yes; then
2031 AC_DEFINE(CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES, 1,
2032 [Define to 1 if llvm::CallInst:addAttribute arg type is llvm::Attributes.])
2033 else
2034 AC_CACHE_CHECK([check LLVM::CallInst::addAttribute arg type is llvm::Attribute],
2035 [octave_cv_callinst_addattribute_arg_is_attribute],
2036 [AC_LANG_PUSH(C++)
2037 AC_COMPILE_IFELSE(
2038 [AC_LANG_PROGRAM([[
2039 #include <llvm/Instructions.h>
2040 #include <llvm/Attributes.h>
2041 ]], [[
2042 llvm::CallInst *callinst;
2043 callinst->addAttribute (1, llvm::Attribute::StructRet);
2044 ]])],
2045 octave_cv_callinst_addattribute_arg_is_attribute=yes,
2046 octave_cv_callinst_addattribute_arg_is_attribute=no)
2047 AC_LANG_POP(C++)
2048 ])
2049 if test $octave_cv_callinst_addattribute_arg_is_attribute = no; then
2050 AC_MSG_ERROR("llvm::CallInst::addAttribute is required.")
2051 fi
2052 fi 2052 fi
2053 ]) 2053 ])
2054 2054
2055 dnl End of macros written by Octave developers 2055 dnl End of macros written by Octave developers
2056 dnl ------------------------------------------------------------ 2056 dnl ------------------------------------------------------------