configure 759 KB
Newer Older
20001
20002
fi
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20003

20004
20005
20006
20007
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
$as_echo_n "checking for working mmap... " >&6; }
if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
  $as_echo_n "(cached) " >&6
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20008
else
20009
20010
20011
20012
20013
20014
20015
20016
  if test "$cross_compiling" = yes; then :
  ac_cv_func_mmap_fixed_mapped=no
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
/* malloc might have been renamed as rpl_malloc. */
#undef malloc
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20017

20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
/* Thanks to Mike Haertel and Jim Avera for this test.
   Here is a matrix of mmap possibilities:
	mmap private not fixed
	mmap private fixed at somewhere currently unmapped
	mmap private fixed at somewhere already mapped
	mmap shared not fixed
	mmap shared fixed at somewhere currently unmapped
	mmap shared fixed at somewhere already mapped
   For private mappings, we should verify that changes cannot be read()
   back from the file, nor mmap's back from the file at a different
   address.  (There have been systems where private was not correctly
   implemented like the infamous i386 svr4.0, and systems where the
   VM page cache was not coherent with the file system buffer cache
   like early versions of FreeBSD and possibly contemporary NetBSD.)
   For shared mappings, we should conversely verify that changes get
   propagated back to all the places they're supposed to be.

   Grep wants private fixed already mapped.
   The main things grep needs to know about mmap are:
   * does it exist and is it safe to write into the mmap'd area
   * how to use it (BSD variants)  */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20039

20040
20041
#include <fcntl.h>
#include <sys/mman.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20042

20043
20044
20045
#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
char *malloc ();
#endif
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20046

20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
/* This mess was copied from the GNU getpagesize.h.  */
#ifndef HAVE_GETPAGESIZE
# ifdef _SC_PAGESIZE
#  define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
#  ifdef HAVE_SYS_PARAM_H
#   include <sys/param.h>
#   ifdef EXEC_PAGESIZE
#    define getpagesize() EXEC_PAGESIZE
#   else /* no EXEC_PAGESIZE */
#    ifdef NBPG
#     define getpagesize() NBPG * CLSIZE
#     ifndef CLSIZE
#      define CLSIZE 1
#     endif /* no CLSIZE */
#    else /* no NBPG */
#     ifdef NBPC
#      define getpagesize() NBPC
#     else /* no NBPC */
#      ifdef PAGESIZE
#       define getpagesize() PAGESIZE
#      endif /* PAGESIZE */
#     endif /* no NBPC */
#    endif /* no NBPG */
#   endif /* no EXEC_PAGESIZE */
#  else /* no HAVE_SYS_PARAM_H */
#   define getpagesize() 8192	/* punt totally */
#  endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20076

20077
#endif /* no HAVE_GETPAGESIZE */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20078

20079
20080
20081
20082
20083
20084
20085
int
main ()
{
  char *data, *data2, *data3;
  const char *cdata2;
  int i, pagesize;
  int fd, fd2;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20086

20087
  pagesize = getpagesize ();
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20088

20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
  /* First, make a file with some known garbage in it. */
  data = (char *) malloc (pagesize);
  if (!data)
    return 1;
  for (i = 0; i < pagesize; ++i)
    *(data + i) = rand ();
  umask (0);
  fd = creat ("conftest.mmap", 0600);
  if (fd < 0)
    return 2;
  if (write (fd, data, pagesize) != pagesize)
    return 3;
  close (fd);
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20102

20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
  /* Next, check that the tail of a page is zero-filled.  File must have
     non-zero length, otherwise we risk SIGBUS for entire page.  */
  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
  if (fd2 < 0)
    return 4;
  cdata2 = "";
  if (write (fd2, cdata2, 1) != 1)
    return 5;
  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
  if (data2 == MAP_FAILED)
    return 6;
  for (i = 0; i < pagesize; ++i)
    if (*(data2 + i))
      return 7;
  close (fd2);
  if (munmap (data2, pagesize))
    return 8;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20120

20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
  /* Next, try to mmap the file at a fixed address which already has
     something else allocated at it.  If we can, also make sure that
     we see the same garbage.  */
  fd = open ("conftest.mmap", O_RDWR);
  if (fd < 0)
    return 9;
  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
    return 10;
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data2 + i))
      return 11;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20133

