Mercurial > octave
annotate aclocal.m4 @ 9568:d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Aug 2009 13:15:40 -0400 |
parents | 1d51ab34b509 |
children | b03062e16c6f |
rev | line source |
---|---|
1232 | 1 dnl aclocal.m4 -- extra macros for configuring Octave |
2 dnl | |
7017 | 3 dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
8920 | 4 dnl 2003, 2004, 2005, 2006, 2007, 2008, 2009 John W. Eaton |
1232 | 5 dnl |
6 dnl This file is part of Octave. | |
7 dnl | |
8 dnl Octave is free software; you can redistribute it and/or modify it | |
9 dnl under the terms of the GNU General Public License as published by the | |
7016 | 10 dnl Free Software Foundation; either version 3 of the License, or (at |
11 dnl your option) any later version. | |
1232 | 12 dnl |
13 dnl Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 dnl for more details. | |
17 dnl | |
18 dnl You should have received a copy of the GNU General Public License | |
7016 | 19 dnl along with Octave; see the file COPYING. If not, see |
20 dnl <http://www.gnu.org/licenses/>. | |
2548 | 21 dnl |
9525
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
22 dnl |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
23 dnl If needed, define the m4_ifblank and m4_ifnblank macros from autoconf 2.64 |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
24 dnl This allows us to run with earlier Autoconfs as well. |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
25 ifdef([m4_ifblank],[],[ |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
26 m4_define([m4_ifblank], |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
27 [m4_if(m4_translit([[$1]], [ ][ ][ |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
28 ]), [], [$2], [$3])])]) |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
29 dnl |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
30 ifdef([m4_ifnblank],[],[ |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
31 m4_define([m4_ifnblank], |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
32 [m4_if(m4_translit([[$1]], [ ][ ][ |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
33 ]), [], [$3], [$2])])]) |
691545147aca
compatibility for earlier autoconfs
Jaroslav Hajek <highegg@gmail.com>
parents:
9523
diff
changeset
|
34 dnl |
2813 | 35 dnl ---------------------------------------------------------------------- |
36 dnl | |
37 dnl Figure out the hardware-vendor-os info. | |
38 dnl | |
39 dnl OCTAVE_HOST_TYPE | |
40 AC_DEFUN(OCTAVE_HOST_TYPE, | |
41 [AC_CANONICAL_HOST | |
42 if test -z "$host"; then | |
43 host=unknown | |
44 fi | |
45 canonical_host_type=$host | |
46 if test "$host" = unknown; then | |
47 AC_MSG_WARN([configuring Octave for unknown system type | |
48 ]) | |
49 fi | |
3130 | 50 AC_SUBST(canonical_host_type)]) |
2813 | 51 dnl |
52 dnl Set default value for a variable and substitute it. | |
53 dnl | |
54 dnl OCTAVE_SET_DEFAULT | |
55 AC_DEFUN(OCTAVE_SET_DEFAULT, | |
3176 | 56 [ifelse($#, 2, [: ${$1=$2} |
2813 | 57 ])dnl |
58 AC_MSG_RESULT([defining $1 to be $$1]) | |
59 AC_SUBST($1)]) | |
60 dnl | |
3130 | 61 dnl Check for ar. |
62 dnl | |
63 AC_DEFUN(OCTAVE_PROG_AR, | |
64 [if test -z "$AR"; then | |
65 AR=ar | |
66 fi | |
67 AC_SUBST(AR) | |
68 | |
69 if test -z "$ARFLAGS"; then | |
70 ARFLAGS="rc" | |
71 fi | |
72 AC_SUBST(ARFLAGS) | |
73 ]) | |
74 dnl | |
4360 | 75 dnl See if the compiler supports placement delete |
76 dnl | |
77 AC_DEFUN(OCTAVE_PLACEMENT_DELETE, | |
78 [AC_CACHE_CHECK([whether <new> defines placement delete operator], | |
79 octave_cv_placement_delete, | |
80 [AC_LANG_PUSH(C++) | |
5844 | 81 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <new>]], |
82 [[operator delete((void *)0, (void *)0);]])], | |
4360 | 83 octave_cv_placement_delete=yes, octave_cv_placement_delete=no)]) |
84 if test $octave_cv_placement_delete = yes; then | |
85 AC_DEFINE(HAVE_PLACEMENT_DELETE,1,[Define if C++ supports operator delete(void *, void *)]) | |
86 fi | |
87 AC_LANG_POP(C++) | |
88 ]) | |
89 dnl | |
4366 | 90 dnl See if the compiler dynamic auto arrays |
91 dnl | |
92 AC_DEFUN(OCTAVE_DYNAMIC_AUTO_ARRAYS, | |
93 [AC_CACHE_CHECK([whether C++ supports dynamic auto arrays], | |
94 octave_cv_dynamic_auto_arrays, | |
95 [AC_LANG_PUSH(C++) | |
5844 | 96 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], |
97 [[void test(char *); int length(); char x[length()]; test(x);]])], | |
4366 | 98 octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)]) |
99 if test $octave_cv_dynamic_auto_arrays = yes; then | |
100 AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define if C++ supports dynamic auto arrays]) | |
101 fi | |
102 AC_LANG_POP(C++) | |
103 ]) | |
104 dnl | |
7058 | 105 dnl Check for broken strptime |
106 dnl | |
107 AC_DEFUN(OCTAVE_STRPTIME_BROKEN, | |
108 [AC_CACHE_CHECK([whether strptime is broken], | |
109 octave_cv_strptime_broken, | |
110 [AC_LANG_PUSH(C) | |
111 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | |
112 #define _XOPEN_SOURCE | |
113 #if defined (HAVE_SYS_TYPES_H) | |
114 #include <sys/types.h> | |
115 #if defined (HAVE_UNISTD_H) | |
116 #include <unistd.h> | |
117 #endif | |
118 #endif | |
119 #include <stdio.h> | |
120 #include <time.h> | |
121 ]], [[ | |
122 struct tm t; | |
123 char *q = strptime ("09/13", "%m/%d/%y", &t); | |
124 return q ? 1 : 0; | |
125 ]])], [octave_cv_strptime_broken=no], [octave_cv_strptime_broken=yes])]) | |
126 if test $octave_cv_strptime_broken = yes; then | |
127 AC_DEFINE(OCTAVE_HAVE_BROKEN_STRPTIME, 1, [Define if strptime is broken on your system]) | |
128 fi | |
129 AC_LANG_POP(C) | |
130 ]) | |
131 dnl | |
1707 | 132 dnl The following test is from Karl Berry's Kpathseach library. I'm |
133 dnl including it here in case we someday want to make the use of | |
134 dnl kpathsea optional. | |
1708 | 135 dnl |
136 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. | |
137 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>. | |
138 dnl We don't actually need to run this if we don't have putenv, but it | |
139 dnl doesn't hurt. | |
140 AC_DEFUN(OCTAVE_SMART_PUTENV, | |
141 [AC_MSG_CHECKING(whether putenv uses malloc) | |
1707 | 142 AC_CACHE_VAL(octave_cv_func_putenv_malloc, |
5844 | 143 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
1707 | 144 #define VAR "YOW_VAR" |
145 #define STRING1 "GabbaGabbaHey" | |
146 #define STRING2 "Yow!!" /* should be shorter than STRING1 */ | |
147 extern char *getenv (); /* in case char* and int don't mix gracefully */ | |
148 main () | |
149 { | |
150 char *str1, *rstr1, *str2, *rstr2; | |
151 str1 = getenv (VAR); | |
152 if (str1) | |
153 exit (1); | |
154 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); | |
155 if (str1 == 0) | |
156 exit (2); | |
157 strcpy (str1, VAR); | |
158 strcat (str1, "="); | |
159 strcat (str1, STRING1); | |
160 if (putenv (str1) < 0) | |
161 exit (3); | |
162 rstr1 = getenv (VAR); | |
163 if (rstr1 == 0) | |
164 exit (4); | |
165 rstr1 -= strlen (VAR) + 1; | |
166 if (strncmp (rstr1, VAR, strlen (VAR))) | |
167 exit (5); | |
168 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); | |
169 if (str2 == 0 || str1 == str2) | |
170 exit (6); | |
171 strcpy (str2, VAR); | |
172 strcat (str2, "="); | |
173 strcat (str2, STRING2); | |
174 if (putenv (str2) < 0) | |
175 exit (7); | |
176 rstr2 = getenv (VAR); | |
177 if (rstr2 == 0) | |
178 exit (8); | |
179 rstr2 -= strlen (VAR) + 1; | |
180 #if 0 | |
181 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); | |
182 /* | |
183 * If string from first call was reused for the second call, | |
184 * you had better not do a free on the first string! | |
185 */ | |
186 if (rstr1 == rstr2) | |
187 printf ("#define SMART_PUTENV\n"); | |
188 else | |
189 printf ("#undef SMART_PUTENV\n"); | |
190 #endif | |
191 exit (rstr1 == rstr2 ? 0 : 1); | |
5844 | 192 }]])], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no, |
1707 | 193 octave_cv_func_putenv_malloc=no)])dnl |
194 AC_MSG_RESULT($octave_cv_func_putenv_malloc) | |
195 if test $octave_cv_func_putenv_malloc = yes; then | |
3887 | 196 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.]) |
1708 | 197 fi]) |
1788 | 198 dnl |
2469 | 199 dnl These two checks for signal functions were originally part of the |
200 dnl aclocal.m4 file distributed with bash 2.0. | |
201 dnl | |
202 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) | |
203 AC_DEFUN(OCTAVE_SIGNAL_CHECK, | |
204 [AC_REQUIRE([AC_TYPE_SIGNAL]) | |
205 AC_MSG_CHECKING(for type of signal functions) | |
206 AC_CACHE_VAL(octave_cv_signal_vintage, | |
207 [ | |
5842 | 208 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], |
209 [[sigset_t ss; | |
210 struct sigaction sa; | |
211 sigemptyset (&ss); | |
212 sigsuspend (&ss); | |
213 sigaction (SIGINT, &sa, (struct sigaction *) 0); | |
214 sigprocmask (SIG_BLOCK, &ss, (sigset_t *) 0);]])], | |
215 [octave_cv_signal_vintage=posix], | |
216 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], | |
217 [[int mask = sigmask (SIGINT); | |
218 sigsetmask (mask); | |
219 sigblock (mask); | |
220 sigpause (mask);]])], | |
221 [octave_cv_signal_vintage=4.2bsd], | |
222 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h> | |
5844 | 223 RETSIGTYPE foo() { }]], |
5842 | 224 [[int mask = sigmask (SIGINT); |
225 sigset (SIGINT, foo); | |
226 sigrelse (SIGINT); | |
227 sighold (SIGINT); | |
5844 | 228 sigpause (SIGINT);]])], |
5842 | 229 [octave_cv_signal_vintage=svr3], |
230 [octave_cv_signal_vintage=v7])])])]) | |
2469 | 231 AC_MSG_RESULT($octave_cv_signal_vintage) |
2491 | 232 if test "$octave_cv_signal_vintage" = posix; then |
5842 | 233 AC_DEFINE(HAVE_POSIX_SIGNALS, 1, [Define if you have POSIX style signals.]) |
2491 | 234 elif test "$octave_cv_signal_vintage" = "4.2bsd"; then |
5842 | 235 AC_DEFINE(HAVE_BSD_SIGNALS, 1, [Define if you have BSD style signals.]) |
2491 | 236 elif test "$octave_cv_signal_vintage" = svr3; then |
5842 | 237 AC_DEFINE(HAVE_USG_SIGHOLD, 1, [Define if you have System V Release 3 signals.]) |
2469 | 238 fi |
239 ]) | |
240 dnl | |
241 AC_DEFUN(OCTAVE_REINSTALL_SIGHANDLERS, | |
242 [AC_REQUIRE([AC_TYPE_SIGNAL]) | |
243 AC_REQUIRE([OCTAVE_SIGNAL_CHECK]) | |
244 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) | |
245 AC_CACHE_VAL(octave_cv_must_reinstall_sighandlers, | |
5844 | 246 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
2469 | 247 #include <signal.h> |
248 #ifdef HAVE_UNISTD_H | |
249 #include <unistd.h> | |
250 #endif | |
251 typedef RETSIGTYPE sigfunc(); | |
252 int nsigint; | |
253 #ifdef HAVE_POSIX_SIGNALS | |
254 sigfunc * | |
255 set_signal_handler(sig, handler) | |
256 int sig; | |
257 sigfunc *handler; | |
258 { | |
259 struct sigaction act, oact; | |
260 act.sa_handler = handler; | |
261 act.sa_flags = 0; | |
262 sigemptyset (&act.sa_mask); | |
263 sigemptyset (&oact.sa_mask); | |
264 sigaction (sig, &act, &oact); | |
265 return (oact.sa_handler); | |
266 } | |
267 #else | |
268 #define set_signal_handler(s, h) signal(s, h) | |
269 #endif | |
270 RETSIGTYPE | |
271 sigint(s) | |
272 int s; | |
273 { | |
274 nsigint++; | |
275 } | |
276 main() | |
277 { | |
278 nsigint = 0; | |
279 set_signal_handler(SIGINT, sigint); | |
280 kill((int)getpid(), SIGINT); | |
281 kill((int)getpid(), SIGINT); | |
282 exit(nsigint != 2); | |
283 } | |
5844 | 284 ]])], |
285 octave_cv_must_reinstall_sighandlers=no, | |
286 octave_cv_must_reinstall_sighandlers=yes, | |
3130 | 287 if test "$octave_cv_signal_vintage" = svr3; then |
288 octave_cv_must_reinstall_sighandlers=yes | |
289 else | |
290 octave_cv_must_reinstall_sighandlers=no | |
291 fi)]) | |
292 if test "$cross_compiling" = yes; then | |
293 AC_MSG_RESULT([$octave_cv_must_reinstall_sighandlers assumed for cross compilation]) | |
294 else | |
295 AC_MSG_RESULT($octave_cv_must_reinstall_sighandlers) | |
296 fi | |
2491 | 297 if test "$octave_cv_must_reinstall_sighandlers" = yes; then |
3887 | 298 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS,1,[Define if signal handlers must be reinstalled after they are called.]) |
2469 | 299 fi |
300 ]) | |
2626 | 301 dnl |
3107 | 302 dnl Check to see if C++ compiler needs the new friend template declaration |
303 dnl syntax. | |
304 dnl | |
305 dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL | |
306 AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [ | |
307 AC_REQUIRE([AC_PROG_CXX]) | |
308 AC_MSG_CHECKING([for C++ support for new friend template declaration]) | |
309 AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [ | |
3888 | 310 AC_LANG_PUSH(C++) |
3107 | 311 rm -f conftest.h |
312 cat > conftest.h <<EOB | |
313 struct A { | |
314 friend int operator== (const A&, const A&); | |
315 A (int) { } | |
316 }; | |
317 | |
318 template <class T> int | |
319 operator== (const T&, const T&) | |
320 { | |
321 return 0; | |
322 } | |
323 EOB | |
5842 | 324 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]], |
325 [[A a (1); | |
326 return a == A(1);]])], | |
327 [octave_cv_cxx_new_friend_template_decl=no], | |
328 [octave_cv_cxx_new_friend_template_decl=yes]) | |
3888 | 329 AC_LANG_POP(C++) |
3107 | 330 ]) |
331 AC_MSG_RESULT($octave_cv_cxx_new_friend_template_decl) | |
332 if test $octave_cv_cxx_new_friend_template_decl = yes; then | |
3887 | 333 AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL,1,[Define if your compiler supports `<>' stuff for template friends.]) |
3107 | 334 fi |
335 ]) | |
3126 | 336 dnl |
3233 | 337 dnl Check to see if C compiler handles FLAG command line option. If |
338 dnl two arguments are specified, execute the second arg as shell | |
339 dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts | |
340 dnl the flag. | |
3126 | 341 dnl |
342 dnl OCTAVE_CC_FLAG | |
343 AC_DEFUN(OCTAVE_CC_FLAG, [ | |
3908 | 344 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` |
3126 | 345 AC_MSG_CHECKING(whether ${CC-cc} accepts $1) |
346 AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [ | |
3888 | 347 AC_LANG_PUSH(C) |
3126 | 348 XCFLAGS="$CFLAGS" |
349 CFLAGS="$CFLAGS $1" | |
5177 | 350 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
3126 | 351 eval "octave_cv_cc_flag_$ac_safe=yes", |
352 eval "octave_cv_cc_flag_$ac_safe=no") | |
353 CFLAGS="$XCFLAGS" | |
3888 | 354 AC_LANG_POP(C) |
3126 | 355 ]) |
356 if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then | |
357 AC_MSG_RESULT(yes) | |
3131 | 358 ifelse([$2], , [ |
359 CFLAGS="$CFLAGS $1" | |
360 AC_MSG_RESULT([adding $1 to CFLAGS])], [$2]) | |
3126 | 361 else |
362 AC_MSG_RESULT(no) | |
363 ifelse([$3], , , [$3]) | |
364 fi | |
365 ]) | |
366 dnl | |
3233 | 367 dnl Check to see if C++ compiler handles FLAG command line option. If |
368 dnl two arguments are specified, execute the second arg as shell | |
369 dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts | |
370 dnl the flag. | |
3126 | 371 dnl |
372 dnl OCTAVE_CXX_FLAG | |
373 AC_DEFUN(OCTAVE_CXX_FLAG, [ | |
3908 | 374 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` |
3222 | 375 AC_MSG_CHECKING(whether ${CXX-g++} accepts $1) |
3126 | 376 AC_CACHE_VAL(octave_cv_cxx_flag_$ac_safe, [ |
3888 | 377 AC_LANG_PUSH(C++) |
3126 | 378 XCXXFLAGS="$CXXFLAGS" |
379 CXXFLAGS="$CXXFLAGS $1" | |
5177 | 380 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
3126 | 381 eval "octave_cv_cxx_flag_$ac_safe=yes", |
382 eval "octave_cv_cxx_flag_$ac_safe=no") | |
383 CXXFLAGS="$XCXXFLAGS" | |
3888 | 384 AC_LANG_POP(C++) |
3126 | 385 ]) |
386 if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then | |
387 AC_MSG_RESULT(yes) | |
3131 | 388 ifelse([$2], , [ |
389 CXXFLAGS="$CXXFLAGS $1" | |
390 AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2]) | |
3126 | 391 else |
392 AC_MSG_RESULT(no) | |
393 ifelse([$3], , , [$3]) | |
394 fi | |
395 ]) | |
3130 | 396 dnl |
5076 | 397 dnl Check to see if Fortran compiler handles FLAG command line option. If |
398 dnl two arguments are specified, execute the second arg as shell | |
399 dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts | |
400 dnl the flag. | |
401 dnl | |
402 dnl OCTAVE_F77_FLAG | |
403 AC_DEFUN(OCTAVE_F77_FLAG, [ | |
404 ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` | |
405 AC_MSG_CHECKING(whether ${F77-g77} accepts $1) | |
406 AC_CACHE_VAL(octave_cv_f77_flag_$ac_safe, [ | |
407 AC_LANG_PUSH(Fortran 77) | |
408 XFFLAGS="$FFLAGS" | |
409 FFLAGS="$FFLAGS $1" | |
5177 | 410 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
5076 | 411 eval "octave_cv_f77_flag_$ac_safe=yes", |
412 eval "octave_cv_f77_flag_$ac_safe=no") | |
413 FFLAGS="$XFFLAGS" | |
414 AC_LANG_POP(Fortran 77) | |
415 ]) | |
416 if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then | |
417 AC_MSG_RESULT(yes) | |
418 ifelse([$2], , [ | |
419 FFLAGS="$FFLAGS $1" | |
420 AC_MSG_RESULT([adding $1 to FFLAGS])], [$2]) | |
421 else | |
422 AC_MSG_RESULT(no) | |
423 ifelse([$3], , , [$3]) | |
424 fi | |
425 ]) | |
426 dnl | |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
427 dnl |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
428 dnl |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
429 dnl OCTAVE_CHECK_LIBRARY(LIBRARY, DOC-NAME, WARN-MSG, HEADER, FUNC, |
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
430 dnl LANG, DOC-STRING, EXTRA-CHECK) |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
431 AC_DEFUN(OCTAVE_CHECK_LIBRARY, [ |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
432 AC_ARG_WITH([$1-includedir], |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
433 [AS_HELP_STRING([--with-$1-includedir=DIR], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
434 [look for $2 include files in DIR])], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
435 [m4_toupper([$1])_CPPFLAGS="-I$withval"]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
436 AC_SUBST(m4_toupper([$1])_CPPFLAGS) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
437 |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
438 AC_ARG_WITH([$1-libdir], |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
439 [AS_HELP_STRING([--with-$1-libdir=DIR], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
440 [look for $2 libraries in DIR])], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
441 [m4_toupper([$1])_LDFLAGS="-L$withval"]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
442 AC_SUBST(m4_toupper([$1])_LDFLAGS) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
443 |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
444 AC_ARG_WITH([$1], |
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
445 [m4_ifblank([$7], |
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
446 [AS_HELP_STRING([--without-$1], [don't use $2 library])], |
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
447 [AS_HELP_STRING([--without-$1], [$7])])], |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
448 with_$1=$withval, with_$1=yes) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
449 |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
450 m4_toupper([$1])_LIBS= |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
451 case $with_$1 in |
9539
41a74dcd14df
Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents:
9531
diff
changeset
|
452 no) |
41a74dcd14df
Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents:
9531
diff
changeset
|
453 m4_toupper([$1])_LIBS= |
41a74dcd14df
Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents:
9531
diff
changeset
|
454 ;; |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
455 yes | "") |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
456 m4_toupper([$1])_LIBS="-l$1" |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
457 ;; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
458 -* | */* | *.a | *.so | *.so.* | *.o) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
459 m4_toupper([$1])_LIBS="$with_$1" |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
460 ;; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
461 *) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
462 m4_toupper([$1])_LIBS="-l$with_$1" |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
463 ;; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
464 esac |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
465 |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
466 [TEXINFO_]m4_toupper([$1])= |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
467 warn_$1="$3" |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
468 if test -n "$m4_toupper([$1])_LIBS"; then |
9540
79b5fe2d5646
use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents:
9539
diff
changeset
|
469 octave_check_library_save_CPPFLAGS="$CPPFLAGS" |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
470 CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS" |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
471 m4_ifnblank([$6], [AC_LANG_PUSH($6)]) |
9568
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
472 octave_$1_check_for_lib=false |
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
473 m4_ifblank([$4], [octave_$1_check_for_lib=true], |
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
474 [AC_CHECK_HEADERS($4, [octave_$1_check_for_lib=true; break])]) |
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
475 if $octave_$1_check_for_lib; then |
9540
79b5fe2d5646
use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents:
9539
diff
changeset
|
476 octave_check_library_save_LDFLAGS="$LDFLAGS" |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
477 LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS" |
9540
79b5fe2d5646
use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents:
9539
diff
changeset
|
478 octave_check_library_save_LIBS="$LIBS" |
9520
bd5909b89457
fix OCTAVE_CHECK_LIBRARY
Jaroslav Hajek <highegg@gmail.com>
parents:
9519
diff
changeset
|
479 LIBS="$m4_toupper([$1])_LIBS $LIBS" |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
480 octave_$1_ok=no |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
481 AC_MSG_CHECKING([for $5 in $m4_toupper([$1])_LIBS]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
482 AC_LINK_IFELSE([AC_LANG_CALL([], [$5])], |
9539
41a74dcd14df
Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents:
9531
diff
changeset
|
483 [octave_$1_ok=yes]) |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
484 AC_MSG_RESULT($octave_$1_ok) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
485 if test $octave_$1_ok = yes; then |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
486 m4_ifblank([$8], [ |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
487 warn_$1= |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
488 AC_DEFINE([HAVE_]m4_toupper([$1]), 1, |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
489 [Define if $2 is available.]) |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
490 [TEXINFO_]m4_toupper([$1])="@set [HAVE_]m4_toupper([$1])"], [$8]) |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
491 fi |
9540
79b5fe2d5646
use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents:
9539
diff
changeset
|
492 LIBS="$octave_check_library_save_LIBS" |
9568
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
493 LDFLAGS="$octave_check_library_save_LDFLAGS" |
d3fccc4c4b9e
use OCTAVE_CHECK_LIBRARY to check for ARPACK
John W. Eaton <jwe@octave.org>
parents:
9543
diff
changeset
|
494 fi |
9523
0ce82753dd72
more configure changes for libraries
John W. Eaton <jwe@octave.org>
parents:
9520
diff
changeset
|
495 m4_ifnblank([$6], [AC_LANG_POP($6)]) |
9540
79b5fe2d5646
use Z_LIBS in checks for curl and glpk libraries
John W. Eaton <jwe@octave.org>
parents:
9539
diff
changeset
|
496 CPPFLAGS="$octave_check_library_save_CPPFLAGS" |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
497 fi |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
498 AC_SUBST(m4_toupper([$1])_LIBS) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
499 AC_SUBST([TEXINFO_]m4_toupper([$1])) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
500 if test -n "$warn_$1"; then |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
501 AC_MSG_WARN($warn_$1) |
9539
41a74dcd14df
Clear QHULL_LIBS etc on errors. Interpret --without-qhull etc correctly.
David Grundberg <individ@acc.umu.se>
parents:
9531
diff
changeset
|
502 m4_toupper([$1])_LIBS= |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
503 fi |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
504 ]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
505 dnl |
3729 | 506 dnl Check for flex |
507 dnl | |
508 AC_DEFUN(OCTAVE_PROG_FLEX, [ | |
509 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in | |
510 ### it, and it might not be installed. | |
511 ### | |
512 ### Also make sure that we generate an interactive scanner if we are | |
513 ### using flex. | |
514 AC_PROG_LEX | |
515 case "$LEX" in | |
516 flex*) | |
517 LFLAGS="-t -I" | |
518 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) | |
519 LEXLIB= | |
520 ;; | |
521 *) | |
522 LEX='$(top_srcdir)/missing flex' | |
523 warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc" | |
524 AC_MSG_WARN($warn_flex) | |
525 ;; | |
526 esac | |
527 AC_SUBST(LFLAGS) | |
528 ]) | |
529 dnl | |
530 dnl Check for bison | |
531 dnl | |
532 AC_DEFUN(OCTAVE_PROG_BISON, [ | |
533 AC_PROG_YACC | |
534 case "$YACC" in | |
535 bison*) | |
536 ;; | |
537 *) | |
538 YACC='$(top_srcdir)/missing bison' | |
539 warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc" | |
540 AC_MSG_WARN($warn_bison) | |
541 ;; | |
542 esac | |
543 ]) | |
544 dnl | |
3130 | 545 dnl What pager should we use? |
546 dnl | |
547 AC_DEFUN(OCTAVE_PROG_PAGER, | |
548 [if test "$cross_compiling" = yes; then | |
549 DEFAULT_PAGER=less | |
550 AC_MSG_RESULT(assuming $DEFAULT_PAGER exists on $canonical_host_type host) | |
551 AC_SUBST(DEFAULT_PAGER) | |
552 else | |
553 octave_possible_pagers="less more page pg" | |
554 case "$canonical_host_type" in | |
6103 | 555 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc) |
3130 | 556 octave_possible_pagers="$octave_possible_pagers more.com" |
557 ;; | |
558 esac | |
559 | |
560 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) | |
561 if test -z "$DEFAULT_PAGER"; then | |
562 warn_less="I couldn't find \`less', \`more', \`page', or \`pg'" | |
563 AC_MSG_WARN($warn_less) | |
564 fi | |
565 fi | |
566 ]) | |
567 dnl | |
6821 | 568 dnl Does gnuplot exist? |
3130 | 569 dnl |
4098 | 570 AC_DEFUN(OCTAVE_PROG_GNUPLOT, [ |
571 case "$canonical_host_type" in | |
6103 | 572 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc) |
4098 | 573 gp_names="pgnuplot pipe-gnuplot gnuplot" |
574 gp_default=pgnuplot | |
575 ;; | |
576 *) | |
577 gp_names=gnuplot | |
578 gp_default=gnuplot | |
579 ;; | |
580 esac | |
581 if test "$cross_compiling" = yes; then | |
7361 | 582 GNUPLOT="$gp_default" |
583 AC_MSG_RESULT(assuming $GNUPLOT exists on $canonical_host_type host) | |
3130 | 584 else |
7361 | 585 AC_CHECK_PROGS(GNUPLOT, $gp_names) |
586 if test -z "$GNUPLOT"; then | |
5513 | 587 warn_gnuplot=yes |
3130 | 588 |
7361 | 589 GNUPLOT="$gp_default" |
5076 | 590 |
3130 | 591 ## If you change this text, be sure to also copy it to the set of |
592 ## warnings at the end of the script | |
593 | |
594 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) | |
595 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) | |
596 AC_MSG_WARN([plotting commands without it.]) | |
597 AC_MSG_WARN([]) | |
598 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) | |
599 AC_MSG_WARN([tell Octave where to find it by typing the command]) | |
600 AC_MSG_WARN([]) | |
601 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) | |
602 AC_MSG_WARN([]) | |
603 AC_MSG_WARN([at the Octave prompt.]) | |
5076 | 604 AC_MSG_WARN([]) |
7361 | 605 AC_MSG_WARN([Setting default value to $GNUPLOT]) |
3130 | 606 fi |
607 fi | |
7361 | 608 AC_SUBST(GNUPLOT) |
3130 | 609 ]) |
610 dnl | |
3673 | 611 dnl Is gperf installed? |
612 dnl | |
613 dnl OCTAVE_PROG_GPERF | |
3731 | 614 AC_DEFUN(OCTAVE_PROG_GPERF, [ |
6119 | 615 AC_CHECK_PROG(GPERF, gperf, gperf, []) |
8775
a2a9dc5e8565
octave.gperf: eliminate whitespace to allow gperf 2.7.2 to work
John W. Eaton <jwe@octave.org>
parents:
8724
diff
changeset
|
616 if test -z "$GPERF"; then |
3731 | 617 GPERF='$(top_srcdir)/missing gperf' |
618 warn_gperf="I didn't find gperf, but it's only a problem if you need to reconstruct oct-gperf.h" | |
619 AC_MSG_WARN($warn_gperf) | |
620 fi | |
621 AC_SUBST(GPERF) | |
3673 | 622 ]) |
623 dnl | |
5934 | 624 dnl Is ghostscript installed? |
625 dnl | |
626 dnl OCTAVE_PROG_GHOSTSCRIPT | |
627 AC_DEFUN(OCTAVE_PROG_GHOSTSCRIPT, [ | |
6116 | 628 case "$canonical_host_type" in |
629 *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc) | |
630 gs_names="gs gswin32" | |
631 ;; | |
632 *) | |
633 gs_names=gs | |
634 ;; | |
635 esac | |
636 AC_CHECK_PROGS(GHOSTSCRIPT, $gs_names) | |
5934 | 637 if test -z "$GHOSTSCRIPT"; then |
638 GHOSTSCRIPT='$(top_srcdir)/missing gs' | |
639 warn_ghostscript="I didn't find ghostscript, but it's only a problem if you need to reconstruct figures for the manual" | |
640 AC_MSG_WARN($warn_ghostscript) | |
641 fi | |
642 AC_SUBST(GHOSTSCRIPT) | |
643 ]) | |
644 dnl | |
645 dnl Is makeinfo installed? | |
646 dnl | |
647 dnl OCTAVE_PROG_MAKEINFO | |
648 AC_DEFUN(OCTAVE_PROG_MAKEINFO, [ | |
6119 | 649 AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, []) |
5934 | 650 if test -z "$MAKEINFO"; then |
651 MAKEINFO='$(top_srcdir)/missing makeinfo' | |
652 warn_makeinfo="I didn't find makeinfo, but it's only a problem if you need to reconstruct the Info version of the manual" | |
653 AC_MSG_WARN($warn_makeinfo) | |
654 fi | |
655 AC_SUBST(MAKEINFO) | |
656 ]) | |
657 dnl | |
658 dnl Is texi2dvi installed? | |
659 dnl | |
660 dnl OCTAVE_PROG_TEXI2DVI | |
661 AC_DEFUN(OCTAVE_PROG_TEXI2DVI, [ | |
6119 | 662 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, []) |
5934 | 663 if test -z "$TEXI2DVI"; then |
664 TEXI2DVI='$(top_srcdir)/missing texi2dvi' | |
665 warn_texi2dvi="I didn't find texi2dvi, but it's only a problem if you need to reconstruct the DVI version of the manual" | |
666 AC_MSG_WARN($warn_texi2dvi) | |
667 fi | |
668 AC_SUBST(TEXI2DVI) | |
669 ]) | |
670 dnl | |
671 dnl Is texi2pdf installed? | |
672 dnl | |
673 dnl OCTAVE_PROG_TEXI2PDF | |
674 AC_DEFUN(OCTAVE_PROG_TEXI2PDF, [ | |
6116 | 675 AC_REQUIRE([OCTAVE_PROG_TEXI2DVI]) |
6119 | 676 AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, []) |
5934 | 677 if test -z "$TEXI2PDF"; then |
6116 | 678 missing=true; |
679 if test -n "$TEXI2DVI"; then | |
680 TEXI2PDF="$TEXI2DVI --pdf" | |
681 missing=false; | |
682 fi | |
683 else | |
684 missing=false; | |
685 fi | |
686 if $missing; then | |
5934 | 687 TEXI2PDF='$(top_srcdir)/missing texi2pdf' |
688 warn_texi2pdf="I didn't find texi2pdf, but it's only a problem if you need to reconstruct the PDF version of the manual" | |
689 AC_MSG_WARN($warn_texi2pdf) | |
690 fi | |
691 AC_SUBST(TEXI2PDF) | |
692 ]) | |
693 dnl | |
3769 | 694 dnl See if the C++ library is ISO compliant. |
695 dnl FIXME: This is obviously very simplistic, and trivially fooled. | |
696 dnl | |
697 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY | |
698 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [ | |
699 AC_REQUIRE([AC_PROG_CXX]) | |
700 AC_MSG_CHECKING([if C++ library is ISO compliant]) | |
701 AC_CACHE_VAL(octave_cv_cxx_iso_compliant_library, [ | |
3888 | 702 AC_LANG_PUSH(C++) |
3769 | 703 rm -f conftest.h |
3943 | 704 ### Omitting cwctype for now, since it is broken with gcc-3.0.x and |
705 ### possibly other versions... | |
3769 | 706 for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \ |
707 climits clocale cmath complex csetjmp csignal cstdarg cstddef \ | |
3943 | 708 cstdio cstdlib cstring ctime cwchar deque exception \ |
3769 | 709 fstream functional iomanip ios iosfwd iostream istream iterator \ |
710 limits list locale map memory new numeric ostream queue set \ | |
711 sstream stack stdexcept streambuf string strstream typeinfo \ | |
712 utility valarray vector; do | |
713 echo "#include <$inc>" >> conftest.h | |
714 done | |
5842 | 715 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]], |
716 [[std::bitset<50> flags; | |
3769 | 717 flags.set(); |
718 int digits = std::numeric_limits<unsigned long>::digits; | |
5842 | 719 digits = 0;]])], |
720 [octave_cv_cxx_iso_compliant_library=yes], | |
721 [octave_cv_cxx_iso_compliant_library=no]) | |
3888 | 722 AC_LANG_POP(C++) |
3769 | 723 ]) |
724 AC_MSG_RESULT($octave_cv_cxx_iso_compliant_library) | |
725 if test $octave_cv_cxx_iso_compliant_library = yes; then | |
3887 | 726 AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, [Define if your C++ runtime library is ISO compliant.]) |
3769 | 727 fi |
728 ]) | |
3822 | 729 dnl |
730 dnl Allow the user disable support for command line editing using GNU | |
731 dnl readline. | |
732 dnl | |
733 dnl OCTAVE_ENABLE_READLINE | |
734 AC_DEFUN(OCTAVE_ENABLE_READLINE, [ | |
735 USE_READLINE=true | |
9515 | 736 READLINE_LIBS= |
3822 | 737 AC_ARG_ENABLE(readline, |
738 [ --enable-readline use readline library (default is yes)], | |
739 [if test "$enableval" = no; then | |
3824 | 740 USE_READLINE=false |
3825 | 741 warn_readline="command editing and history features require GNU Readline" |
3824 | 742 fi]) |
3822 | 743 if $USE_READLINE; then |
9515 | 744 save_LIBS="$LIBS" |
745 LIBS="$TERM_LIBS" | |
3822 | 746 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [ |
9515 | 747 READLINE_LIBS="-lreadline" |
3887 | 748 AC_DEFINE(USE_READLINE, 1, [Define to use the readline library.]) |
3822 | 749 ], [ |
3824 | 750 AC_MSG_WARN([I need GNU Readline 4.2 or later]) |
751 AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) | |
3822 | 752 ]) |
9515 | 753 LIBS="$save_LIBS" |
3822 | 754 fi |
9515 | 755 AC_SUBST(READLINE_LIBS) |
3822 | 756 ]) |
3842 | 757 dnl |
5854 | 758 dnl Check to see if C++ reintrepret cast works for function pointers. |
759 dnl | |
760 dnl OCTAVE_CXX_BROKEN_REINTERPRET_CAST | |
761 dnl | |
762 AC_DEFUN(OCTAVE_CXX_BROKEN_REINTERPRET_CAST, [ | |
763 AC_REQUIRE([AC_PROG_CXX]) | |
764 AC_LANG_PUSH(C++) | |
765 AC_CACHE_CHECK([for broken C++ reinterpret_cast], | |
766 octave_cv_cxx_broken_reinterpret_cast, [ | |
767 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>]], [[ | |
768 typedef double (*fptr) (double); | |
769 fptr psin = sin; | |
770 void *vptr = reinterpret_cast<void *> (psin); | |
771 psin = reinterpret_cast<fptr> (vptr);]])], | |
772 octave_cv_cxx_broken_reinterpret_cast=no, | |
773 octave_cv_cxx_broken_reinterpret_cast=yes)]) | |
774 if test $octave_cv_cxx_broken_reinterpret_cast = yes ; then | |
775 AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1, [Define if C++ reinterpret_cast fails for function pointers.]) | |
776 fi | |
777 AC_LANG_POP(C++)]) | |
778 dnl | |
4067 | 779 dnl Determine if mkdir accepts only one argument instead dnl of the usual 2. |
780 dnl | |
6104 | 781 AC_DEFUN(OCTAVE_MKDIR_TAKES_ONE_ARG, [ |
782 AC_LANG_PUSH(C++) | |
783 AC_CACHE_CHECK([if mkdir takes one argument], octave_cv_mkdir_takes_one_arg, | |
5844 | 784 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
4067 | 785 #ifdef HAVE_SYS_STAT_H |
786 # include <sys/stat.h> | |
787 #endif | |
788 #ifdef HAVE_UNISTD_H | |
789 # include <unistd.h> | |
790 #endif | |
791 #ifdef HAVE_DIRECT_H | |
792 # include <direct.h> | |
5844 | 793 #endif]], [[mkdir ("foo", 0);]])], |
4067 | 794 octave_cv_mkdir_takes_one_arg=no, octave_cv_mkdir_takes_one_arg=yes)]) |
6104 | 795 AC_LANG_POP(C++) |
4067 | 796 if test $octave_cv_mkdir_takes_one_arg = yes ; then |
797 AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.]) | |
798 fi | |
799 ]) | |
7244 | 800 dnl |
801 dnl Find find. | |
802 dnl | |
803 # Prefer GNU find if found. | |
804 AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND]) | |
805 AN_PROGRAM([gfind], [OCTAVE_PROG_FIND]) | |
806 AN_PROGRAM([find], [OCTAVE_PROG_FIND]) | |
807 AC_DEFUN([OCTAVE_PROG_FIND], | |
808 [AC_CHECK_PROGS(FIND, gfind find, )]) | |
809 dnl | |
810 dnl Find sed. | |
811 dnl | |
4084 | 812 # Check for a fully-functional sed program, that truncates |
6955 | 813 # as few characters as possible and that supports "\(X\|Y\)" |
814 # style regular expression alternation. Prefer GNU sed if found. | |
4084 | 815 AC_DEFUN([OCTAVE_PROG_SED], |
6955 | 816 [AC_MSG_CHECKING([for a usable sed]) |
4084 | 817 if test -z "$SED"; then |
6822 | 818 AC_CACHE_VAL(ac_cv_path_sed, [ |
819 # Loop through the user's path and test for sed and gsed. | |
820 # Then use that list of sed's as ones to test for truncation. | |
821 _AS_PATH_WALK([$PATH], | |
822 [for ac_prog in sed gsed; do | |
823 for ac_exec_ext in '' $ac_executable_extensions; do | |
824 if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then | |
825 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" | |
826 fi | |
827 done | |
4084 | 828 done |
6822 | 829 ]) |
830 AS_TMPDIR(sed) | |
831 _max=0 | |
4084 | 832 _count=0 |
6822 | 833 # Add /usr/xpg4/bin/sed as it is typically found on Solaris |
834 # along with /bin/sed that truncates output. | |
835 for _sed in $_sed_list /usr/xpg4/bin/sed; do | |
836 test ! -f ${_sed} && break | |
837 cat /dev/null > "$tmp/sed.in" | |
838 _count=0 | |
839 echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" | |
840 # Check for GNU sed and select it if it is found. | |
841 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then | |
842 octave_cv_path_sed=${_sed} | |
843 break; | |
4084 | 844 fi |
6955 | 845 # Reject if RE alternation is not handled. |
846 if test "`echo 'this and that' | ${_sed} -n 's/\(this\|that\).*$/\1/p'`" != "this"; then | |
847 continue; | |
848 fi | |
6822 | 849 while true; do |
850 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" | |
851 mv "$tmp/sed.tmp" "$tmp/sed.in" | |
852 cp "$tmp/sed.in" "$tmp/sed.nl" | |
853 echo >>"$tmp/sed.nl" | |
854 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break | |
855 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break | |
856 # 10000 chars as input seems more than enough | |
857 test $_count -gt 10 && break | |
858 _count=`expr $_count + 1` | |
859 if test $_count -gt $_max; then | |
860 _max=$_count | |
861 octave_cv_path_sed=$_sed | |
862 fi | |
863 done | |
4084 | 864 done |
6822 | 865 rm -rf "$tmp" |
866 ]) | |
867 SED=$octave_cv_path_sed | |
8004
4363bc94171a
aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents:
7996
diff
changeset
|
868 if test -z "$SED"; then |
4363bc94171a
aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents:
7996
diff
changeset
|
869 AC_MSG_ERROR([no usable version of sed found]) |
4363bc94171a
aclocal.m4 (OCTAVE_PROG_SED): fail if no usable sed is found
John W. Eaton <jwe@octave.org>
parents:
7996
diff
changeset
|
870 fi |
4084 | 871 fi |
6822 | 872 AC_SUBST(SED) |
4084 | 873 AC_MSG_RESULT([$SED]) |
874 ]) | |
5465 | 875 dnl |
876 dnl Find Perl. | |
877 dnl | |
878 dnl OCTAVE_PROG_PERL | |
879 AC_DEFUN(OCTAVE_PROG_PERL, | |
6119 | 880 [AC_CHECK_PROG(PERL, perl, perl, []) |
5465 | 881 AC_SUBST(PERL) |
882 ]) | |
5468 | 883 dnl |
5495 | 884 dnl Find Python. |
885 dnl | |
886 dnl OCTAVE_PROG_PYTHON | |
887 AC_DEFUN(OCTAVE_PROG_PYTHON, | |
6119 | 888 [AC_CHECK_PROG(PYTHON, python, python, []) |
5495 | 889 AC_SUBST(PYTHON) |
890 ]) | |
891 dnl | |
5468 | 892 dnl Find desktop-file-install. |
893 dnl | |
894 dnl OCTAVE_PROG_DESKTOP_FILE_INSTALL | |
895 AC_DEFUN(OCTAVE_PROG_DESKTOP_FILE_INSTALL, | |
6119 | 896 [AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, []) |
5468 | 897 AC_SUBST(DESKTOP_FILE_INSTALL) |
898 ]) | |
899 dnl | |
900 dnl Check for IEEE 754 data format. | |
901 dnl | |
4853 | 902 AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], |
903 [AC_MSG_CHECKING([for IEEE 754 data format]) | |
904 AC_CACHE_VAL(octave_cv_ieee754_data_format, | |
5844 | 905 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
4853 | 906 int |
907 main (void) | |
908 { | |
909 typedef union { unsigned char c[8]; double d; } ieeebytes; | |
910 | |
911 ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}; | |
912 ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}; | |
913 | |
914 return l.d != 1234567891234567.0 && b.d != 1234567891234567.0; | |
5844 | 915 }]])], |
4853 | 916 octave_cv_ieee754_data_format=yes, |
917 octave_cv_ieee754_data_format=no, | |
918 octave_cv_ieee754_data_format=no)]) | |
919 if test "$cross_compiling" = yes; then | |
920 AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation]) | |
921 else | |
922 AC_MSG_RESULT($octave_cv_ieee754_data_format) | |
923 fi | |
924 if test "$octave_cv_ieee754_data_format" = yes; then | |
925 AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, [Define if your system uses IEEE 754 data format.]) | |
926 fi | |
927 ]) | |
5505 | 928 dnl |
929 dnl Check for UMFPACK seperately split complex matrix and RHS. Note | |
930 dnl that as umfpack.h can be in three different places, rather than | |
931 dnl include it, just declare the functions needed. | |
932 dnl | |
5512 | 933 dnl Assumes that the check for umfpack has already been performed. |
5505 | 934 dnl |
935 AC_DEFUN([OCTAVE_UMFPACK_SEPERATE_SPLIT], | |
936 [AC_MSG_CHECKING([for UMFPACK seperate complex matrix and rhs split]) | |
937 AC_CACHE_VAL(octave_cv_umfpack_seperate_split, | |
5844 | 938 [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
5505 | 939 #include <stdlib.h> |
5512 | 940 #if defined (HAVE_UFSPARSE_UMFPACK_h) |
941 #include <ufsparse/umfpack.h> | |
942 #elif defined (HAVE_UMFPACK_UMFPACK_H) | |
943 #include <umfpack/umfpack.h> | |
944 #elif defined (HAVE_UMFPACK_H) | |
945 #include <umfpack.h> | |
946 #endif | |
5505 | 947 int n = 5; |
948 int Ap[] = {0, 2, 5, 9, 10, 12}; | |
949 int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4}; | |
950 double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., | |
951 -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.}; | |
952 double br[] = {8., 45., -3., 3., 19.}; | |
953 double bi[] = {0., 0., 0., 0., 0.}; | |
954 int main (void) | |
955 { | |
956 double *null = (double *) NULL ; | |
957 double *x = (double *)malloc (2 * n * sizeof(double)); | |
958 int i ; | |
959 void *Symbolic, *Numeric ; | |
960 (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ; | |
961 (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ; | |
962 umfpack_zi_free_symbolic (&Symbolic) ; | |
963 (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi, | |
964 Numeric, null, null) ; | |
965 umfpack_zi_free_numeric (&Numeric) ; | |
966 for (i = 0; i < n; i++, x+=2) | |
967 if (fabs(*x - i - 1.) > 1.e-13) | |
968 return (1); | |
969 return (0) ; | |
970 } | |
5844 | 971 ]])], |
5505 | 972 octave_cv_umfpack_seperate_split=yes, |
973 octave_cv_umfpack_seperate_split=no, | |
974 octave_cv_umfpack_seperate_split=no)]) | |
975 if test "$cross_compiling" = yes; then | |
976 AC_MSG_RESULT([$octave_cv_umfpack_seperate_split assumed for cross compilation]) | |
977 else | |
978 AC_MSG_RESULT($octave_cv_umfpack_seperate_split) | |
979 fi | |
980 if test "$octave_cv_umfpack_seperate_split" = yes; then | |
981 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define if the UMFPACK Complex solver allow matrix and RHS to be split independently]) | |
982 fi | |
983 ]) | |
6276 | 984 dnl |
985 dnl Check whether using HDF5 DLL under Windows. This is done by | |
986 dnl testing for a data symbol in the HDF5 library, which would | |
987 dnl requires the definition of _HDF5USEDL_ under MSVC compiler. | |
988 dnl | |
989 AC_DEFUN([OCTAVE_HDF5_DLL], [ | |
990 AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined],octave_cv_hdf5_dll, [ | |
6724 | 991 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE; return x], |
6276 | 992 octave_cv_hdf5_dll=no, [ |
9531
b859079d1644
configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9525
diff
changeset
|
993 save_CFLAGS="$CFLAGS" |
6276 | 994 CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_" |
9531
b859079d1644
configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9525
diff
changeset
|
995 save_LIBS="$LIBS" |
b859079d1644
configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9525
diff
changeset
|
996 LIBS="$HDF5_LIBS $LIBS" |
6724 | 997 AC_TRY_LINK([#include <hdf5.h>], [hid_t x = H5T_NATIVE_DOUBLE; return x], |
6276 | 998 octave_cv_hdf5_dll=yes, |
999 octave_cv_hdf5_dll=no) | |
9531
b859079d1644
configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9525
diff
changeset
|
1000 CFLAGS="$save_CFLAGS" |
b859079d1644
configure and Makefile fixes for Windows
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9525
diff
changeset
|
1001 LIBS="$save_LIBS"])]) |
6276 | 1002 if test "$octave_cv_hdf5_dll" = yes; then |
1003 AC_DEFINE(_HDF5USEDLL_, 1, [Define if using HDF5 dll (Win32)]) | |
1004 fi]) | |
6823 | 1005 dnl |
8676 | 1006 dnl Check whether HDF5 library has version 1.6 API functions. |
1007 dnl | |
1008 AC_DEFUN([OCTAVE_HDF5_HAS_REQUIRED_API], [ | |
1009 AC_CACHE_CHECK([whether HDF5 library has required API], | |
1010 octave_cv_hdf5_has_required_api, [ | |
1011 AC_TRY_LINK([ | |
1012 #define H5_USE_16_API 1 | |
1013 #include <hdf5.h> | |
1014 ], [ | |
1015 H5Eset_auto (0, 0);], [ | |
1016 octave_cv_hdf5_has_required_api=yes], [ | |
1017 octave_cv_hdf5_has_required_api=no])]) | |
1018 if test "$octave_cv_hdf5_has_required_api" = "no"; then | |
9543
1d51ab34b509
tweaks for HDF5 library check
John W. Eaton <jwe@octave.org>
parents:
9542
diff
changeset
|
1019 octave_hdf5_ok=no |
8676 | 1020 warn_hdf5="HDF5 library does not provide the version 1.6 API. Octave will not be able to save or load HDF5 data files." |
1021 AC_MSG_WARN($warn_hdf5) | |
1022 fi | |
1023 ]) | |
1024 dnl | |
6823 | 1025 dnl Check for the QHull version. |
1026 dnl | |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1027 AC_DEFUN(OCTAVE_CHECK_QHULL_VERSION, |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1028 [AC_CACHE_CHECK([for qh_version in $QHULL_LIBS], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1029 octave_cv_lib_qhull_version, [ |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1030 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1031 #include <qhull/qhull_a.h> |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1032 ]], [[ |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1033 const char *tmp = qh_version; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1034 ]])], [octave_cv_lib_qhull_version=yes], [octave_cv_lib_qhull_version=no])]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1035 if test "$octave_cv_lib_qhull_version" = no; then |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1036 AC_DEFINE(NEED_QHULL_VERSION, 1, |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1037 [Define if the QHull library needs a qh_version variable defined.]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1038 fi |
6823 | 1039 ]) |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1040 dnl |
8659
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1041 dnl Check whether QHull works (does not crash) |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1042 dnl |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1043 AC_DEFUN(OCTAVE_CHECK_QHULL_OK, |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1044 [AC_CACHE_CHECK([whether the qhull library works], |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1045 octave_cv_lib_qhull_ok, [ |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1046 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
8659
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1047 #include <stdio.h> |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1048 #include <qhull/qhull.h> |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1049 #ifdef NEED_QHULL_VERSION |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1050 char *qh_version = "version"; |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1051 #endif |
9519
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1052 ]], [[ |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1053 int dim = 2; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1054 int n = 4; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1055 coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 }; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1056 boolT ismalloc = 0; |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1057 return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1058 ]])], [octave_cv_lib_qhull_ok=yes], [octave_cv_lib_qhull_ok=no])]) |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1059 if test "$octave_cv_lib_qhull_ok" = "yes"; then |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1060 $1 |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1061 else |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1062 $2 |
ee99f9f37505
improve configure checks for qhull and curl libs
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
1063 fi |
8659
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1064 ]) |
9792c26bffc7
configure: check whether qhull works
Jaroslav Hajek <highegg@gmail.com>
parents:
8635
diff
changeset
|
1065 dnl |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1066 dnl Check for OpenGL. If found, define OPENGL_LIBS |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1067 dnl |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1068 AC_DEFUN([OCTAVE_OPENGL], [ |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1069 OPENGL_LIBS= |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1070 |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1071 ### On MacOSX systems the OpenGL framework can be used |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1072 OCTAVE_HAVE_FRAMEWORK(OpenGL, [ |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1073 #include <OpenGL/gl.h> |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1074 #include <OpenGL/glu.h> ], [GLint par; glGetIntegerv (GL_VIEWPORT, &par);], |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1075 [have_framework_opengl="yes"], [have_framework_opengl="no"]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1076 |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1077 if test $have_framework_opengl = "yes"; then |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1078 AC_DEFINE(HAVE_FRAMEWORK_OPENGL, 1, [Define if framework OPENGL is available.]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1079 OPENGL_LIBS="-Wl,-framework -Wl,OpenGL" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1080 AC_MSG_NOTICE([adding -Wl,-framework -Wl,OpenGL to OPENGL_LIBS]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1081 OCTAVE_GLUTESSCALLBACK_THREEDOTS |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1082 else |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1083 case $canonical_host_type in |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1084 *-*-mingw32* | *-*-msdosmsvc) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1085 AC_CHECK_HEADERS(windows.h) |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1086 ;; |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1087 esac |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1088 have_opengl_incs=no |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1089 AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], [ |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1090 AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], [ |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1091 have_opengl_incs=yes; break], [], [ |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1092 #ifdef HAVE_WINDOWS_H |
7954 | 1093 #include <windows.h> |
1094 #endif | |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1095 ]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1096 break |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1097 ], [], [ |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1098 #ifdef HAVE_WINDOWS_H |
7954 | 1099 #include <windows.h> |
1100 #endif | |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1101 ]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1102 |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1103 if test "$have_opengl_incs" = "yes"; then |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1104 case $canonical_host_type in |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1105 *-*-mingw32* | *-*-msdosmsvc) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1106 save_LIBS="$LIBS" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1107 LIBS="$LIBS -lopengl32" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1108 AC_MSG_CHECKING([for glEnable in -lopengl32]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1109 AC_TRY_LINK([ |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1110 #if HAVE_WINDOWS_H |
7954 | 1111 #include <windows.h> |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1112 #endif |
7954 | 1113 #if defined (HAVE_GL_GL_H) |
1114 #include <GL/gl.h> | |
1115 #elif defined (HAVE_OPENGL_GL_H) | |
1116 #include <OpenGL/gl.h> | |
1117 #endif | |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1118 ], [glEnable(GL_SMOOTH);], OPENGL_LIBS="-lopengl32 -lglu32") |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1119 LIBS="$save_LIBS" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1120 if test "x$OPENGL_LIBS" != "x"; then |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1121 AC_MSG_RESULT(yes) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1122 else |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1123 AC_MSG_RESULT(no) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1124 fi |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1125 ;; |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1126 *) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1127 save_LDFLAGS="$LDFLAGS" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1128 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1129 AC_CHECK_LIB(GL, glEnable, OPENGL_LIBS="-L/usr/X11R6/lib -lGL -lGLU") |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1130 LDFLAGS="$save_LDFLAGS" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1131 ;; |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1132 esac |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1133 fi |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1134 fi |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1135 AC_SUBST(OPENGL_LIBS) |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7361
diff
changeset
|
1136 ]) |
7834
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1137 dnl |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1138 dnl See if function gluTessCallback is called with "(...)" |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1139 dnl |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1140 dnl OCTAVE_GLUTESSCALLBACK_THREEDOTS |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1141 AC_DEFUN(OCTAVE_GLUTESSCALLBACK_THREEDOTS, |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1142 [AC_CACHE_CHECK([whether gluTessCallback is called with "(...)"], |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1143 octave_cv_glutesscallback_threedots, |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1144 [AC_LANG_PUSH(C++) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1145 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1146 #ifdef HAVE_GL_GLU_H |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1147 #include <GL/glu.h> |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1148 #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1149 #include <OpenGL/glu.h> |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1150 #endif]], |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1151 [[GLvoid (*func)(...); gluTessCallback(0, 0, func);]])], |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1152 octave_cv_glutesscallback_threedots="yes", octave_cv_glutesscallback_threedots="no")]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1153 AC_LANG_POP(C++) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1154 if test $octave_cv_glutesscallback_threedots = "yes"; then |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1155 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1156 [Define if gluTessCallback is called with (...)]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1157 fi |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1158 ]) |
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8676
diff
changeset
|
1159 dnl |
7834
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1160 dnl Configure paths for FreeType2 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1161 dnl Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1162 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1163 dnl Copyright 2001, 2003 by |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1164 dnl David Turner, Robert Wilhelm, and Werner Lemberg. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1165 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1166 dnl This file is part of the FreeType project, and may only be used, modified, |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1167 dnl and distributed under the terms of the FreeType project license, |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1168 dnl LICENSE.TXT. By continuing to use, modify, or distribute this file you |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1169 dnl indicate that you have read the license and understand and accept it |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1170 dnl fully. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1171 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1172 dnl As a special exception to the FreeType project license, this file may be |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1173 dnl distributed as part of a program that contains a configuration script |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1174 dnl generated by Autoconf, under the same distribution terms as the rest of |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1175 dnl that program. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1176 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1177 dnl serial 2 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1178 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1179 dnl AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1180 dnl Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1181 dnl MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1182 dnl FreeType 2.0.4). |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1183 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1184 AC_DEFUN([AC_CHECK_FT2], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1185 [dnl Get the cflags and libraries from the freetype-config script |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1186 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1187 AC_ARG_WITH([ft-prefix], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1188 dnl don't quote AS_HELP_STRING! |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1189 AS_HELP_STRING([--with-ft-prefix=PREFIX], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1190 [Prefix where FreeType is installed (optional)]), |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1191 [ft_config_prefix="$withval"], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1192 [ft_config_prefix=""]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1193 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1194 AC_ARG_WITH([ft-exec-prefix], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1195 dnl don't quote AS_HELP_STRING! |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1196 AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1197 [Exec prefix where FreeType is installed (optional)]), |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1198 [ft_config_exec_prefix="$withval"], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1199 [ft_config_exec_prefix=""]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1200 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1201 AC_ARG_ENABLE([freetypetest], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1202 dnl don't quote AS_HELP_STRING! |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1203 AS_HELP_STRING([--disable-freetypetest], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1204 [Do not try to compile and run a test FreeType program]), |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1205 [], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1206 [enable_fttest=yes]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1207 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1208 if test x$ft_config_exec_prefix != x ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1209 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1210 if test x${FT2_CONFIG+set} != xset ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1211 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1212 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1213 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1214 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1215 if test x$ft_config_prefix != x ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1216 ft_config_args="$ft_config_args --prefix=$ft_config_prefix" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1217 if test x${FT2_CONFIG+set} != xset ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1218 FT2_CONFIG=$ft_config_prefix/bin/freetype-config |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1219 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1220 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1221 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1222 AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1223 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1224 min_ft_version=m4_if([$1], [], [7.0.1], [$1]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1225 AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1226 no_ft="" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1227 if test "$FT2_CONFIG" = "no" ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1228 no_ft=yes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1229 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1230 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1231 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1232 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1233 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1234 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1235 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1236 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1237 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1238 ft_min_major_version=`echo $min_ft_version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1239 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1240 ft_min_minor_version=`echo $min_ft_version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1241 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1242 ft_min_micro_version=`echo $min_ft_version | \ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1243 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1244 if test x$enable_fttest = xyes ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1245 ft_config_is_lt="" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1246 if test $ft_config_major_version -lt $ft_min_major_version ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1247 ft_config_is_lt=yes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1248 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1249 if test $ft_config_major_version -eq $ft_min_major_version ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1250 if test $ft_config_minor_version -lt $ft_min_minor_version ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1251 ft_config_is_lt=yes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1252 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1253 if test $ft_config_minor_version -eq $ft_min_minor_version ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1254 if test $ft_config_micro_version -lt $ft_min_micro_version ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1255 ft_config_is_lt=yes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1256 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1257 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1258 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1259 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1260 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1261 if test x$ft_config_is_lt = xyes ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1262 no_ft=yes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1263 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1264 ac_save_CFLAGS="$CFLAGS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1265 ac_save_LIBS="$LIBS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1266 CFLAGS="$CFLAGS $FT2_CFLAGS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1267 LIBS="$FT2_LIBS $LIBS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1268 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1269 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1270 dnl Sanity checks for the results of freetype-config to some extent. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1271 dnl |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1272 AC_RUN_IFELSE([ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1273 AC_LANG_SOURCE([[ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1274 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1275 #include <ft2build.h> |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1276 #include FT_FREETYPE_H |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1277 #include <stdio.h> |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1278 #include <stdlib.h> |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1279 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1280 int |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1281 main() |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1282 { |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1283 FT_Library library; |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1284 FT_Error error; |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1285 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1286 error = FT_Init_FreeType(&library); |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1287 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1288 if (error) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1289 return 1; |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1290 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1291 { |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1292 FT_Done_FreeType(library); |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1293 return 0; |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1294 } |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1295 } |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1296 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1297 ]]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1298 ], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1299 [], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1300 [no_ft=yes], |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1301 [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1302 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1303 CFLAGS="$ac_save_CFLAGS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1304 LIBS="$ac_save_LIBS" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1305 fi dnl test $ft_config_version -lt $ft_min_version |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1306 fi dnl test x$enable_fttest = xyes |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1307 fi dnl test "$FT2_CONFIG" = "no" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1308 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1309 if test x$no_ft = x ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1310 AC_MSG_RESULT([yes]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1311 m4_if([$2], [], [:], [$2]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1312 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1313 AC_MSG_RESULT([no]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1314 if test "$FT2_CONFIG" = "no" ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1315 AC_MSG_WARN([ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1316 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1317 The freetype-config script installed by FreeType 2 could not be found. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1318 If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1319 your path, or set the FT2_CONFIG environment variable to the |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1320 full path to freetype-config. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1321 ]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1322 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1323 if test x$ft_config_is_lt = xyes ; then |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1324 AC_MSG_WARN([ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1325 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1326 Your installed version of the FreeType 2 library is too old. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1327 If you have different versions of FreeType 2, make sure that |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1328 correct values for --with-ft-prefix or --with-ft-exec-prefix |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1329 are used, or set the FT2_CONFIG environment variable to the |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1330 full path to freetype-config. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1331 ]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1332 else |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1333 AC_MSG_WARN([ |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1334 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1335 The FreeType test program failed to run. If your system uses |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1336 shared libraries and they are installed outside the normal |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1337 system library path, make sure the variable LD_LIBRARY_PATH |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1338 (or whatever is appropiate for your system) is correctly set. |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1339 ]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1340 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1341 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1342 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1343 FT2_CFLAGS="" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1344 FT2_LIBS="" |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1345 m4_if([$3], [], [:], [$3]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1346 fi |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1347 |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1348 AC_SUBST([FT2_CFLAGS]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1349 AC_SUBST([FT2_LIBS])]) |
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7825
diff
changeset
|
1350 dnl end of freetype2.m4 |
8169
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1351 |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1352 dnl Check whether a math mapper function is available in <cmath>. |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1353 dnl Will define HAVE_CMATH_FUNC if there is a double variant and |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1354 dnl HAVE_CMATH_FUNCF if there is a float variant. |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1355 dnl Currently capable of checking for functions with single |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1356 dnl argument and returning bool/int/real. |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1357 AC_DEFUN([OCTAVE_CMATH_FUNC],[ |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1358 AC_MSG_CHECKING([for std::$1 in <cmath>]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1359 AC_LANG_PUSH(C++) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1360 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1361 #include <cmath> |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1362 void take_func (bool (*func) (double x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1363 void take_func (int (*func) (double x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1364 void take_func (double (*func) (double x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1365 ]], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1366 [[ |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1367 take_func(std::$1); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1368 ]])], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1369 [AC_MSG_RESULT([yes]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1370 AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1),1,[Define if <cmath> provides $1])], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1371 [AC_MSG_RESULT([no])]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1372 AC_MSG_CHECKING([for std::$1 (float variant) in <cmath>]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1373 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1374 #include <cmath> |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1375 void take_func (bool (*func) (float x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1376 void take_func (int (*func) (float x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1377 void take_func (float (*func) (float x)); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1378 ]], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1379 [[ |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1380 take_func(std::$1); |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1381 ]])], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1382 [AC_MSG_RESULT([yes]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1383 AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1)F,1,[Define if <cmath> provides float variant of $1])], |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1384 [AC_MSG_RESULT([no])]) |
9049 | 1385 AC_LANG_POP(C++) |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1386 ]) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
1387 |
8169
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1388 dnl Check whether fast signed integer arithmetics using bit tricks |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1389 dnl can be used in oct-inttypes.h. Defines HAVE_FAST_INT_OPS if |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1390 dnl the following conditions hold: |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1391 dnl 1. Signed numbers are represented by twos complement |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1392 dnl (see <http://en.wikipedia.org/wiki/Two%27s_complement>) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1393 dnl 2. static_cast to unsigned int counterpart works like interpreting |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1394 dnl the signed bit pattern as unsigned (and is thus zero-cost). |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1395 dnl 3. Signed addition and subtraction yield the same bit results as unsigned. |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1396 dnl (We use casts to prevent optimization interference, so there is no |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1397 dnl need for things like -ftrapv). |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1398 dnl 4. Bit operations on signed integers work like on unsigned integers, |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1399 dnl except for the shifts. Shifts are arithmetic. |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1400 dnl |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1401 AC_DEFUN([OCTAVE_FAST_INT_OPS],[ |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1402 AC_MSG_CHECKING([whether fast integer arithmetics is usable]) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1403 AC_LANG_PUSH(C++) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1404 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1405 #include <limits> |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1406 template<class UT, class ST> |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1407 static bool |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1408 do_test (UT, ST) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1409 { |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1410 volatile ST s = std::numeric_limits<ST>::min () / 3; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1411 volatile UT u = static_cast<UT> (s); |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1412 if (*(reinterpret_cast<volatile ST *> (&u)) != s) return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1413 |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1414 u = 0; u = ~u; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1415 if (*(reinterpret_cast<volatile ST *> (&u)) != -1) return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1416 |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1417 ST sx, sy; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1418 sx = std::numeric_limits<ST>::max () / 2 + 1; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1419 sy = std::numeric_limits<ST>::max () / 2 + 2; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1420 if (static_cast<ST> (static_cast<UT> (sx) + static_cast<UT> (sy)) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1421 != std::numeric_limits<ST>::min () + 1) return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1422 if (static_cast<ST> (static_cast<UT> (sx) - static_cast<UT> (sy)) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1423 != -1) return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1424 |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1425 if ((sx & sy) != (static_cast<UT> (sx) & static_cast<UT> (sy))) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1426 return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1427 if ((sx | sy) != (static_cast<UT> (sx) | static_cast<UT> (sy))) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1428 return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1429 if ((sx ^ sy) != (static_cast<UT> (sx) ^ static_cast<UT> (sy))) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1430 return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1431 if ((-1 >> 1) != -1) return true; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1432 return false; |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1433 } |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1434 |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1435 #define DO_TEST(T) \ |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1436 if (do_test (static_cast<unsigned T> (0), static_cast<signed T> (0))) \ |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1437 return sizeof (T); |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1438 ]],[[ |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1439 DO_TEST(char) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1440 DO_TEST(short) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1441 DO_TEST(int) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1442 DO_TEST(long) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1443 #if (defined(HAVE_LONG_LONG_INT) && defined(HAVE_UNSIGNED_LONG_LONG_INT)) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1444 DO_TEST(long long) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1445 #endif |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1446 ]])], |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1447 [AC_MSG_RESULT([yes]) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1448 AC_DEFINE(HAVE_FAST_INT_OPS,1,[Define if signed integers use two's complement])], |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1449 [AC_MSG_RESULT([no])]) |
66bc6f9b4f72
rewrite integer arithmetics and conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
8019
diff
changeset
|
1450 AC_LANG_POP(C++)]) |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1451 dnl |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1452 dnl Check to see if the compiler and the linker can handle the flags |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1453 dnl "-framework $1" for the given prologue $2 and the given body $3 of |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1454 dnl a source file. Arguments 2 and 3 optionally can also be empty. |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1455 dnl Add options (lower case letters $1) "--with-framework-$1" and |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1456 dnl "--without-framework-$1". If this test is successful then perform |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1457 dnl $4, otherwise do $5. |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1458 dnl |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1459 dnl OCTAVE_HAVE_FRAMEWORK |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1460 AC_DEFUN(OCTAVE_HAVE_FRAMEWORK, [ |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1461 AC_MSG_CHECKING(whether ${LD-ld} accepts -framework $1) |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1462 AC_CACHE_VAL(octave_cv_framework_$1, [ |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1463 XLDFLAGS="$LDFLAGS" |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1464 LDFLAGS="$LDFLAGS -framework $1" |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1465 AC_LANG_PUSH(C++) |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1466 AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])], |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1467 eval "octave_cv_framework_$1=yes", |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1468 eval "octave_cv_framework_$1=no") |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1469 AC_LANG_POP(C++) |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1470 LDFLAGS="$XLDFLAGS" |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1471 ]) |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1472 if test "$octave_cv_framework_$1" = "yes"; then |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1473 AC_MSG_RESULT(yes) |
8635
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1474 AC_ARG_WITH(framework-m4_tolower($1), |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1475 [AS_HELP_STRING([--without-framework-m4_tolower($1)], |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1476 [don't use framework $1])], |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1477 with_have_framework=$withval, with_have_framework="yes") |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1478 if test "$with_have_framework" = "yes"; then |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1479 [$4] |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1480 else |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1481 AC_MSG_NOTICE([framework rejected by --without-framework-m4_tolower($1)]) |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1482 [$5] |
bef8f001032f
Further improvements for OCTAVE_HAVE_FRAMEWORK and the test for the MacOSX Carbon framework.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8595
diff
changeset
|
1483 fi |
8595
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1484 else |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1485 AC_MSG_RESULT(no) |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1486 [$5] |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1487 fi |
dee5d60257e4
Use Carbon framework to determine ScreenSize on Mac.
Thomas Treichl <Thomas.Treichl@gmx.net>
parents:
8169
diff
changeset
|
1488 ]) |
9173
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1489 dnl |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1490 dnl Do we have a working c99 vsnprintf function? |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1491 dnl |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1492 dnl OCTAVE_HAVE_C99_VSNPRINTF |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1493 AC_DEFUN(OCTAVE_HAVE_C99_VSNPRINTF, [ |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1494 AC_CACHE_CHECK([for c99 vsnprintf], [oct_cv_c99_vsnprintf], |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1495 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1496 #include <stdarg.h> |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1497 #include <stdlib.h> |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1498 |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1499 int |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1500 doit(char * s, ...) |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1501 { |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1502 char buffer[32]; |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1503 va_list args; |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1504 int r; |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1505 |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1506 va_start(args, s); |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1507 r = vsnprintf(buffer, 5, s, args); |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1508 va_end(args); |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1509 |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1510 if (r != 7) |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1511 exit(1); |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1512 |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1513 exit(0); |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1514 } |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1515 ]],[ |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1516 doit("1234567");])], |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1517 [oct_cv_c99_vsnprintf=yes], |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1518 [oct_cv_c99_vsnprintf=no], |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1519 [oct_cv_c99_vsnprintf="guessing no"])]) |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1520 |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1521 case $oct_cv_c99_vsnprintf in |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1522 yes) |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1523 AC_DEFINE([HAVE_C99_VSNPRINTF], [1], [Define if you have a c99 vsnprintf]) |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1524 ;; |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1525 esac |
224634b2e6e3
configure.in, aclocal.m4: check for c99 vsnprintf
Peter O'Gorman <pogma@thewrittenword.com>
parents:
9049
diff
changeset
|
1526 ]) |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1527 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1528 ############################################################################## |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1529 ############################################################################## |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1530 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1531 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1532 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1533 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1534 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1535 # This program is free software; you can redistribute it and/or modify |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1536 # it under the terms of the GNU General Public License as published by |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1537 # the Free Software Foundation; either version 2 of the License, or |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1538 # (at your option) any later version. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1539 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1540 # This program is distributed in the hope that it will be useful, but |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1541 # WITHOUT ANY WARRANTY; without even the implied warranty of |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1542 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1543 # General Public License for more details. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1544 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1545 # You should have received a copy of the GNU General Public License |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1546 # along with this program; if not, write to the Free Software |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1547 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1548 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1549 # As a special exception to the GNU General Public License, if you |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1550 # distribute this file as part of a program that contains a |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1551 # configuration script generated by Autoconf, you may include it under |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1552 # the same distribution terms that you use for the rest of that program. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1553 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1554 # PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1555 # ---------------------------------- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1556 AC_DEFUN([PKG_PROG_PKG_CONFIG], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1557 [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1558 m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1559 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1560 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1561 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1562 fi |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1563 if test -n "$PKG_CONFIG"; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1564 _pkg_min_version=m4_default([$1], [0.9.0]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1565 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1566 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1567 AC_MSG_RESULT([yes]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1568 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1569 AC_MSG_RESULT([no]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1570 PKG_CONFIG="" |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1571 fi |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1572 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1573 fi[]dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1574 ])# PKG_PROG_PKG_CONFIG |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1575 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1576 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1577 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1578 # Check to see whether a particular set of modules exists. Similar |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1579 # to PKG_CHECK_MODULES(), but does not set variables or print errors. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1580 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1581 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1582 # Similar to PKG_CHECK_MODULES, make sure that the first instance of |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1583 # this or PKG_CHECK_MODULES is called, or make sure to call |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1584 # PKG_CHECK_EXISTS manually |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1585 # -------------------------------------------------------------- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1586 AC_DEFUN([PKG_CHECK_EXISTS], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1587 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1588 if test -n "$PKG_CONFIG" && \ |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1589 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1590 m4_ifval([$2], [$2], [:]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1591 m4_ifvaln([$3], [else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1592 $3])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1593 fi]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1594 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1595 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1596 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1597 # --------------------------------------------- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1598 m4_define([_PKG_CONFIG], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1599 [if test -n "$PKG_CONFIG"; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1600 if test -n "$$1"; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1601 pkg_cv_[]$1="$$1" |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1602 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1603 PKG_CHECK_EXISTS([$3], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1604 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1605 [pkg_failed=yes]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1606 fi |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1607 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1608 pkg_failed=untried |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1609 fi[]dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1610 ])# _PKG_CONFIG |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1611 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1612 # _PKG_SHORT_ERRORS_SUPPORTED |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1613 # ----------------------------- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1614 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1615 [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1616 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1617 _pkg_short_errors_supported=yes |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1618 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1619 _pkg_short_errors_supported=no |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1620 fi[]dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1621 ])# _PKG_SHORT_ERRORS_SUPPORTED |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1622 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1623 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1624 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1625 # [ACTION-IF-NOT-FOUND]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1626 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1627 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1628 # Note that if there is a possibility the first call to |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1629 # PKG_CHECK_MODULES might not happen, you should be sure to include an |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1630 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1631 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1632 # |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1633 # -------------------------------------------------------------- |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1634 AC_DEFUN([PKG_CHECK_MODULES], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1635 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1636 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1637 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1638 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1639 pkg_failed=no |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1640 AC_MSG_CHECKING([for $1]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1641 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1642 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1643 _PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1644 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1645 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1646 and $1[]_LIBS to avoid the need to call pkg-config. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1647 See the pkg-config man page for more details.]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1648 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1649 if test $pkg_failed = yes; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1650 _PKG_SHORT_ERRORS_SUPPORTED |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1651 if test $_pkg_short_errors_supported = yes; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1652 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1653 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1654 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1655 fi |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1656 # Put the nasty error message in config.log where it belongs |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1657 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1658 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1659 ifelse([$4], , [AC_MSG_ERROR(dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1660 [Package requirements ($2) were not met: |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1661 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1662 $$1_PKG_ERRORS |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1663 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1664 Consider adjusting the PKG_CONFIG_PATH environment variable if you |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1665 installed software in a non-standard prefix. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1666 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1667 _PKG_TEXT |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1668 ])], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1669 [AC_MSG_RESULT([no]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1670 $4]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1671 elif test $pkg_failed = untried; then |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1672 ifelse([$4], , [AC_MSG_FAILURE(dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1673 [The pkg-config script could not be found or is too old. Make sure it |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1674 is in your PATH or set the PKG_CONFIG environment variable to the full |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1675 path to pkg-config. |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1676 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1677 _PKG_TEXT |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1678 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1679 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1680 [$4]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1681 else |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1682 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1683 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1684 AC_MSG_RESULT([yes]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1685 ifelse([$3], , :, [$3]) |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1686 fi[]dnl |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1687 ])# PKG_CHECK_MODULES |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1688 |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1689 ############################################################################## |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9231
diff
changeset
|
1690 ############################################################################## |