From c26063818fb4653e2e3c6c3d15002fe3a83e8b7c Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 11 Apr 1999 15:20:29 +0000 Subject: [PATCH] - Started multithreading for FreeBSD (incomplete, but some applications now at least start up again). - Use _thread_sys_sigaction/_thread_sys_sigaltstack. - CR2 on pagefault gets passed in sc_err (some kind of kludge in FreeBSD owns fault handling we can use) --- configure | 360 +++++++++++++++++++++++++----------------- configure.in | 22 ++- include/config.h.in | 6 + include/sig_context.h | 13 +- loader/signal.c | 23 ++- scheduler/sysdeps.c | 39 ++++- 6 files changed, 310 insertions(+), 153 deletions(-) diff --git a/configure b/configure index 79d4c8bda86..ae91154f20b 100755 --- a/configure +++ b/configure @@ -2271,8 +2271,55 @@ else echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking for __error in -lc_r""... $ac_c" 1>&6 +echo "configure:2276: checking for __error in -lc_r" >&5 +ac_lib_var=`echo c_r'_'__error | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_r $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo c_r | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2276: checking for dlopen in -ldl" >&5 +echo "configure:2323: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2280,7 +2327,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2329,17 +2376,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2333: checking for $ac_hdr" >&5 +echo "configure:2380: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2368,7 +2415,7 @@ done if test "$ac_cv_header_X11_xpm_h" = "yes" then echo $ac_n "checking for XpmCreatePixmapFromData in -lXpm""... $ac_c" 1>&6 -echo "configure:2372: checking for XpmCreatePixmapFromData in -lXpm" >&5 +echo "configure:2419: checking for XpmCreatePixmapFromData in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromData | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2376,7 +2423,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXpm $X_LIBS -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2416,17 +2463,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2420: checking for $ac_hdr" >&5 +echo "configure:2467: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2455,7 +2502,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes" then echo $ac_n "checking for XShmQueryExtension in -lXext""... $ac_c" 1>&6 -echo "configure:2459: checking for XShmQueryExtension in -lXext" >&5 +echo "configure:2506: checking for XShmQueryExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XShmQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2463,7 +2510,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext $X_LIBS -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2502,17 +2549,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2506: checking for $ac_hdr" >&5 +echo "configure:2553: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2541,7 +2588,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes" then echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:2545: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 +echo "configure:2592: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2549,7 +2596,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2589,17 +2636,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2593: checking for $ac_hdr" >&5 +echo "configure:2640: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2628,7 +2675,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes" then echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6 -echo "configure:2632: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 +echo "configure:2679: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2636,7 +2683,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86vm $X_LIBS -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2676,17 +2723,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2680: checking for $ac_hdr" >&5 +echo "configure:2727: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2715,19 +2762,19 @@ done if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_osmesa_h" = "yes" then echo $ac_n "checking "for up-to-date Mesa version"""... $ac_c" 1>&6 -echo "configure:2719: checking "for up-to-date Mesa version"" >&5 +echo "configure:2766: checking "for up-to-date Mesa version"" >&5 if eval "test \"`echo '$''{'wine_cv_mesa_version_OK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { GLenum test = GL_UNSIGNED_SHORT_5_6_5; ; return 0; } EOF -if { (eval echo configure:2731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_mesa_version_OK="yes" else @@ -2746,7 +2793,7 @@ echo "$ac_t""$wine_cv_mesa_version_OK" 1>&6 if test "$wine_cv_mesa_version_OK" = "yes" then echo $ac_n "checking for OSMesaCreateContext in -lMesaGL""... $ac_c" 1>&6 -echo "configure:2750: checking for OSMesaCreateContext in -lMesaGL" >&5 +echo "configure:2797: checking for OSMesaCreateContext in -lMesaGL" >&5 ac_lib_var=`echo MesaGL'_'OSMesaCreateContext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2754,7 +2801,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lMesaGL $X_LIBS -lXext -lX11 -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2802,17 +2849,17 @@ for ac_hdr in ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2806: checking for $ac_hdr" >&5 +echo "configure:2853: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2841,7 +2888,7 @@ done if test "$ac_cv_header_ncurses_h" = "yes" then echo $ac_n "checking for waddch in -lncurses""... $ac_c" 1>&6 -echo "configure:2845: checking for waddch in -lncurses" >&5 +echo "configure:2892: checking for waddch in -lncurses" >&5 ac_lib_var=`echo ncurses'_'waddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2849,7 +2896,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2891,7 +2938,7 @@ fi if test "$ac_cv_lib_ncurses_waddch" = "yes" then echo $ac_n "checking for resizeterm in -lncurses""... $ac_c" 1>&6 -echo "configure:2895: checking for resizeterm in -lncurses" >&5 +echo "configure:2942: checking for resizeterm in -lncurses" >&5 ac_lib_var=`echo ncurses'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2899,7 +2946,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2934,7 +2981,7 @@ else fi echo $ac_n "checking for getbkgd in -lncurses""... $ac_c" 1>&6 -echo "configure:2938: checking for getbkgd in -lncurses" >&5 +echo "configure:2985: checking for getbkgd in -lncurses" >&5 ac_lib_var=`echo ncurses'_'getbkgd | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2942,7 +2989,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2981,17 +3028,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2985: checking for $ac_hdr" >&5 +echo "configure:3032: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3020,7 +3067,7 @@ done if test "$ac_cv_header_curses_h" = "yes" then echo $ac_n "checking for waddch in -lcurses""... $ac_c" 1>&6 -echo "configure:3024: checking for waddch in -lcurses" >&5 +echo "configure:3071: checking for waddch in -lcurses" >&5 ac_lib_var=`echo curses'_'waddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3028,7 +3075,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3067,7 +3114,7 @@ else fi echo $ac_n "checking for resizeterm in -lcurses""... $ac_c" 1>&6 -echo "configure:3071: checking for resizeterm in -lcurses" >&5 +echo "configure:3118: checking for resizeterm in -lcurses" >&5 ac_lib_var=`echo curses'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3075,7 +3122,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3110,7 +3157,7 @@ else fi echo $ac_n "checking for getbkgd in -lcurses""... $ac_c" 1>&6 -echo "configure:3114: checking for getbkgd in -lcurses" >&5 +echo "configure:3161: checking for getbkgd in -lcurses" >&5 ac_lib_var=`echo curses'_'getbkgd | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3118,7 +3165,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3156,12 +3203,12 @@ fi fi echo $ac_n "checking "for GNU style IPX support"""... $ac_c" 1>&6 -echo "configure:3160: checking "for GNU style IPX support"" >&5 +echo "configure:3207: checking "for GNU style IPX support"" >&5 if eval "test \"`echo '$''{'ac_cv_c_ipx_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3169,7 +3216,7 @@ int main() { ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX ; return 0; } EOF -if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IPX_GNU 1 @@ -3191,12 +3238,12 @@ echo "$ac_t""$ac_cv_c_ipx_gnu" 1>&6 if test "$ac_cv_c_ipx_gnu" = "no" then echo $ac_n "checking "for linux style IPX support"""... $ac_c" 1>&6 -echo "configure:3195: checking "for linux style IPX support"" >&5 +echo "configure:3242: checking "for linux style IPX support"" >&5 if eval "test \"`echo '$''{'ac_cv_c_ipx_linux'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3205,7 +3252,7 @@ int main() { ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX ; return 0; } EOF -if { (eval echo configure:3209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IPX_LINUX 1 @@ -3229,17 +3276,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3233: checking for $ac_hdr" >&5 +echo "configure:3280: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3267,12 +3314,12 @@ done echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6 -echo "configure:3271: checking "for Open Sound System"" >&5 +echo "configure:3318: checking "for Open Sound System"" >&5 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_opensoundsystem="yes" else @@ -3317,12 +3364,12 @@ fi echo $ac_n "checking "for union semun"""... $ac_c" 1>&6 -echo "configure:3321: checking "for union semun"" >&5 +echo "configure:3368: checking "for union semun"" >&5 if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3330,7 +3377,7 @@ int main() { union semun foo ; return 0; } EOF -if { (eval echo configure:3334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_union_semun="yes" else @@ -3358,7 +3405,7 @@ if test "x${GCC}" = "xyes" then CFLAGS="$CFLAGS -Wall" echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 -echo "configure:3362: checking "for gcc strength-reduce bug"" >&5 +echo "configure:3409: checking "for gcc strength-reduce bug"" >&5 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3366,7 +3413,7 @@ else ac_cv_c_gcc_strength_bug="yes" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_gcc_strength_bug="no" else @@ -3400,7 +3447,7 @@ fi echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 -echo "configure:3404: checking "whether external symbols need an underscore prefix"" >&5 +echo "configure:3451: checking "whether external symbols need an underscore prefix"" >&5 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3412,14 +3459,14 @@ _ac_test: .long 0 EOF cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_extern_prefix="yes" else @@ -3443,7 +3490,7 @@ fi echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 -echo "configure:3447: checking "whether assembler accepts .string"" >&5 +echo "configure:3494: checking "whether assembler accepts .string"" >&5 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3453,14 +3500,14 @@ cat > conftest_asm.s < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_asm_string="yes" else @@ -3488,21 +3535,21 @@ LDSHARED="" if test "$LIB_TARGET" = "libwine.so.1.0" then echo $ac_n "checking "whether we can build a Linux dll"""... $ac_c" 1>&6 -echo "configure:3492: checking "whether we can build a Linux dll"" >&5 +echo "configure:3539: checking "whether we can build a Linux dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll_linux'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll_linux="yes" else @@ -3523,21 +3570,21 @@ echo "$ac_t""$ac_cv_c_dll_linux" 1>&6 LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so" else echo $ac_n "checking "whether we can build a NetBSD dll"""... $ac_c" 1>&6 -echo "configure:3527: checking "whether we can build a NetBSD dll"" >&5 +echo "configure:3574: checking "whether we can build a NetBSD dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll_netbsd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll_netbsd="yes" else @@ -3568,7 +3615,7 @@ fi echo $ac_n "checking "for reentrant libc"""... $ac_c" 1>&6 -echo "configure:3572: checking "for reentrant libc"" >&5 +echo "configure:3619: checking "for reentrant libc"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3576,14 +3623,14 @@ else wine_cv_libc_reentrant=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then wine_cv_libc_reentrant=yes else @@ -3594,7 +3641,34 @@ else fi rm -fr conftest* fi - + + if test "$wine_cv_libc_reentrant" = "no" + then + if test "$cross_compiling" = yes; then + wine_cv_libc_reentrant=yes +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + wine_cv_libc_reentrant=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + wine_cv_libc_reentrant=no +fi +rm -fr conftest* +fi + + fi + fi echo "$ac_t""$wine_cv_libc_reentrant" 1>&6 @@ -3610,7 +3684,7 @@ fi if test "$have_x" = "yes" then echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 -echo "configure:3614: checking "for reentrant X libraries"" >&5 +echo "configure:3688: checking "for reentrant X libraries"" >&5 if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3655,15 +3729,15 @@ EOF fi -for ac_func in clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf +for ac_func in rfork clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3662: checking for $ac_func" >&5 +echo "configure:3736: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3714,17 +3788,17 @@ for ac_hdr in wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3718: checking for $ac_hdr" >&5 +echo "configure:3792: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3751,12 +3825,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3755: checking whether stat file-mode macros are broken" >&5 +echo "configure:3829: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3807,12 +3881,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3811: checking for working const" >&5 +echo "configure:3885: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3882,12 +3956,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3886: checking for ANSI C header files" >&5 +echo "configure:3960: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3895,7 +3969,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3912,7 +3986,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3930,7 +4004,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3951,7 +4025,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3962,7 +4036,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -3986,12 +4060,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3990: checking for size_t" >&5 +echo "configure:4064: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4019,7 +4093,7 @@ EOF fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4023: checking size of long long" >&5 +echo "configure:4097: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4027,7 +4101,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -4038,7 +4112,7 @@ main() exit(0); } EOF -if { (eval echo configure:4042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4061,7 +4135,7 @@ EOF if test $ac_cv_func_sendmsg = no; then echo $ac_n "checking for sendmsg in -lsocket""... $ac_c" 1>&6 -echo "configure:4065: checking for sendmsg in -lsocket" >&5 +echo "configure:4139: checking for sendmsg in -lsocket" >&5 ac_lib_var=`echo socket'_'sendmsg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4069,7 +4143,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4113,12 +4187,12 @@ fi if test "$ac_cv_header_sys_vfs_h" = "yes" then echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:4117: checking "whether sys/vfs.h defines statfs"" >&5 +echo "configure:4191: checking "whether sys/vfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4135,7 +4209,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_vfs_has_statfs=yes else @@ -4162,12 +4236,12 @@ fi if test "$ac_cv_header_sys_statfs_h" = "yes" then echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:4166: checking "whether sys/statfs.h defines statfs"" >&5 +echo "configure:4240: checking "whether sys/statfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4182,7 +4256,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_statfs_has_statfs=yes else @@ -4209,12 +4283,12 @@ fi if test "$ac_cv_header_sys_mount_h" = "yes" then echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6 -echo "configure:4213: checking "whether sys/mount.h defines statfs"" >&5 +echo "configure:4287: checking "whether sys/mount.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4229,7 +4303,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_mount_has_statfs=yes else @@ -4255,7 +4329,7 @@ fi echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 -echo "configure:4259: checking "for statfs.f_bfree"" >&5 +echo "configure:4333: checking "for statfs.f_bfree"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4264,7 +4338,7 @@ else wine_cv_statfs_bfree=no else cat > conftest.$ac_ext < @@ -4291,7 +4365,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bfree=yes else @@ -4315,7 +4389,7 @@ EOF fi echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 -echo "configure:4319: checking "for statfs.f_bavail"" >&5 +echo "configure:4393: checking "for statfs.f_bavail"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4324,7 +4398,7 @@ else wine_cv_statfs_bavail=no else cat > conftest.$ac_ext < @@ -4351,7 +4425,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bavail=yes else @@ -4376,7 +4450,7 @@ fi echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6 -echo "configure:4380: checking "for working sigaltstack"" >&5 +echo "configure:4454: checking "for working sigaltstack"" >&5 if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4385,7 +4459,7 @@ else else cat > conftest.$ac_ext < @@ -4423,7 +4497,7 @@ else } EOF -if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_working_sigaltstack="yes" else @@ -4450,12 +4524,12 @@ fi echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 -echo "configure:4454: checking "for msg_accrights in struct msghdr"" >&5 +echo "configure:4528: checking "for msg_accrights in struct msghdr"" >&5 if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4463,7 +4537,7 @@ int main() { struct msghdr hdr; hdr.msg_accrights=0 ; return 0; } EOF -if { (eval echo configure:4467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_msg_accrights="yes" else diff --git a/configure.in b/configure.in index 536f2fad76b..e65916f47be 100644 --- a/configure.in +++ b/configure.in @@ -91,6 +91,8 @@ then fi dnl Check for -lxpg4 for FreeBSD AC_CHECK_LIB(xpg4,setrunelocale) +dnl Check for -lc_r for FreeBSD +AC_CHECK_LIB(c_r,__error) dnl Check for -ldl AC_CHECK_LIB(dl,dlopen) AC_SUBST(XLIB) @@ -342,13 +344,29 @@ dnl dnl For cross-compiling we blindly assume that libc is reentrant. This is dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions). +dnl +dnl Linux style errno location +dnl AC_CACHE_CHECK("for reentrant libc", wine_cv_libc_reentrant, [AC_TRY_RUN([int myerrno = 0; char buf[256]; int *__errno_location(){return &myerrno;} main(){connect(0,buf,255); exit(!myerrno);}], wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no, - wine_cv_libc_reentrant=yes ) ] ) + wine_cv_libc_reentrant=yes ) +dnl +dnl FreeBSD style errno location +dnl + if test "$wine_cv_libc_reentrant" = "no" + then + AC_TRY_RUN([int myerrno = 0; +char buf[256]; +int *__error(){return &myerrno;} +main(){connect(0,buf,255); exit(!myerrno);}], + wine_cv_libc_reentrant=yes, wine_cv_libc_reentrant=no, + wine_cv_libc_reentrant=yes ) + fi +]) if test "$wine_cv_libc_reentrant" = "no" then AC_DEFINE(NO_REENTRANT_LIBC) @@ -399,7 +417,7 @@ fi dnl **** Check for functions and header files **** -AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf) +AC_CHECK_FUNCS(rfork clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf) AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h dlfcn.h unistd.h sys/sockio.h net/if.h netinet/in.h sys/file.h libio.h curses.h ncurses.h elf.h arpa/nameser.h resolv.h) AC_HEADER_STAT() AC_C_CONST() diff --git a/include/config.h.in b/include/config.h.in index dfce820a213..631392673c3 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -102,6 +102,9 @@ /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE +/* Define if you have the rfork function. */ +#undef HAVE_RFORK + /* Define if you have the sendmsg function. */ #undef HAVE_SENDMSG @@ -243,6 +246,9 @@ /* Define if you have the header file. */ #undef HAVE_WCTYPE_H +/* Define if you have the c_r library (-lc_r). */ +#undef HAVE_LIBC_R + /* Define if you have the curses library (-lcurses). */ #undef HAVE_LIBCURSES diff --git a/include/sig_context.h b/include/sig_context.h index 57a53f2ce8b..cd461870529 100644 --- a/include/sig_context.h +++ b/include/sig_context.h @@ -153,19 +153,24 @@ typedef struct _CONTEXT /* Note 1 */ #define SS_sig(context) ((context)->sc_ss) #ifdef linux -/* fs and gs are not supported on *BSD. */ +/* FS and GS are now in the sigcontext struct of FreeBSD, but not + * saved by the exception handling. duh. + */ #define FS_sig(context) ((context)->sc_fs) #define GS_sig(context) ((context)->sc_gs) #define CR2_sig(context) ((context)->cr2) #define TRAP_sig(context) ((context)->sc_trapno) #endif - -#ifndef __FreeBSD__ + +#ifndef __FreeBSD__ #define EFL_sig(context) ((context)->sc_eflags) #else #define EFL_sig(context) ((context)->sc_efl) +/* FreeBSD, see i386/i386/traps.c::trap_pfault va->err kludge */ +#define CR2_sig(context) ((context)->sc_err) #endif - + + #define EIP_sig(context) (*((unsigned long*)&(context)->sc_eip)) #define ESP_sig(context) (*((unsigned long*)&(context)->sc_esp)) diff --git a/loader/signal.c b/loader/signal.c index 2851fb010c1..40440a71d25 100644 --- a/loader/signal.c +++ b/loader/signal.c @@ -7,6 +7,7 @@ #include "config.h" #include +#include #include #include #include @@ -43,6 +44,10 @@ void (*fnWINE_Debugger)(int,SIGCONTEXT*) = NULL; void (*ctx_debug_call)(int sig,CONTEXT*ctx)=NULL; BOOL (*fnINSTR_EmulateInstruction)(SIGCONTEXT*ctx)=NULL; + +#define SIGACTION sigaction +#define SIGALTSTACK sigaltstack + #ifdef __i386__ /* i386 specific faults */ @@ -75,6 +80,7 @@ static const char * const SIGNAL_traps[] = #if defined(linux) && defined(__i386__) /* This is the sigaction structure from the Linux 2.1.20 kernel. */ + #undef sa_handler struct kernel_sigaction { @@ -112,8 +118,19 @@ static __inline__ int wine_sigaction( int sig, struct kernel_sigaction *new, errno = -sig; return -1; } +#undef SIGACTION +#define SIGACTION wine_sigaction #endif /* linux && __i386__ */ +#ifdef __FreeBSD__ +#undef SIGACTION +#define SIGACTION _thread_sys_sigaction +extern int _thread_sys_sigaction(int sig,const struct sigaction*act,struct sigaction* oact); +#undef SIGALTSTACK +#define SIGALTSTACK _thread_sys_sigaltstack +extern int _thread_sys_sigaltstack(const struct sigaltstack *ss,struct sigaltstack *oss); +#endif + /* Signal stack */ static char SIGNAL_Stack[16384]; @@ -172,7 +189,7 @@ void SIGNAL_SetHandler( int sig, void (*func)(), int flags ) # else sig_act.sa_flags = 0; # endif - ret = sigaction( sig, &sig_act, NULL ); + ret = SIGACTION( sig, &sig_act, NULL ); #endif /* linux && __i386__ */ @@ -298,9 +315,9 @@ BOOL SIGNAL_Init(void) ss.ss_sp = SIGNAL_Stack; ss.ss_size = sizeof(SIGNAL_Stack); ss.ss_flags = 0; - if (sigaltstack(&ss, NULL) < 0) + if (SIGALTSTACK(&ss, NULL) < 0) { - perror("sigstack"); + perror("sigaltstack"); return FALSE; } #endif /* HAVE_SIGALTSTACK */ diff --git a/scheduler/sysdeps.c b/scheduler/sysdeps.c index fa5034ebeb1..a579aefc267 100644 --- a/scheduler/sysdeps.c +++ b/scheduler/sysdeps.c @@ -4,6 +4,8 @@ * Copyright 1998 Alexandre Julliard */ +#include "config.h" + /* Get pointers to the static errno and h_errno variables used by Xlib. This must be done before including makes the variables invisible. */ extern int errno; @@ -14,11 +16,15 @@ static int *ph_errno = &h_errno; #include #include #include +#ifdef HAVE_SYS_SYSCALL_H +# include +#endif #include "thread.h" #include "server.h" #include "winbase.h" #include "debug.h" + /* Xlib critical section (FIXME: does not belong here) */ CRITICAL_SECTION X11DRV_CritSection = { 0, }; @@ -39,6 +45,7 @@ extern int clone( int (*fn)(void *arg), void *stack, int flags, void *arg ); #ifdef USE_THREADS +#ifdef linux /*********************************************************************** * __errno_location * @@ -72,6 +79,20 @@ int *__h_errno_location() #endif return &thdb->thread_h_errno; } +#endif + +#ifdef __FreeBSD__ +int *__error() { + THDB *thdb = THREAD_Current(); + if (!thdb) return perrno; +#ifdef NO_REENTRANT_X11 + /* Use static libc errno while running in Xlib. */ + if (X11DRV_CritSection.OwningThread == (HANDLE)thdb->server_tid) + return perrno; +#endif + return &thdb->thread_errno; +} +#endif /*********************************************************************** * SYSDEPS_StartThread @@ -107,7 +128,23 @@ int SYSDEPS_SpawnThread( THDB *thread ) #endif #ifdef HAVE_RFORK - FIXME(thread, "Threads using rfork() not implemented\n" ); + DWORD *sp = (DWORD *)thread->teb.stack_top; + *--sp = (DWORD)thread; + *--sp = 0; + *--sp = (DWORD)SYSDEPS_StartThread; + __asm__( + "pushl %2;\n\t" /* RFPROC|RMEM */ + "pushl $0;\n\t" /* 0 ? */ + "movl %1,%%eax;\n\t" /* SYS_rfork */ + ".byte 0x9a; .long 0; .word 7;\n\t" /* lcall 7:0... FreeBSD syscall */ + "cmpl $0, %%edx;\n\t" + "je 1f;\n\t" + "movl %0,%%esp;\n\t" /* father -> new thread */ + "ret;\n" + "1:\n\t" /* child -> caller thread */ + "addl $8,%%esp" : + : "r" (sp), "g" (SYS_rfork), "g" (RFPROC|RFMEM) + : "eax", "edx"); #endif #else /* !USE_THREADS */