20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
  /* Finally, make sure that changes to the mapped area do not
     percolate back to the file as seen by read().  (This is a bug on
     some variants of i386 svr4.0.)  */
  for (i = 0; i < pagesize; ++i)
    *(data2 + i) = *(data2 + i) + 1;
  data3 = (char *) malloc (pagesize);
  if (!data3)
    return 12;
  if (read (fd, data3, pagesize) != pagesize)
    return 13;
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data3 + i))
      return 14;
  close (fd);
  return 0;
}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20150
_ACEOF
20151
20152
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_mmap_fixed_mapped=yes
20153
else
20154
  ac_cv_func_mmap_fixed_mapped=no
20155
fi
20156
20157
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
20158
20159
fi

Emmanuel Bertin's avatar
Emmanuel Bertin committed
20160
fi
20161
20162
20163
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
if test $ac_cv_func_mmap_fixed_mapped = yes; then
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20164

20165
$as_echo "#define HAVE_MMAP 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20166
20167

fi
20168
rm -f conftest.mmap conftest.txt
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20169

20170
20171
20172
20173
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
if ${ac_cv_type_signal+:} false; then :
  $as_echo_n "(cached) " >&6
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20174
else
20175
20176
20177
20178
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
#include <signal.h>
20179

20180
20181
20182
20183
20184
20185
20186
int
main ()
{
return *(signal (0, 0)) (0) == 1;
  ;
  return 0;
}
20187
_ACEOF
20188
20189
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_type_signal=int
20190
else
20191
  ac_cv_type_signal=void
20192
fi
20193
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20194
fi
20195
20196
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
$as_echo "$ac_cv_type_signal" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20197
20198

cat >>confdefs.h <<_ACEOF
20199
#define RETSIGTYPE $ac_cv_type_signal
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20200
20201
20202
_ACEOF


20203
20204
20205
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
20206
  $as_echo_n "(cached) " >&6
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20207
else
20208
20209
20210
20211
20212
20213
20214
  rm -f conftest.sym conftest.file
echo >conftest.file
if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
  if test "$cross_compiling" = yes; then :
  ac_cv_func_lstat_dereferences_slashed_symlink=no
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20215
20216
/* end confdefs.h.  */
$ac_includes_default
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
int
main ()
{
struct stat sbuf;
     /* Linux will dereference the symlink and fail, as required by POSIX.
	That is better in the sense that it means we will not
	have to compile and use the lstat wrapper.  */
     return lstat ("conftest.sym/", &sbuf) == 0;
  ;
  return 0;
}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20228
_ACEOF
20229
20230
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_lstat_dereferences_slashed_symlink=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20231
else
20232
20233
20234
20235
20236
  ac_cv_func_lstat_dereferences_slashed_symlink=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20237

20238
20239
20240
20241
else
  # If the `ln -s' command failed, then we probably don't even
  # have an lstat function.
  ac_cv_func_lstat_dereferences_slashed_symlink=no
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20242
fi
20243
rm -f conftest.sym conftest.file
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20244

20245
20246
20247
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20248

20249
20250
20251
20252
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&

cat >>confdefs.h <<_ACEOF
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20253
_ACEOF
20254
20255
20256
20257
20258
20259
20260


if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
  case " $LIBOBJS " in
  *" lstat.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
 ;;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20261
20262
20263
20264
esac

fi

20265
20266
20267
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
$as_echo_n "checking whether stat accepts an empty string... " >&6; }
if ${ac_cv_func_stat_empty_string_bug+:} false; then :
20268
  $as_echo_n "(cached) " >&6
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20269
else
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
  if test "$cross_compiling" = yes; then :
  ac_cv_func_stat_empty_string_bug=yes
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
struct stat sbuf;
  return stat ("", &sbuf) == 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_stat_empty_string_bug=no
else
  ac_cv_func_stat_empty_string_bug=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20289
fi
20290
20291
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20292
fi
20293

