configure 497 KB
Newer Older
12001
12002
#include <sys/types.h>
#include <time.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12003

12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
int
main ()
{
struct tm tm;
				     int *p = &tm.tm_sec;
				     return !p;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_struct_tm=time.h
else
  ac_cv_struct_tm=sys/time.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
$as_echo "$ac_cv_struct_tm" >&6; }
if test $ac_cv_struct_tm = sys/time.h; then
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12024

12025
$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12026

12027
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12028

12029
12030
12031
12032
12033
12034
12035
12036
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
if ${ac_cv_type_uid_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12037

12038
12039
12040
12041
12042
12043
12044
12045
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "uid_t" >/dev/null 2>&1; then :
  ac_cv_type_uid_t=yes
else
  ac_cv_type_uid_t=no
fi
rm -f conftest*
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12046

12047
12048
12049
12050
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
$as_echo "$ac_cv_type_uid_t" >&6; }
if test $ac_cv_type_uid_t = no; then
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12051

12052
$as_echo "#define uid_t int" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12053
12054


12055
$as_echo "#define gid_t int" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12056

12057
fi
12058
12059


12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
# Checks for library functions.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
$as_echo_n "checking for error_at_line... " >&6; }
if ${ac_cv_lib_error_at_line+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <error.h>
int
main ()
{
error_at_line (0, 0, "", 0, "an error occurred");
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_error_at_line=yes
else
  ac_cv_lib_error_at_line=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
$as_echo "$ac_cv_lib_error_at_line" >&6; }
if test $ac_cv_lib_error_at_line = no; then
  case " $LIBOBJS " in
  *" error.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS error.$ac_objext"
 ;;
esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12093

12094
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12095
12096
12097
12098




12099
12100
12101
12102
12103
12104
12105
12106
12107
  for ac_header in $ac_header_list
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12108

12109
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12110

12111
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12112
12113
12114
12115
12116
12117
12118
12119








12120
12121
12122
12123
12124
12125
12126
for ac_func in getpagesize
do :
  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
if test "x$ac_cv_func_getpagesize" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_GETPAGESIZE 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12127

12128
12129
fi
done
12130

12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
{ $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
else
  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
12144

12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
/* 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.
12161

12162
12163
12164
12165
   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)  */
12166

12167
12168
#include <fcntl.h>
#include <sys/mman.h>
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12169

12170
12171
12172
#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
char *malloc ();
#endif
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12173

12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
/* 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
12203

12204
#endif /* no HAVE_GETPAGESIZE */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12205

12206
12207
12208
12209
12210
12211
12212
int
main ()
{
  char *data, *data2, *data3;
  const char *cdata2;
  int i, pagesize;
  int fd, fd2;
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12213

12214
  pagesize = getpagesize ();
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12215

12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
  /* 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
12229

12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
  /* 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
12247

12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
  /* 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
12260

12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
  /* 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;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_mmap_fixed_mapped=yes
else
  ac_cv_func_mmap_fixed_mapped=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
12286

12287
12288
12289
12290
fi
{ $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
12291

12292
$as_echo "#define HAVE_MMAP 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12293

12294
12295
fi
rm -f conftest.mmap conftest.txt
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12296

12297
12298
12299
12300
12301
12302
12303
12304
12305
{ $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
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
#include <signal.h>
12306

12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
int
main ()
{
return *(signal (0, 0)) (0) == 1;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_type_signal=int
else
  ac_cv_type_signal=void
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
$as_echo "$ac_cv_type_signal" >&6; }
12324

12325
12326
12327
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF
12328
12329


12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
{ $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 :
  $as_echo_n "(cached) " >&6
else
  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
/* end confdefs.h.  */
$ac_includes_default
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;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_lstat_dereferences_slashed_symlink=yes
else
  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
12364

12365
12366
12367
12368
12369
12370
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
fi
rm -f conftest.sym conftest.file
12371

12372
12373
12374
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; }
12375

12376
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
12377

12378
12379
12380
cat >>confdefs.h <<_ACEOF
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
_ACEOF
12381
12382


12383
12384
12385
12386
12387
12388
if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
  case " $LIBOBJS " in
  *" lstat.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
 ;;
esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12389

12390
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12391

12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
{ $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 :
  $as_echo_n "(cached) " >&6
else
  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
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
12420

12421
12422
12423
12424
12425
12426
12427
12428
12429
fi
{ $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
12430
12431


12432
12433
12434
cat >>confdefs.h <<_ACEOF
#define HAVE_STAT_EMPTY_STRING_BUG 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12435

12436
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12437

12438
12439
12440
12441
12442
12443
12444
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
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12445

12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
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
/* end confdefs.h.  */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12457

12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
/* 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 strftime ();
int
main ()
{
return strftime ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_intl_strftime=yes
12475
else
12476
12477
12478
12479
12480
  ac_cv_lib_intl_strftime=no
fi
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
12481
fi
12482
12483
12484
12485
{ $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
12486

12487
12488
LIBS="-lintl $LIBS"
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12489

12490
12491
fi
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12492

12493
12494
12495
12496
12497
12498
12499
12500
12501
for ac_func in atexit logf getenv gettimeofday memcpy memmove memset mkdir \
		munmap posix_memalign setlinebuf sincosf strstr sysconf
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
12502

12503
12504
fi
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12505

12506
12507
ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan"
if test "x$ac_cv_func_isnan" = xyes; then :
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12508

12509
12510
12511
cat >>confdefs.h <<_ACEOF
#define HAVE_ISNAN2 1
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12512

12513
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12514
12515


12516
12517
12518
12519
12520
# 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
12521

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

12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
  { $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
12549

12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
  ;
  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
12574

12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
  { $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
12595

12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
  ;
  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
12619

12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
  ;
  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
12630
done
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
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 :
12647
12648
  $as_echo_n "(cached) " >&6
else
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
  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
12664

12665
12666
12667
12668
12669
12670
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_large_files=no; break
12671
fi
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#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];
int
main ()
{
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12688

12689
12690
12691
12692
12693
12694
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_sys_large_files=1; break
12695
fi
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_cv_sys_large_files=unknown
  break
done
fi
{ $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
_ACEOF
;;
esac
rm -rf conftest*
  fi
12713
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12714

12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
{ $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
/* end confdefs.h.  */
#include <sys/types.h> /* for off_t */
     #include <stdio.h>
int
main ()
{
int (*fp) (FILE *, off_t, int) = fseeko;
     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_sys_largefile_source=no; break
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#define _LARGEFILE_SOURCE 1
#include <sys/types.h> /* for off_t */
     #include <stdio.h>
int
main ()
{
int (*fp) (FILE *, off_t, int) = fseeko;
     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
  ;
  return 0;
}
_ACEOF
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
;;
esac
rm -rf conftest*
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12773

12774
12775
12776
12777
# 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
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12778

12779
$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12780

12781
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12782
12783


12784
# Provide special options for ATLAS
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12785

12786
12787
12788
# Check whether --with-atlas-libdir was given.
if test "${with_atlas_libdir+set}" = set; then :
  withval=$with_atlas_libdir;
12789
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12790
12791


12792
12793
12794
12795
# Check whether --with-atlas-incdir was given.
if test "${with_atlas_incdir+set}" = set; then :
  withval=$with_atlas_incdir;
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12796
12797


12798
# Provide special options for FFTW
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12799

12800
12801
12802
12803
# Check whether --with-fftw was given.
if test "${with_fftw+set}" = set; then :
  withval=$with_fftw;
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12804
12805


12806
12807
12808
12809
# Check whether --with-fftw-incdir was given.
if test "${with_fftw_incdir+set}" = set; then :
  withval=$with_fftw_incdir;
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12810
12811


12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
# Provide a special option for the default XSLT URL
with_xsl_url="file://"$(# 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"
    if test x"$ac_URBI_RESOLVE_DIR_PREPARE_dir" = x"$ac_URBI_RESOLVE_DIR_PREPARE_res"; then
      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"
}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12840

12841
urbi_resolve_dir '$datadir')"/$PACKAGE_NAME/$PACKAGE_NAME.xsl"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12842

12843
12844
12845
12846
# Check whether --with-xsl_url was given.
if test "${with_xsl_url+set}" = set; then :
  withval=$with_xsl_url;
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12847
12848
12849



12850
12851
12852
cat >>confdefs.h <<_ACEOF
#define XSL_URL "$with_xsl_url"
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12853
12854


12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
# Provide special option to disable model-fitting (enabled by default)
enable_model_fitting="yes"
{ $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; if test "$enable_model_fitting" = "no"; then
	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
	else
	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
	fi
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12869
12870


12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
# 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
else
  use_pthreads=yes
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12885

12886
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12887

12888
12889
# Deactivate multithreading for now
use_pthreads="no"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12890

12891
12892
12893
12894
12895
12896
12897
# 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; }
12898
else
12899
12900
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
12901
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12902

12903
12904
12905
12906
12907
12908
12909
12910

# 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; }
12911
else
12912
12913
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
12914
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12915
12916


12917
12918
12919
12920
12921
12922
############# 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 "$enable_model_fitting" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
$as_echo "enabled" >&6; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12923

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

12926
else
12927
12928
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
$as_echo "disabled" >&6; }
12929
fi
12930
12931
12932
 if test $enable_model_fitting = "yes"; then
  USE_MODEL_TRUE=
  USE_MODEL_FALSE='#'
12933
else
12934
12935
  USE_MODEL_TRUE='#'
  USE_MODEL_FALSE=
12936
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12937
12938


12939
################# Actions to complete in case of multhreading ################
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12940

12941
12942
12943
cat >>confdefs.h <<_ACEOF
#define THREADS_NMAX $n_pthreads
_ACEOF
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12944

12945
12946
12947
12948
12949
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; }
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12950

12951
$as_echo "#define USE_THREADS 1" >>confdefs.h
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12952

12953
# CC, CFLAGS and LIBS are system and compiler-dependent
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12954
12955


12956
acx_pthread_ok=no
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12957

12958
12959
12960
12961
12962
# 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 :
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12963

12964
12965
12966
else
  acx_pthread_ok=no
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12967
12968
12969



12970
12971
12972
12973
# 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).
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12974

12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
# 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.  */
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12987

12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
/* 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;
For faster browsing, not all history is shown. View entire blame