~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to m4/curl-reentrant.m4

Tags: 7.20.0-1
* Package is orphaned.
* New upstream release.
* Switch to dpkg-source 3.0 (quilt) format (closes: #538547).
* Fixed build error with binutils-gold (closes: #554296). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
# KIND, either express or implied.
20
20
#
21
 
# $Id: curl-reentrant.m4,v 1.6 2009-09-29 16:34:04 yangtse Exp $
 
21
# $Id: curl-reentrant.m4,v 1.7 2009-11-14 18:51:37 yangtse Exp $
22
22
#***************************************************************************
23
23
 
24
24
# File version for 'aclocal' use. Keep it a single number.
428
428
dnl Internal macro for CURL_CONFIGURE_REENTRANT.
429
429
 
430
430
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_SYSTEM], [
431
 
  case $host in
432
 
    *-*-solaris*)
 
431
  case $host_os in
 
432
    solaris*)
433
433
      tmp_need_reentrant="yes"
434
434
      ;;
435
435
    *)
439
439
])
440
440
 
441
441
 
 
442
dnl CURL_CHECK_NEED_THREAD_SAFE_SYSTEM
 
443
dnl -------------------------------------------------
 
444
dnl Checks if the preprocessor _THREAD_SAFE definition
 
445
dnl must be unconditionally done for this platform.
 
446
dnl Internal macro for CURL_CONFIGURE_THREAD_SAFE.
 
447
 
 
448
AC_DEFUN([CURL_CHECK_NEED_THREAD_SAFE_SYSTEM], [
 
449
  case $host_os in
 
450
    aix[[123]].* | aix4.[[012]].*)
 
451
      dnl aix 4.2 and older
 
452
      tmp_need_thread_safe="no"
 
453
      ;;
 
454
    aix*)
 
455
      dnl AIX 4.3 and newer
 
456
      tmp_need_thread_safe="yes"
 
457
      ;;
 
458
    *)
 
459
      tmp_need_thread_safe="no"
 
460
      ;;
 
461
  esac
 
462
])
 
463
 
 
464
 
442
465
dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
443
466
dnl -------------------------------------------------
444
467
dnl This macro ensures that configuration tests done
459
482
])
460
483
 
461
484
 
 
485
dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE
 
486
dnl -------------------------------------------------
 
487
dnl This macro ensures that configuration tests done
 
488
dnl after this will execute with preprocessor symbol
 
489
dnl _THREAD_SAFE defined. This macro also ensures that
 
490
dnl the generated config file defines NEED_THREAD_SAFE
 
491
dnl and that in turn setup.h will define _THREAD_SAFE.
 
492
dnl Internal macro for CURL_CONFIGURE_THREAD_SAFE.
 
493
 
 
494
AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE], [
 
495
AC_DEFINE(NEED_THREAD_SAFE, 1,
 
496
  [Define to 1 if _THREAD_SAFE preprocessor symbol must be defined.])
 
497
cat >>confdefs.h <<_EOF
 
498
#ifndef _THREAD_SAFE
 
499
#  define _THREAD_SAFE
 
500
#endif
 
501
_EOF
 
502
])
 
503
 
 
504
 
462
505
dnl CURL_CONFIGURE_REENTRANT
463
506
dnl -------------------------------------------------
464
507
dnl This first checks if the preprocessor _REENTRANT
519
562
  #
520
563
])
521
564
 
 
565
 
 
566
dnl CURL_CONFIGURE_THREAD_SAFE
 
567
dnl -------------------------------------------------
 
568
dnl This first checks if the preprocessor _THREAD_SAFE
 
569
dnl symbol is already defined. If it isn't currently
 
570
dnl defined a set of checks are performed to verify
 
571
dnl if its definition is required. Finally, if
 
572
dnl _THREAD_SAFE is already defined or needed it takes
 
573
dnl care of making adjustments necessary to ensure
 
574
dnl that it is defined equally for further configure
 
575
dnl tests and generated config file.
 
576
 
 
577
AC_DEFUN([CURL_CONFIGURE_THREAD_SAFE], [
 
578
  AC_PREREQ([2.50])dnl
 
579
  #
 
580
  AC_MSG_CHECKING([if _THREAD_SAFE is already defined])
 
581
  AC_COMPILE_IFELSE([
 
582
    AC_LANG_PROGRAM([[
 
583
    ]],[[
 
584
#ifdef _THREAD_SAFE
 
585
      int dummy=1;
 
586
#else
 
587
      force compilation error
 
588
#endif
 
589
    ]])
 
590
  ],[
 
591
    AC_MSG_RESULT([yes])
 
592
    tmp_thread_safe_initially_defined="yes"
 
593
  ],[
 
594
    AC_MSG_RESULT([no])
 
595
    tmp_thread_safe_initially_defined="no"
 
596
  ])
 
597
  #
 
598
  if test "$tmp_thread_safe_initially_defined" = "no"; then
 
599
    AC_MSG_CHECKING([if _THREAD_SAFE is actually needed])
 
600
    CURL_CHECK_NEED_THREAD_SAFE_SYSTEM
 
601
    if test "$tmp_need_thread_safe" = "yes"; then
 
602
      AC_MSG_RESULT([yes])
 
603
    else
 
604
      AC_MSG_RESULT([no])
 
605
    fi
 
606
  fi
 
607
  #
 
608
  AC_MSG_CHECKING([if _THREAD_SAFE is onwards defined])
 
609
  if test "$tmp_thread_safe_initially_defined" = "yes" ||
 
610
    test "$tmp_need_thread_safe" = "yes"; then
 
611
    CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE
 
612
    AC_MSG_RESULT([yes])
 
613
  else
 
614
    AC_MSG_RESULT([no])
 
615
  fi
 
616
  #
 
617
])
 
618