Emmanuel Bertin's avatar
Emmanuel Bertin committed
20294
fi
20295
20296
20297
20298
20299
20300
20301
20302
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
if test $ac_cv_func_stat_empty_string_bug = yes; then
  case " $LIBOBJS " in
  *" stat.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS stat.$ac_objext"
 ;;
esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20303
20304


20305
20306
20307
cat >>confdefs.h <<_ACEOF
#define HAVE_STAT_EMPTY_STRING_BUG 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20308

20309
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20310

20311
20312
20313
20314
20315
20316
for ac_func in strftime
do :
  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
if test "x$ac_cv_func_strftime" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_STRFTIME 1
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20317
_ACEOF
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328

else
  # strftime is in -lintl on SCO UNIX.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
$as_echo_n "checking for strftime in -lintl... " >&6; }
if ${ac_cv_lib_intl_strftime+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20329
20330
20331
20332
20333
20334
20335
20336
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
20337
char strftime ();
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20338
20339
20340
int
main ()
{
20341
return strftime ();
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20342
20343
20344
20345
  ;
  return 0;
}
_ACEOF
20346
20347
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_intl_strftime=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20348
else
20349
  ac_cv_lib_intl_strftime=no
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20350
fi
20351
20352
20353
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20354
fi
20355
20356
20357
20358
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
$as_echo "$ac_cv_lib_intl_strftime" >&6; }
if test "x$ac_cv_lib_intl_strftime" = xyes; then :
  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20359

20360
20361
LIBS="-lintl $LIBS"
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20362

20363
20364
fi
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20365

20366
20367
20368
20369
20370
20371
20372
20373
20374
for ac_func in atexit getenv memcpy memmove memset mkdir munmap strstr \
		sincosf logf gettimeofday posix_memalign
do :
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20375

20376
20377
fi
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20378
20379


20380
20381
20382
20383
20384
# Check support for large files
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
  enableval=$enable_largefile;
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20385

20386
if test "$enable_largefile" != no; then
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20387

20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
if ${ac_cv_sys_largefile_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_sys_largefile_CC=no
     if test "$GCC" != yes; then
       ac_save_CC=$CC
       while :; do
	 # IRIX 6.2 and later do not support large files by default,
	 # so use the C compiler's -n32 option if that helps.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
 /* Check that off_t can represent 2**63 - 1 correctly.
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
    since some C++ compilers masquerading as C compilers
    incorrectly reject 9223372036854775807.  */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
		       && LARGE_OFF_T % 2147483647 == 1)
		      ? 1 : -1];
int
main ()
{
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20413

20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
  ;
  return 0;
}
_ACEOF
	 if ac_fn_c_try_compile "$LINENO"; then :
  break
fi
rm -f core conftest.err conftest.$ac_objext
	 CC="$CC -n32"
	 if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_largefile_CC=' -n32'; break
fi
rm -f core conftest.err conftest.$ac_objext
	 break
       done
       CC=$ac_save_CC
       rm -f conftest.$ac_ext
    fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
$as_echo "$ac_cv_sys_largefile_CC" >&6; }
  if test "$ac_cv_sys_largefile_CC" != no; then
    CC=$CC$ac_cv_sys_largefile_CC
  fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20438

20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
if ${ac_cv_sys_file_offset_bits+:} false; then :
  $as_echo_n "(cached) " >&6
else
  while :; do
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
 /* Check that off_t can represent 2**63 - 1 correctly.
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
    since some C++ compilers masquerading as C compilers
    incorrectly reject 9223372036854775807.  */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
		       && LARGE_OFF_T % 2147483647 == 1)
		      ? 1 : -1];
int
main ()
{
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20459

20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_file_offset_bits=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
 /* Check that off_t can represent 2**63 - 1 correctly.
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
    since some C++ compilers masquerading as C compilers
    incorrectly reject 9223372036854775807.  */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
		       && LARGE_OFF_T % 2147483647 == 1)
		      ? 1 : -1];
int
main ()
{
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20483

20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_file_offset_bits=64; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_cv_sys_file_offset_bits=unknown
  break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
case $ac_cv_sys_file_offset_bits in #(
  no | unknown) ;;
  *)
cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
;;
esac
rm -rf conftest*
  if test $ac_cv_sys_file_offset_bits = unknown; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
