Added better missing function emulation.

This commit is contained in:
Patrik Stridvall 1999-11-13 22:23:35 +00:00 committed by Alexandre Julliard
parent b3ec4b91af
commit b9010214d2
9 changed files with 392 additions and 78 deletions

114
configure vendored
View File

@ -4555,11 +4555,21 @@ fi
for ac_func in \ for ac_func in \
_lwp_create \ _lwp_create \
clone \ clone \
getnetbyaddr \
getnetbyname \
getpagesize \ getpagesize \
getprotobyname \
getprotobynumber \
getservbyport \
getsockopt \
inet_network \
memmove \ memmove \
rfork \ rfork \
select \
sendmsg \ sendmsg \
settimeofday \
sigaltstack \ sigaltstack \
statfs \
strcasecmp \ strcasecmp \
strerror \ strerror \
strncasecmp \ strncasecmp \
@ -4572,12 +4582,12 @@ for ac_func in \
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4576: checking for $ac_func" >&5 echo "configure:4586: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4581 "configure" #line 4591 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -4600,7 +4610,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -4677,17 +4687,17 @@ for ac_hdr in \
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4681: checking for $ac_hdr" >&5 echo "configure:4691: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4686 "configure" #line 4696 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -4714,12 +4724,12 @@ fi
done done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:4718: checking whether stat file-mode macros are broken" >&5 echo "configure:4728: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4723 "configure" #line 4733 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -4772,12 +4782,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:4776: checking for working const" >&5 echo "configure:4786: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4781 "configure" #line 4791 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
@ -4826,7 +4836,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
@ -4847,21 +4857,21 @@ EOF
fi fi
echo $ac_n "checking for inline""... $ac_c" 1>&6 echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:4851: checking for inline" >&5 echo "configure:4861: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_cv_c_inline=no ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4858 "configure" #line 4868 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
} $ac_kw foo() { } $ac_kw foo() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:4875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_inline=$ac_kw; break ac_cv_c_inline=$ac_kw; break
else else
@ -4887,12 +4897,12 @@ EOF
esac esac
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:4891: checking for ANSI C header files" >&5 echo "configure:4901: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4896 "configure" #line 4906 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -4900,7 +4910,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -4917,7 +4927,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4921 "configure" #line 4931 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -4935,7 +4945,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4939 "configure" #line 4949 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -4956,7 +4966,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4960 "configure" #line 4970 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -4967,7 +4977,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:4971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:4981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
: :
else else
@ -4991,12 +5001,12 @@ EOF
fi fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:4995: checking for size_t" >&5 echo "configure:5005: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5000 "configure" #line 5010 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#if STDC_HEADERS #if STDC_HEADERS
@ -5024,7 +5034,7 @@ EOF
fi fi
echo $ac_n "checking size of long long""... $ac_c" 1>&6 echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:5028: checking size of long long" >&5 echo "configure:5038: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5032,7 +5042,7 @@ else
ac_cv_sizeof_long_long=0 ac_cv_sizeof_long_long=0
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5036 "configure" #line 5046 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h> #include <stdio.h>
main() main()
@ -5043,7 +5053,7 @@ main()
exit(0); exit(0);
} }
EOF EOF
if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
ac_cv_sizeof_long_long=`cat conftestval` ac_cv_sizeof_long_long=`cat conftestval`
else else
@ -5066,12 +5076,12 @@ EOF
if test "$ac_cv_header_linux_joystick_h" = "yes" if test "$ac_cv_header_linux_joystick_h" = "yes"
then then
echo $ac_n "checking "whether linux/joystick.h uses the Linux 2.2+ API"""... $ac_c" 1>&6 echo $ac_n "checking "whether linux/joystick.h uses the Linux 2.2+ API"""... $ac_c" 1>&6
echo "configure:5070: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5 echo "configure:5080: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5
if eval "test \"`echo '$''{'wine_cv_linux_joystick_22_api'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_linux_joystick_22_api'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5075 "configure" #line 5085 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -5086,7 +5096,7 @@ int main() {
/*empty*/ /*empty*/
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_linux_joystick_22_api=yes wine_cv_linux_joystick_22_api=yes
else else
@ -5113,12 +5123,12 @@ fi
if test "$ac_cv_header_sys_vfs_h" = "yes" if test "$ac_cv_header_sys_vfs_h" = "yes"
then then
echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6 echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:5117: checking "whether sys/vfs.h defines statfs"" >&5 echo "configure:5127: checking "whether sys/vfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5122 "configure" #line 5132 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -5135,7 +5145,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_sys_vfs_has_statfs=yes wine_cv_sys_vfs_has_statfs=yes
else else
@ -5162,12 +5172,12 @@ fi
if test "$ac_cv_header_sys_statfs_h" = "yes" if test "$ac_cv_header_sys_statfs_h" = "yes"
then then
echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6 echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:5166: checking "whether sys/statfs.h defines statfs"" >&5 echo "configure:5176: checking "whether sys/statfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5171 "configure" #line 5181 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -5182,7 +5192,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_sys_statfs_has_statfs=yes wine_cv_sys_statfs_has_statfs=yes
else else
@ -5209,12 +5219,12 @@ fi
if test "$ac_cv_header_sys_mount_h" = "yes" if test "$ac_cv_header_sys_mount_h" = "yes"
then then
echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6 echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6
echo "configure:5213: checking "whether sys/mount.h defines statfs"" >&5 echo "configure:5223: checking "whether sys/mount.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5218 "configure" #line 5228 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -5229,7 +5239,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_sys_mount_has_statfs=yes wine_cv_sys_mount_has_statfs=yes
else else
@ -5255,7 +5265,7 @@ fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:5259: checking "for statfs.f_bfree"" >&5 echo "configure:5269: checking "for statfs.f_bfree"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5264,7 +5274,7 @@ else
wine_cv_statfs_bfree=no wine_cv_statfs_bfree=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5268 "configure" #line 5278 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -5291,7 +5301,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_statfs_bfree=yes wine_cv_statfs_bfree=yes
else else
@ -5315,7 +5325,7 @@ EOF
fi fi
echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6
echo "configure:5319: checking "for statfs.f_bavail"" >&5 echo "configure:5329: checking "for statfs.f_bavail"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5324,7 +5334,7 @@ else
wine_cv_statfs_bavail=no wine_cv_statfs_bavail=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5328 "configure" #line 5338 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -5351,7 +5361,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_statfs_bavail=yes wine_cv_statfs_bavail=yes
else else
@ -5376,7 +5386,7 @@ fi
echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6 echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6
echo "configure:5380: checking "for working sigaltstack"" >&5 echo "configure:5390: checking "for working sigaltstack"" >&5
if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5385,7 +5395,7 @@ else
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5389 "configure" #line 5399 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h> #include <stdio.h>
@ -5423,7 +5433,7 @@ else
} }
EOF EOF
if { (eval echo configure:5427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:5437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_working_sigaltstack="yes" ac_cv_c_working_sigaltstack="yes"
else else
@ -5450,12 +5460,12 @@ fi
echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6
echo "configure:5454: checking "for msg_accrights in struct msghdr"" >&5 echo "configure:5464: checking "for msg_accrights in struct msghdr"" >&5
if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5459 "configure" #line 5469 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -5463,7 +5473,7 @@ int main() {
struct msghdr hdr; hdr.msg_accrights=0 struct msghdr hdr; hdr.msg_accrights=0
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:5477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_msg_accrights="yes" ac_cv_c_msg_accrights="yes"
else else
@ -5486,12 +5496,12 @@ fi
echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6 echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6
echo "configure:5490: checking "whether we need to define __i386__"" >&5 echo "configure:5500: checking "whether we need to define __i386__"" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5495 "configure" #line 5505 "configure"
#include "confdefs.h" #include "confdefs.h"
#if (defined(i386) || defined(__i386)) && !defined(__i386__) #if (defined(i386) || defined(__i386)) && !defined(__i386__)
yes yes

View File

@ -513,11 +513,21 @@ AC_FUNC_ALLOCA()
AC_CHECK_FUNCS(\ AC_CHECK_FUNCS(\
_lwp_create \ _lwp_create \
clone \ clone \
getnetbyaddr \
getnetbyname \
getpagesize \ getpagesize \
getprotobyname \
getprotobynumber \
getservbyport \
getsockopt \
inet_network \
memmove \ memmove \
rfork \ rfork \
select \
sendmsg \ sendmsg \
settimeofday \
sigaltstack \ sigaltstack \
statfs \
strcasecmp \ strcasecmp \
strerror \ strerror \
strncasecmp \ strncasecmp \

View File

@ -41,6 +41,7 @@
#include "heap.h" #include "heap.h"
#include "msdos.h" #include "msdos.h"
#include "options.h" #include "options.h"
#include "wine/port.h"
#include "task.h" #include "task.h"
#include "debugtools.h" #include "debugtools.h"

View File

@ -151,21 +151,51 @@
/* Define if you have the gethostbyname function. */ /* Define if you have the gethostbyname function. */
#undef HAVE_GETHOSTBYNAME #undef HAVE_GETHOSTBYNAME
/* Define if you have the getnetbyaddr function. */
#undef HAVE_GETNETBYADDR
/* Define if you have the getnetbyname function. */
#undef HAVE_GETNETBYNAME
/* Define if you have the getpagesize function. */ /* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE #undef HAVE_GETPAGESIZE
/* Define if you have the getprotobyname function. */
#undef HAVE_GETPROTOBYNAME
/* Define if you have the getprotobynumber function. */
#undef HAVE_GETPROTOBYNUMBER
/* Define if you have the getservbyport function. */
#undef HAVE_GETSERVBYPORT
/* Define if you have the getsockopt function. */
#undef HAVE_GETSOCKOPT
/* Define if you have the inet_network function. */
#undef HAVE_INET_NETWORK
/* Define if you have the memmove function. */ /* Define if you have the memmove function. */
#undef HAVE_MEMMOVE #undef HAVE_MEMMOVE
/* Define if you have the rfork function. */ /* Define if you have the rfork function. */
#undef HAVE_RFORK #undef HAVE_RFORK
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the sendmsg function. */ /* Define if you have the sendmsg function. */
#undef HAVE_SENDMSG #undef HAVE_SENDMSG
/* Define if you have the settimeofday function. */
#undef HAVE_SETTIMEOFDAY
/* Define if you have the sigaltstack function. */ /* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK #undef HAVE_SIGALTSTACK
/* Define if you have the statfs function. */
#undef HAVE_STATFS
/* Define if you have the strcasecmp function. */ /* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP #undef HAVE_STRCASECMP

108
include/wine/port.h Normal file
View File

@ -0,0 +1,108 @@
/*
* Wine porting definitions
*
*/
#ifndef __WINE_WINE_PORT_H
#define __WINE_WINE_PORT_H
#include "config.h"
#include <sys/types.h>
#include <sys/time.h>
/* Types */
#if !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME)
struct netent {
char *n_name;
char **n_aliases;
int n_addrtype;
unsigned long n_net;
};
#endif /* !defined(HAVE_GETNETBYADDR) && !defined(HAVE_GETNETBYNAME) */
#if !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER)
struct protoent {
char *p_name;
char **p_aliases;
int p_proto;
};
#endif /* !defined(HAVE_GETPROTOBYNAME) && !defined(HAVE_GETPROTOBYNUMBER) */
#ifndef HAVE_STATFS
# ifdef __BEOS__
# define STATFS_HAS_BFREE
struct statfs {
long f_bsize; /* block_size */
long f_blocks; /* total_blocks */
long f_bfree; /* free_blocks */
};
# else /* defined(__BEOS__) */
struct statfs;
# endif /* defined(__BEOS__) */
#endif /* !defined(HAVE_STATFS) */
/* Functions */
#if !defined(HAVE_CLONE) && defined(linux)
int clone(int (*fn)(void *arg), void *stack, int flags, void *arg);
#endif /* !defined(HAVE_CLONE) && defined(linux) */
#ifndef HAVE_GETNETBYADDR
struct netent *getnetbyaddr(unsigned long net, int type);
#endif /* defined(HAVE_GETNETBYNAME) */
#ifndef HAVE_GETNETBYNAME
struct netent *getnetbyname(const char *name);
#endif /* defined(HAVE_GETNETBYNAME) */
#ifndef HAVE_GETPROTOBYNAME
struct protoent *getprotobyname(const char *name);
#endif /* !defined(HAVE_GETPROTOBYNAME) */
#ifndef HAVE_GETPROTOBYNUMBER
struct protoent *getprotobynumber(int proto);
#endif /* !defined(HAVE_GETPROTOBYNUMBER) */
#ifndef HAVE_GETSERVBYPORT
struct servent *getservbyport(int port, const char *proto);
#endif /* !defined(HAVE_GETSERVBYPORT) */
#ifndef HAVE_GETSOCKOPT
int getsockopt(int socket, int level, int option_name, void *option_value, size_t *option_len);
#endif /* !defined(HAVE_GETSOCKOPT) */
#ifndef HAVE_MEMMOVE
void *memmove(void *dest, const void *src, unsigned int len);
#endif /* !defined(HAVE_MEMMOVE) */
#ifndef HAVE_INET_NETWORK
unsigned long inet_network(const char *cp);
#endif /* !defined(HAVE_INET_NETWORK) */
#ifndef HAVE_SETTIMEOFDAY
int settimeofday(struct timeval *tp, void *reserved);
#endif /* !defined(HAVE_SETTIMEOFDAY) */
#ifndef HAVE_STATFS
int statfs(const char *name, struct statfs *info);
#endif /* !defined(HAVE_STATFS) */
#ifndef HAVE_STRNCASECMP
int strncasecmp(const char *str1, const char *str2, size_t n);
#endif /* !defined(HAVE_STRNCASECMP) */
#ifndef HAVE_STRERROR
const char *strerror(int err);
#endif /* !defined(HAVE_STRERROR) */
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *str1, const char *str2);
#endif /* !defined(HAVE_STRCASECMP) */
#ifndef HAVE_USLEEP
int usleep (unsigned int useconds);
#endif /* !defined(HAVE_USLEEP) */
#endif /* !defined(__WINE_WINE_PORT_H) */

View File

@ -4,8 +4,14 @@
* Copyright 1996 Alexandre Julliard * Copyright 1996 Alexandre Julliard
*/ */
#include "config.h" #include "wine/port.h"
#ifdef __BEOS__
#include <be/kernel/fs_info.h>
#include <be/kernel/OS.h>
#endif
#include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -20,13 +26,22 @@
#ifdef HAVE_LIBIO_H #ifdef HAVE_LIBIO_H
# include <libio.h> # include <libio.h>
#endif #endif
#ifdef HAVE_SYSCALL_H
# include <syscall.h>
#endif
/***********************************************************************
* usleep
*/
#ifndef HAVE_USLEEP #ifndef HAVE_USLEEP
#ifdef __EMX__
unsigned int usleep (unsigned int useconds) { DosSleep(useconds); }
#else
unsigned int usleep (unsigned int useconds) unsigned int usleep (unsigned int useconds)
{ {
#if defined(__EMX__)
DosSleep(useconds);
return 0;
#elif defined(__BEOS__)
return snooze(useconds);
#elif defined(HAVE_SELECT)
struct timeval delay; struct timeval delay;
delay.tv_sec = 0; delay.tv_sec = 0;
@ -34,10 +49,16 @@ unsigned int usleep (unsigned int useconds)
select( 0, 0, 0, 0, &delay ); select( 0, 0, 0, 0, &delay );
return 0; return 0;
#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
errno = ENOSYS;
return -1;
#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
} }
#endif
#endif /* HAVE_USLEEP */ #endif /* HAVE_USLEEP */
/***********************************************************************
* memmove
*/
#ifndef HAVE_MEMMOVE #ifndef HAVE_MEMMOVE
void *memmove( void *dest, const void *src, unsigned int len ) void *memmove( void *dest, const void *src, unsigned int len )
{ {
@ -63,6 +84,9 @@ void *memmove( void *dest, const void *src, unsigned int len )
} }
#endif /* HAVE_MEMMOVE */ #endif /* HAVE_MEMMOVE */
/***********************************************************************
* strerror
*/
#ifndef HAVE_STRERROR #ifndef HAVE_STRERROR
const char *strerror( int err ) const char *strerror( int err )
{ {
@ -71,12 +95,10 @@ const char *strerror( int err )
} }
#endif /* HAVE_STRERROR */ #endif /* HAVE_STRERROR */
/***********************************************************************
* clone
*/
#if !defined(HAVE_CLONE) && defined(__linux__) #if !defined(HAVE_CLONE) && defined(__linux__)
#include <assert.h>
#include <errno.h>
#ifdef HAVE_SYSCALL_H
# include <syscall.h>
#endif
int clone( int (*fn)(void *), void *stack, int flags, void *arg ) int clone( int (*fn)(void *), void *stack, int flags, void *arg )
{ {
#ifdef __i386__ #ifdef __i386__
@ -106,7 +128,9 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
} }
#endif /* !HAVE_CLONE && __linux__ */ #endif /* !HAVE_CLONE && __linux__ */
/***********************************************************************
* strcasecmp
*/
#ifndef HAVE_STRCASECMP #ifndef HAVE_STRCASECMP
int strcasecmp( const char *str1, const char *str2 ) int strcasecmp( const char *str1, const char *str2 )
{ {
@ -115,6 +139,9 @@ int strcasecmp( const char *str1, const char *str2 )
} }
#endif /* HAVE_STRCASECMP */ #endif /* HAVE_STRCASECMP */
/***********************************************************************
* strncasecmp
*/
#ifndef HAVE_STRNCASECMP #ifndef HAVE_STRNCASECMP
int strncasecmp( const char *str1, const char *str2, size_t n ) int strncasecmp( const char *str1, const char *str2, size_t n )
{ {
@ -126,13 +153,16 @@ int strncasecmp( const char *str1, const char *str2, size_t n )
} }
#endif /* HAVE_STRNCASECMP */ #endif /* HAVE_STRNCASECMP */
/** /***********************************************************************
* It looks like the openpty that comes with glibc in RedHat 5.0 * wine_openpty
* is buggy (second call returns what looks like a dup of 0 and 1 * NOTE
* instead of a new pty), this is a generic replacement. * It looks like the openpty that comes with glibc in RedHat 5.0
* is buggy (second call returns what looks like a dup of 0 and 1
* instead of a new pty), this is a generic replacement.
*
* FIXME
* We should have a autoconf check for this.
*/ */
/** We will have an autoconf check for this soon... */
int wine_openpty(int *master, int *slave, char *name, int wine_openpty(int *master, int *slave, char *name,
struct termios *term, struct winsize *winsize) struct termios *term, struct winsize *winsize)
{ {
@ -170,3 +200,131 @@ int wine_openpty(int *master, int *slave, char *name,
return -1; return -1;
} }
/***********************************************************************
* getnetbyaddr
*/
#ifndef HAVE_GETNETBYADDR
struct netent *getnetbyaddr(unsigned long net, int type)
{
errno = ENOSYS;
return NULL;
}
#endif /* defined(HAVE_GETNETBYNAME) */
/***********************************************************************
* getnetbyname
*/
#ifndef HAVE_GETNETBYNAME
struct netent *getnetbyname(const char *name)
{
errno = ENOSYS;
return NULL;
}
#endif /* defined(HAVE_GETNETBYNAME) */
/***********************************************************************
* getprotobyname
*/
#ifndef HAVE_GETPROTOBYNAME
struct protoent *getprotobyname(const char *name)
{
errno = ENOSYS;
return NULL;
}
#endif /* !defined(HAVE_GETPROTOBYNAME) */
/***********************************************************************
* getprotobynumber
*/
#ifndef HAVE_GETPROTOBYNUMBER
struct protoent *getprotobynumber(int proto)
{
errno = ENOSYS;
return NULL;
}
#endif /* !defined(HAVE_GETPROTOBYNUMBER) */
/***********************************************************************
* getservbyport
*/
#ifndef HAVE_GETSERVBYPORT
struct servent *getservbyport(int port, const char *proto)
{
errno = ENOSYS;
return NULL;
}
#endif /* !defined(HAVE_GETSERVBYPORT) */
/***********************************************************************
* getsockopt
*/
#ifndef HAVE_GETSOCKOPT
int getsockopt(int socket, int level, int option_name,
void *option_value, size_t *option_len)
{
errno = ENOSYS;
return -1;
}
#endif /* !defined(HAVE_GETSOCKOPT) */
/***********************************************************************
* inet_network
*/
#ifndef HAVE_INET_NETWORK
unsigned long inet_network(const char *cp)
{
errno = ENOSYS;
return 0;
}
#endif /* defined(HAVE_INET_NETWORK) */
/***********************************************************************
* settimeofday
*/
#ifndef HAVE_SETTIMEOFDAY
int settimeofday(struct timeval *tp, void *reserved)
{
tp->tv_sec = 0;
tp->tv_usec = 0;
errno = ENOSYS;
return -1;
}
#endif /* HAVE_SETTIMEOFDAY */
/***********************************************************************
* statfs
*/
#ifndef HAVE_STATFS
int statfs(const char *name, struct statfs *info)
{
#ifdef __BEOS__
dev_t mydev;
fs_info fsinfo;
if(!info) {
errno = ENOSYS;
return -1;
}
if ((mydev = dev_for_path(name)) < 0) {
errno = ENOSYS;
return -1;
}
if (fs_stat_dev(mydev,&fsinfo) < 0) {
errno = ENOSYS;
return -1;
}
info->f_bsize = fsinfo.block_size;
info->f_blocks = fsinfo.total_blocks;
info->f_bfree = fsinfo.free_blocks;
return 0;
#else /* defined(__BEOS__) */
errno = ENOSYS;
return -1;
#endif /* defined(__BEOS__) */
}
#endif /* !defined(HAVE_STATFS) */

View File

@ -77,6 +77,7 @@
#include "task.h" #include "task.h"
#include "message.h" #include "message.h"
#include "miscemu.h" #include "miscemu.h"
#include "wine/port.h"
#include "services.h" #include "services.h"
#include "server.h" #include "server.h"
#include "debugtools.h" #include "debugtools.h"

View File

@ -83,6 +83,7 @@
#include "task.h" #include "task.h"
#include "message.h" #include "message.h"
#include "miscemu.h" #include "miscemu.h"
#include "wine/port.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(winsock) DEFAULT_DEBUG_CHANNEL(winsock)

View File

@ -25,6 +25,7 @@ static int *ph_errno = &h_errno;
#ifdef HAVE_UCONTEXT_H #ifdef HAVE_UCONTEXT_H
# include <ucontext.h> # include <ucontext.h>
#endif #endif
#include "wine/port.h"
#include "thread.h" #include "thread.h"
#include "server.h" #include "server.h"
#include "winbase.h" #include "winbase.h"
@ -33,14 +34,10 @@ static int *ph_errno = &h_errno;
DEFAULT_DEBUG_CHANNEL(thread) DEFAULT_DEBUG_CHANNEL(thread)
#ifdef linux
#define HAVE_CLONE_SYSCALL
#endif
/* Xlib critical section (FIXME: does not belong here) */ /* Xlib critical section (FIXME: does not belong here) */
CRITICAL_SECTION X11DRV_CritSection = { 0, }; CRITICAL_SECTION X11DRV_CritSection = { 0, };
#ifdef HAVE_CLONE_SYSCALL #ifdef linux
# ifdef HAVE_SCHED_H # ifdef HAVE_SCHED_H
# include <sched.h> # include <sched.h>
# endif # endif
@ -50,10 +47,8 @@ CRITICAL_SECTION X11DRV_CritSection = { 0, };
# define CLONE_FILES 0x00000400 # define CLONE_FILES 0x00000400
# define CLONE_SIGHAND 0x00000800 # define CLONE_SIGHAND 0x00000800
# define CLONE_PID 0x00001000 # define CLONE_PID 0x00001000
/* If we didn't get the flags, we probably didn't get the prototype either */
extern int clone( int (*fn)(void *arg), void *stack, int flags, void *arg );
# endif /* CLONE_VM */ # endif /* CLONE_VM */
#endif /* HAVE_CLONE_SYSCALL */ #endif /* linux */
static int init_done; static int init_done;
@ -155,7 +150,7 @@ int SYSDEPS_SpawnThread( TEB *teb )
{ {
#ifndef NO_REENTRANT_LIBC #ifndef NO_REENTRANT_LIBC
#ifdef HAVE_CLONE_SYSCALL #ifdef linux
if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top, if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top,
CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, teb ) < 0) CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, teb ) < 0)
return -1; return -1;