Changeset 1738 for pjproject/trunk
- Timestamp:
- Jan 24, 2008 3:27:30 PM (17 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r1729 r1738 5510 5510 esac 5511 5511 5512 if test "${ac_cv_header_fcntl_h+set}" = set; then 5513 { echo "$as_me:$LINENO: checking for fcntl.h" >&5 5514 echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6; } 5515 if test "${ac_cv_header_fcntl_h+set}" = set; then 5516 echo $ECHO_N "(cached) $ECHO_C" >&6 5517 fi 5518 { echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 5519 echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6; } 5520 else 5521 # Is the header compilable? 5522 { echo "$as_me:$LINENO: checking fcntl.h usability" >&5 5523 echo $ECHO_N "checking fcntl.h usability... $ECHO_C" >&6; } 5524 cat >conftest.$ac_ext <<_ACEOF 5525 /* confdefs.h. */ 5526 _ACEOF 5527 cat confdefs.h >>conftest.$ac_ext 5528 cat >>conftest.$ac_ext <<_ACEOF 5529 /* end confdefs.h. */ 5530 $ac_includes_default 5531 #include <fcntl.h> 5532 _ACEOF 5533 rm -f conftest.$ac_objext 5534 if { (ac_try="$ac_compile" 5535 case "(($ac_try" in 5536 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 5537 *) ac_try_echo=$ac_try;; 5538 esac 5539 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 5540 (eval "$ac_compile") 2>conftest.er1 5541 ac_status=$? 5542 grep -v '^ *+' conftest.er1 >conftest.err 5543 rm -f conftest.er1 5544 cat conftest.err >&5 5545 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5546 (exit $ac_status); } && { 5547 test -z "$ac_c_werror_flag" || 5548 test ! -s conftest.err 5549 } && test -s conftest.$ac_objext; then 5550 ac_header_compiler=yes 5551 else 5552 echo "$as_me: failed program was:" >&5 5553 sed 's/^/| /' conftest.$ac_ext >&5 5554 5555 ac_header_compiler=no 5556 fi 5557 5558 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 5559 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 5560 echo "${ECHO_T}$ac_header_compiler" >&6; } 5561 5562 # Is the header present? 5563 { echo "$as_me:$LINENO: checking fcntl.h presence" >&5 5564 echo $ECHO_N "checking fcntl.h presence... $ECHO_C" >&6; } 5565 cat >conftest.$ac_ext <<_ACEOF 5566 /* confdefs.h. */ 5567 _ACEOF 5568 cat confdefs.h >>conftest.$ac_ext 5569 cat >>conftest.$ac_ext <<_ACEOF 5570 /* end confdefs.h. */ 5571 #include <fcntl.h> 5572 _ACEOF 5573 if { (ac_try="$ac_cpp conftest.$ac_ext" 5574 case "(($ac_try" in 5575 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 5576 *) ac_try_echo=$ac_try;; 5577 esac 5578 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 5579 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 5580 ac_status=$? 5581 grep -v '^ *+' conftest.er1 >conftest.err 5582 rm -f conftest.er1 5583 cat conftest.err >&5 5584 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5585 (exit $ac_status); } >/dev/null && { 5586 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 5587 test ! -s conftest.err 5588 }; then 5589 ac_header_preproc=yes 5590 else 5591 echo "$as_me: failed program was:" >&5 5592 sed 's/^/| /' conftest.$ac_ext >&5 5593 5594 ac_header_preproc=no 5595 fi 5596 5597 rm -f conftest.err conftest.$ac_ext 5598 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 5599 echo "${ECHO_T}$ac_header_preproc" >&6; } 5600 5601 # So? What about this header? 5602 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 5603 yes:no: ) 5604 { echo "$as_me:$LINENO: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&5 5605 echo "$as_me: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 5606 { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the compiler's result" >&5 5607 echo "$as_me: WARNING: fcntl.h: proceeding with the compiler's result" >&2;} 5608 ac_header_preproc=yes 5609 ;; 5610 no:yes:* ) 5611 { echo "$as_me:$LINENO: WARNING: fcntl.h: present but cannot be compiled" >&5 5612 echo "$as_me: WARNING: fcntl.h: present but cannot be compiled" >&2;} 5613 { echo "$as_me:$LINENO: WARNING: fcntl.h: check for missing prerequisite headers?" >&5 5614 echo "$as_me: WARNING: fcntl.h: check for missing prerequisite headers?" >&2;} 5615 { echo "$as_me:$LINENO: WARNING: fcntl.h: see the Autoconf documentation" >&5 5616 echo "$as_me: WARNING: fcntl.h: see the Autoconf documentation" >&2;} 5617 { echo "$as_me:$LINENO: WARNING: fcntl.h: section \"Present But Cannot Be Compiled\"" >&5 5618 echo "$as_me: WARNING: fcntl.h: section \"Present But Cannot Be Compiled\"" >&2;} 5619 { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the preprocessor's result" >&5 5620 echo "$as_me: WARNING: fcntl.h: proceeding with the preprocessor's result" >&2;} 5621 { echo "$as_me:$LINENO: WARNING: fcntl.h: in the future, the compiler will take precedence" >&5 5622 echo "$as_me: WARNING: fcntl.h: in the future, the compiler will take precedence" >&2;} 5623 5624 ;; 5625 esac 5626 { echo "$as_me:$LINENO: checking for fcntl.h" >&5 5627 echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6; } 5628 if test "${ac_cv_header_fcntl_h+set}" = set; then 5629 echo $ECHO_N "(cached) $ECHO_C" >&6 5630 else 5631 ac_cv_header_fcntl_h=$ac_header_preproc 5632 fi 5633 { echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 5634 echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6; } 5635 5636 fi 5637 if test $ac_cv_header_fcntl_h = yes; then 5638 cat >>confdefs.h <<\_ACEOF 5639 #define PJ_HAS_FCNTL_H 1 5640 _ACEOF 5641 5642 fi 5643 5644 5512 5645 if test "${ac_cv_header_linux_socket_h+set}" = set; then 5513 5646 { echo "$as_me:$LINENO: checking for linux/socket.h" >&5 -
pjproject/trunk/aconfigure.ac
r1729 r1738 139 139 esac 140 140 141 AC_CHECK_HEADER(fcntl.h,[AC_DEFINE(PJ_HAS_FCNTL_H,1)]) 141 142 AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)]) 142 143 AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)]) -
pjproject/trunk/pjlib/include/pj/compat/os_auto.h.in
r1729 r1738 47 47 #undef PJ_HAS_CTYPE_H 48 48 #undef PJ_HAS_ERRNO_H 49 #undef PJ_HAS_FCNTL_H 49 50 #undef PJ_HAS_LINUX_SOCKET_H 50 51 #undef PJ_HAS_MALLOC_H -
pjproject/trunk/third_party/build/srtp/srtp_config.h
r1736 r1738 27 27 (defined(PJ_M_IA64) && PJ_M_IA64!=0) 28 28 # define CPU_CISC 1 29 # define HAVE_X86 1 /*use X86 inlined assembly code */29 /* # define HAVE_X86 1 use X86 inlined assembly code */ 30 30 #else 31 31 # define CPU_RISC 1 … … 114 114 #endif 115 115 116 #define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long))116 #define SIZEOF_UNSIGNED_LONG 8 117 117 #define SIZEOF_UNSIGNED_LONG_LONG 8 118 118 … … 156 156 /* #define DEV_URANDOM "/dev/urandom" */ 157 157 158 /* Only with PJSIP: 159 * Try to open PJ_DEV_URANDOM if present 160 */ 161 #if defined(PJ_HAS_FCNTL_H) && defined(PJ_HAS_UNISTD_H) 162 # define PJ_DEV_URANDOM "/dev/urandom" 163 #endif 164 158 165 /* We have overridden libsrtp error mechanism, so these are not used. */ 159 166 /* #undef ERR_REPORTING_FILE */ -
pjproject/trunk/third_party/srtp/crypto/rng/rand_source.c
r1730 r1738 45 45 #include "srtp_config.h" 46 46 47 #if def DEV_URANDOM47 #if defined(DEV_URANDOM) || defined(PJ_DEV_URANDOM) 48 48 # include <fcntl.h> /* for open() */ 49 49 # include <unistd.h> /* for close() */ … … 88 88 if (dev_random_fdes < 0) 89 89 return err_status_init_fail; 90 #elif defined(PJ_DEV_URANDOM) 91 /* open random source for reading */ 92 dev_random_fdes = open(PJ_DEV_URANDOM, O_RDONLY); 93 if (dev_random_fdes < 0) { 94 err_report(3,"Ugh: /dev/urandom not present, using rand() instead"); 95 return err_status_ok; /* it's ok, it'll fallback to using rand() */ 96 } 90 97 #elif (_MSC_VER >= 1400) 91 98 dev_random_fdes = RAND_SOURCE_READY; … … 124 131 } 125 132 #else 133 uint8_t *dst = (uint8_t *)dest; 134 135 /* First try with /dev/urandom, if it's opened */ 136 if (dev_random_fdes >= 0) { 137 if (read(dev_random_fdes, dest, len) == len) 138 return err_status_ok; /* success */ 139 } 140 126 141 /* Generic C-library (rand()) version */ 127 142 /* This is a random source of last resort */ 128 uint8_t *dst = (uint8_t *)dest;129 143 while (len) 130 144 { … … 142 156 err_status_t 143 157 rand_source_deinit(void) { 158 #ifndef PJ_DEV_URANDOM 144 159 if (dev_random_fdes < 0) 145 160 return err_status_dealloc_fail; /* well, we haven't really failed, * 146 161 * but there is something wrong */ 147 #ifdef DEV_URANDOM148 close(dev_random_fdes);149 162 #endif 163 164 if (dev_random_fdes >= 0) 165 close(dev_random_fdes); 166 150 167 dev_random_fdes = RAND_SOURCE_NOT_READY; 151 168 152 169 return err_status_ok; 153 170 } 171
Note: See TracChangeset
for help on using the changeset viewer.