if ${ac_cv_sys_large_files+:} false; then :
  $as_echo_n "(cached) " >&6
else
  while :; do
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
 /* Check that off_t can represent 2**63 - 1 correctly.
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
    since some C++ compilers masquerading as C compilers
    incorrectly reject 9223372036854775807.  */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
		       && LARGE_OFF_T % 2147483647 == 1)
		      ? 1 : -1];
int
main ()
{
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20528

20529
20530
20531
  ;
  return 0;
}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20532
_ACEOF
20533
20534
20535
20536
20537
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_large_files=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20538
/* end confdefs.h.  */
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
#define _LARGE_FILES 1
#include <sys/types.h>
 /* Check that off_t can represent 2**63 - 1 correctly.
    We can't simply define LARGE_OFF_T to be 9223372036854775807,
    since some C++ compilers masquerading as C compilers
    incorrectly reject 9223372036854775807.  */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
		       && LARGE_OFF_T % 2147483647 == 1)
		      ? 1 : -1];
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20549
20550
20551
int
main ()
{
20552

Emmanuel Bertin's avatar
Emmanuel Bertin committed
20553
20554
20555
20556
  ;
  return 0;
}
_ACEOF
20557
20558
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_large_files=1; break
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20559
fi
20560
20561
20562
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_cv_sys_large_files=unknown
  break
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20563
20564
done
fi
20565
20566
20567
20568
20569
20570
20571
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
$as_echo "$ac_cv_sys_large_files" >&6; }
case $ac_cv_sys_large_files in #(
  no | unknown) ;;
  *)
cat >>confdefs.h <<_ACEOF
#define _LARGE_FILES $ac_cv_sys_large_files
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20572
_ACEOF
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
;;
esac
rm -rf conftest*
  fi
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
if ${ac_cv_sys_largefile_source+:} false; then :
  $as_echo_n "(cached) " >&6
else
  while :; do
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20586
/* end confdefs.h.  */
20587
20588
#include <sys/types.h> /* for off_t */
     #include <stdio.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20589
20590
20591
int
main ()
{
20592
20593
int (*fp) (FILE *, off_t, int) = fseeko;
     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20594
20595
20596
20597
  ;
  return 0;
}
_ACEOF
20598
20599
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_sys_largefile_source=no; break
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20600
fi
20601
20602
20603
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20604
/* end confdefs.h.  */
20605
20606
20607
#define _LARGEFILE_SOURCE 1
#include <sys/types.h> /* for off_t */
     #include <stdio.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20608
20609
20610
int
main ()
{
20611
20612
int (*fp) (FILE *, off_t, int) = fseeko;
     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20613
20614
20615
20616
  ;
  return 0;
}
_ACEOF
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_sys_largefile_source=1; break
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  ac_cv_sys_largefile_source=unknown
  break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
$as_echo "$ac_cv_sys_largefile_source" >&6; }
case $ac_cv_sys_largefile_source in #(
  no | unknown) ;;
  *)
cat >>confdefs.h <<_ACEOF
#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
_ACEOF
;;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20635
esac
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
rm -rf conftest*

# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
# in glibc 2.1.3, but that breaks too many other things.
# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
if test $ac_cv_sys_largefile_source != unknown; then

$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h

fi


# Set the data directory to a true absolute path
datadir2=$(# PATH urbi_resolve_dir(DIR)
# --------------------------
#
urbi_resolve_dir ()
{
  ac_URBI_RESOLVE_DIR_PREPARE_dir=$1
  ac_URBI_RESOLVE_DIR_PREPARE_res=
  ac_URBI_RESOLVE_DIR_PREPARE_prefix_NONE=
  ac_URBI_RESOLVE_DIR_PREPARE_exec_prefix_NONE=
  test "x$prefix" = xNONE &&
     ac_URBI_RESOLVE_DIR_PREPARE_exec_prefix_NONE=yes &&
     prefix=$ac_default_prefix
  test "x$exec_prefix" = xNONE &&
     ac_URBI_RESOLVE_DIR_PREPARE_exec_prefix_NONE=yes &&
     exec_prefix=$prefix
  while true
  do
    eval ac_URBI_RESOLVE_DIR_PREPARE_res="$ac_URBI_RESOLVE_DIR_PREPARE_dir"
20667
    if test x"$ac_URBI_RESOLVE_DIR_PREPARE_dir" = x"$ac_URBI_RESOLVE_DIR_PREPARE_res"; then
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
      break
    fi
    ac_URBI_RESOLVE_DIR_PREPARE_dir=$ac_URBI_RESOLVE_DIR_PREPARE_res
  done
  test "$ac_URBI_RESOLVE_DIR_PREPARE_prefix_NONE" && prefix=NONE
  test "$ac_URBI_RESOLVE_DIR_PREPARE_exec_prefix_NONE" && exec_prefix=NONE
  echo "$ac_URBI_RESOLVE_DIR_PREPARE_res"
}

urbi_resolve_dir '$datadir')

# Provide special options for ATLAS

# Check whether --with-atlas was given.
if test "${with_atlas+set}" = set; then :
  withval=$with_atlas; atlas_libdir=$withval
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20684
else
20685
  atlas_libdir=""
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20686
20687
20688
20689

fi


20690
20691
20692
20693
20694
# Check whether --with-atlas-incdir was given.
if test "${with_atlas_incdir+set}" = set; then :
  withval=$with_atlas_incdir; atlas_incdir=$withval
else
  atlas_incdir=""
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20695

20696
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20697
20698


20699
# Provide special options for FFTW
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20700

20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
# Check whether --with-fftw was given.
if test "${with_fftw+set}" = set; then :
  withval=$with_fftw; fftw_libdir=$withval
else
  fftw_libdir=""

fi


# Check whether --with-fftw-incdir was given.
if test "${with_fftw_incdir+set}" = set; then :
  withval=$with_fftw_incdir; fftw_incdir=$withval
else
  fftw_incdir=""

fi


# Provide a special option for the default XSLT URL

# Check whether --with-xsl_url was given.
if test "${with_xsl_url+set}" = set; then :
  withval=$with_xsl_url; xsl_url=$withval
else
  xsl_url="file://$datadir2/$PACKAGE_NAME/$PACKAGE_NAME.xsl"

fi



cat >>confdefs.h <<_ACEOF
#define XSL_URL "$xsl_url"
_ACEOF


# Provide special option to disable model-fitting (enabled by default)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if model-fitting should be disabled" >&5
$as_echo_n "checking if model-fitting should be disabled... " >&6; }
# Check whether --enable-model-fitting was given.
if test "${enable_model_fitting+set}" = set; then :
  enableval=$enable_model_fitting; use_model="$enableval"
else
  use_model="yes"
fi

if test "$use_model" = "no"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20749
else
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

# Set flags for multithreading
n_pthreads=16
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
  enableval=$enable_threads; if test "$enableval" = "no"; then
      use_pthreads="no"
    else
      use_pthreads="yes"
      if test "$enableval" != "yes"; then
        n_pthreads=$enableval
      fi
    fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20766
else
20767
  use_pthreads=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20768
20769

fi
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780

# Deactivate multithreading for now
use_pthreads="no"

# Provide special option for gprof profiling
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gprof profiler mode" >&5
$as_echo_n "checking for gprof profiler mode... " >&6; }
# Check whether --enable-gprof was given.
if test "${enable_gprof+set}" = set; then :
  enableval=$enable_gprof; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20781
else
20782
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20783
$as_echo "no" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20784
20785
20786
fi


20787
20788
20789
20790
20791
20792
20793
# Enable linking options for making the executable as portable as possible.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking best linking option" >&5
$as_echo_n "checking best linking option... " >&6; }
# Check whether --enable-best-link was given.
if test "${enable_best_link+set}" = set; then :
  enableval=$enable_best_link; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20794
else
20795
20796
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20797
20798
20799
fi


20800
20801
20802
20803
20804
20805
############# Actions to complete if model-fitting is activated ##############
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for model-fitting configure option" >&5
$as_echo_n "checking for model-fitting configure option... " >&6; }
if test "$use_model" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
$as_echo "enabled" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20806

20807
$as_echo "#define USE_MODEL 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20808

20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
$as_echo "disabled" >&6; }
fi
 if test $use_model = "yes"; then
  USE_MODEL_TRUE=
  USE_MODEL_FALSE='#'
else
  USE_MODEL_TRUE='#'
  USE_MODEL_FALSE=
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20820
20821


20822
20823
20824
20825
################# Actions to complete in case of multhreading ################

cat >>confdefs.h <<_ACEOF
#define THREADS_NMAX $n_pthreads
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20826
20827
_ACEOF

20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
if test "$use_pthreads" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithreading" >&5
$as_echo_n "checking for multithreading... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: maximum of $n_pthreads thread(s)" >&5
$as_echo "maximum of $n_pthreads thread(s)" >&6; }

$as_echo "#define USE_THREADS 1" >>confdefs.h

# CC, CFLAGS and LIBS are system and compiler-dependent


acx_pthread_ok=no
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20840

20841
20842
20843
20844
20845
20846
20847
20848
# First, check if the POSIX threads header, pthread.h, is available.
# If it isn't, don't bother looking for the threads libraries.
# AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader)
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
if test "x$ac_cv_header_pthread_h" = xyes; then :

else
  acx_pthread_ok=no
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20849
20850
20851
fi


20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887

# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).

# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
        save_CFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
        save_LIBS="$LIBS"
        LIBS="$PTHREAD_LIBS $LIBS"
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pthread_join ();
int
main ()
{
return pthread_join ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  acx_pthread_ok=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20888
fi
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
$as_echo "$acx_pthread_ok" >&6; }
        if test x"$acx_pthread_ok" = xno; then
                PTHREAD_LIBS=""
                PTHREAD_CFLAGS=""
        fi
        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20899
20900
fi

20901
20902
20903
# Create a list of thread flags to try.  Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20904

20905
acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads --thread-safe -mt"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20906

20907
20908
# The ordering *is* (sometimes) important.  Some notes on the
# individual items follow:
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20909

20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
#       other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
#      doesn't hurt to check since this sometimes defines pthreads too;
#      also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20924

20925
20926
case "${host_cpu}-${host_os}" in
        *solaris*)
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20927

20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
        # On Solaris (at least, for some versions), libc contains stubbed
        # (non-functional) versions of the pthreads routines, so link-based
        # tests will erroneously succeed.  (We need to link with -pthread or
        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
        # a function called by this macro, so we could check for that, but
        # who knows whether they'll stub that too in a future libc.)  So,
        # we'll just look for -pthreads and -lpthread first:

        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
        ;;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20938
20939
esac

20940
20941
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20942

20943
20944
20945
20946
20947
        case $flag in
                none)
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
$as_echo_n "checking whether pthreads work without any flags... " >&6; }
                ;;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20948

20949
20950
20951
20952
20953
                -*)
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
$as_echo_n "checking whether pthreads work with $flag... " >&6; }
                PTHREAD_CFLAGS="$flag"
                ;;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20954

20955
20956
20957
20958
20959
20960
                *)
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
                PTHREAD_LIBS="-l$flag"
                ;;
        esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20961

20962
20963
20964
20965
        save_LIBS="$LIBS"
        save_CFLAGS="$CFLAGS"
        LIBS="$PTHREAD_LIBS $LIBS"
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20966

20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
        # Check for various functions.  We must include pthread.h,
        # since some functions may be macros.  (On the Sequent, we
        # need a special flag -Kthread to make this header compile.)
        # We check for pthread_join because it is in -lpthread on IRIX
        # while pthread_create is in libc.  We check for pthread_attr_init
        # due to DEC craziness with -lpthreads.  We check for
        # pthread_cleanup_push because it is one of the few pthread
        # functions on Solaris that doesn't have a non-functional libc stub.
        # We try pthread_create on general principles.
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <pthread.h>
int
main ()
{
pthread_t th; pthread_join(th, 0);
                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
                     pthread_create(0,0,0,0); pthread_cleanup_pop(0);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  acx_pthread_ok=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20991
fi
20992
20993
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20994

20995
20996
        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
20997

20998
20999
21000
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
$as_echo "$acx_pthread_ok" >&6; }
        if test "x$acx_pthread_ok" = xyes; then
For faster browsing, not all history is shown. View entire blame