diff --git a/Make.rules.in b/Make.rules.in index 20b74bb150e..c341ba4ce75 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -103,10 +103,10 @@ OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) $(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $< .spec.spec.c: - $(BUILD) -o $@ -spec $< + $(BUILD) @BUILDFLAGS@ -o $@ -spec $< .c.glue.s: - $(BUILD) -o $@ -glue $< + $(BUILD) @BUILDFLAGS@ -o $@ -glue $< # Rule to rebuild the resource compiler diff --git a/Makefile.in b/Makefile.in index a322cd7085b..40b483cd603 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,6 +42,7 @@ LIBSUBDIRS = \ dlls/tapi32 \ dlls/ver \ dlls/version \ + dlls/win87em \ dlls/winaspi \ dlls/winspool \ dlls/wnaspi32 \ @@ -51,6 +52,8 @@ LIBSUBDIRS = \ graphics/metafiledrv \ graphics/psdrv \ graphics/ttydrv \ + graphics/win16drv \ + if1632 \ library \ loader \ loader/ne \ @@ -76,8 +79,6 @@ X11SUBDIRS = \ EMUSUBDIRS = \ debugger \ - graphics/win16drv \ - if1632 \ miscemu PROGSUBDIRS = libtest programs @@ -117,6 +118,7 @@ LIBOBJS = \ dlls/tapi32/tapi32.o \ dlls/ver/ver.o \ dlls/version/version.o \ + dlls/win87em/win87em.o \ dlls/winaspi/winaspi.o \ dlls/winspool/winspool.o \ dlls/wnaspi32/wnaspi32.o \ @@ -126,6 +128,8 @@ LIBOBJS = \ graphics/metafiledrv/metafiledrv.o \ graphics/psdrv/psdrv.o \ graphics/ttydrv/ttydrv.o \ + graphics/win16drv/win16drv.o \ + if1632/if1632.o \ loader/loader.o \ loader/ne/ne.o \ loader/dos/dos.o \ @@ -150,8 +154,6 @@ X11OBJS = \ EMUOBJS = \ debugger/debugger.o \ - graphics/win16drv/win16drv.o \ - if1632/if1632.o \ miscemu/miscemu.o LIB_TARGET = @LIB_TARGET@ diff --git a/configure b/configure index 8761a3f750f..1cd7392ad05 100755 --- a/configure +++ b/configure @@ -3819,25 +3819,26 @@ fi DLLFLAGS="" +BUILDFLAGS="" 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:3827: checking "whether we can build a Linux dll"" >&5 +echo "configure:3828: 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:3842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll_linux="yes" else @@ -3854,25 +3855,26 @@ fi echo "$ac_t""$ac_cv_c_dll_linux" 1>&6 if test "$ac_cv_c_dll_linux" = "yes" then + BUILDFLAGS="-pic" DLLFLAGS="-fPIC" 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:3862: checking "whether we can build a NetBSD dll"" >&5 +echo "configure:3864: 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:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll_netbsd="yes" else @@ -3889,6 +3891,7 @@ fi echo "$ac_t""$ac_cv_c_dll_netbsd" 1>&6 if test "$ac_cv_c_dll_netbsd" = "yes" then + BUILDFLAGS="-pic" DLLFLAGS="-fPIC" LDSHARED="ld -Bshareable -Bforcearchive" fi @@ -3902,9 +3905,10 @@ fi + wine_cv_libc_reentrant=no echo $ac_n "checking "for reentrant libc: __errno_location"""... $ac_c" 1>&6 -echo "configure:3908: checking "for reentrant libc: __errno_location"" >&5 +echo "configure:3912: checking "for reentrant libc: __errno_location"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r__errno_location'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3912,14 +3916,14 @@ else wine_cv_libc_r__errno_location=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then wine_cv_libc_r__errno_location=yes else @@ -3944,7 +3948,7 @@ EOF wine_cv_libc_reentrant=__errno_location fi echo $ac_n "checking "for reentrant libc: __error"""... $ac_c" 1>&6 -echo "configure:3948: checking "for reentrant libc: __error"" >&5 +echo "configure:3952: checking "for reentrant libc: __error"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r__error'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3952,14 +3956,14 @@ else wine_cv_libc_r__error=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then wine_cv_libc_r__error=yes else @@ -3984,7 +3988,7 @@ EOF wine_cv_libc_reentrant=__error fi echo $ac_n "checking "for reentrant libc: ___errno"""... $ac_c" 1>&6 -echo "configure:3988: checking "for reentrant libc: ___errno"" >&5 +echo "configure:3992: checking "for reentrant libc: ___errno"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r___errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3992,14 +3996,14 @@ else wine_cv_libc_r___errno=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then wine_cv_libc_r___errno=yes else @@ -4035,7 +4039,7 @@ fi if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no" then echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 -echo "configure:4039: checking "for reentrant X libraries"" >&5 +echo "configure:4043: 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 @@ -4083,19 +4087,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4087: checking for working alloca.h" >&5 +echo "configure:4091: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4116,12 +4120,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4120: checking for alloca" >&5 +echo "configure:4124: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+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:4152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4176,12 +4180,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4180: checking whether alloca needs Cray hooks" >&5 +echo "configure:4184: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4210: checking for $ac_func" >&5 +echo "configure:4214: 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:4242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4261,7 +4265,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4265: checking stack direction for C alloca" >&5 +echo "configure:4269: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4269,7 +4273,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4328,12 +4332,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4332: checking for $ac_func" >&5 +echo "configure:4336: 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:4364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4418,17 +4422,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4422: checking for $ac_hdr" >&5 +echo "configure:4426: 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:4432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4455,12 +4459,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:4459: checking whether stat file-mode macros are broken" >&5 +echo "configure:4463: 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 @@ -4513,12 +4517,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4517: checking for working const" >&5 +echo "configure:4521: 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:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4588,21 +4592,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4592: checking for inline" >&5 +echo "configure:4596: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -4628,12 +4632,12 @@ EOF esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4632: checking for ANSI C header files" >&5 +echo "configure:4636: 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 @@ -4641,7 +4645,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4658,7 +4662,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 @@ -4676,7 +4680,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 @@ -4697,7 +4701,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4708,7 +4712,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -4732,12 +4736,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:4736: checking for size_t" >&5 +echo "configure:4740: 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 @@ -4765,7 +4769,7 @@ EOF fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4769: checking size of long long" >&5 +echo "configure:4773: 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 @@ -4773,7 +4777,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -4784,7 +4788,7 @@ main() exit(0); } EOF -if { (eval echo configure:4788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4792: \"$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 @@ -4808,12 +4812,12 @@ EOF 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:4812: checking "whether sys/vfs.h defines statfs"" >&5 +echo "configure:4816: 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 < @@ -4830,7 +4834,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_vfs_has_statfs=yes else @@ -4857,12 +4861,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:4861: checking "whether sys/statfs.h defines statfs"" >&5 +echo "configure:4865: 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 < @@ -4877,7 +4881,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_statfs_has_statfs=yes else @@ -4904,12 +4908,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:4908: checking "whether sys/mount.h defines statfs"" >&5 +echo "configure:4912: 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 < @@ -4924,7 +4928,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_mount_has_statfs=yes else @@ -4950,7 +4954,7 @@ fi echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 -echo "configure:4954: checking "for statfs.f_bfree"" >&5 +echo "configure:4958: 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 @@ -4959,7 +4963,7 @@ else wine_cv_statfs_bfree=no else cat > conftest.$ac_ext < @@ -4986,7 +4990,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bfree=yes else @@ -5010,7 +5014,7 @@ EOF fi echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 -echo "configure:5014: checking "for statfs.f_bavail"" >&5 +echo "configure:5018: 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 @@ -5019,7 +5023,7 @@ else wine_cv_statfs_bavail=no else cat > conftest.$ac_ext < @@ -5046,7 +5050,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bavail=yes else @@ -5071,7 +5075,7 @@ fi echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6 -echo "configure:5075: checking "for working sigaltstack"" >&5 +echo "configure:5079: 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 @@ -5080,7 +5084,7 @@ else else cat > conftest.$ac_ext < @@ -5118,7 +5122,7 @@ else } EOF -if { (eval echo configure:5122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5126: \"$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 @@ -5145,12 +5149,12 @@ fi echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 -echo "configure:5149: checking "for msg_accrights in struct msghdr"" >&5 +echo "configure:5153: 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 @@ -5158,7 +5162,7 @@ int main() { struct msghdr hdr; hdr.msg_accrights=0 ; return 0; } EOF -if { (eval echo configure:5162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_msg_accrights="yes" else @@ -5181,12 +5185,12 @@ fi echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6 -echo "configure:5185: checking "whether we need to define __i386__"" >&5 +echo "configure:5189: checking "whether we need to define __i386__"" >&5 if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <= &Call16_Start + && (char *)EIP_sig(context) < &Call16_End ) { /* Saved selector may have become invalid when the relay code */ /* tries to restore it. We simply clear it. */ diff --git a/miscemu/Makefile.in b/miscemu/Makefile.in index 75542b4dfce..1030b0c3fda 100644 --- a/miscemu/Makefile.in +++ b/miscemu/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = miscemu C_SRCS = \ - emulate.c \ main.c all: $(MODULE).o diff --git a/miscemu/main.c b/miscemu/main.c index bf6b90576da..8c8ce209097 100644 --- a/miscemu/main.c +++ b/miscemu/main.c @@ -23,13 +23,6 @@ static int MAIN_argc; static char **MAIN_argv; -extern int (*INSTR_IsRelay)( const void *addr ); - -static int is_relay_addr( const void *addr ) -{ - extern char Call16_Start, Call16_End; - return ((char *)addr >= &Call16_Start) && ((char *)addr < &Call16_End); -} /*********************************************************************** * Emulator initialisation @@ -149,7 +142,6 @@ int main( int argc, char *argv[] ) MAIN_argc = argc; MAIN_argv = argv; /* Set up debugger hook */ - INSTR_IsRelay = is_relay_addr; EXC_SetDebugEventHook( wine_debugger ); if (Options.debug) diff --git a/relay32/Makefile.in b/relay32/Makefile.in index c10e5dd192c..1b442975cf3 100644 --- a/relay32/Makefile.in +++ b/relay32/Makefile.in @@ -64,6 +64,6 @@ all: $(MODULE).o @MAKE_RULES@ call32.s: $(BUILD) - $(BUILD) -o $@ -call32 + $(BUILD) @BUILDFLAGS@ -o $@ -call32 ### Dependencies: diff --git a/tools/build.c b/tools/build.c index 0845a56a56b..b10a5b44e9e 100644 --- a/tools/build.c +++ b/tools/build.c @@ -168,6 +168,8 @@ char *ParseNext; char ParseSaveChar; int Line; +static int UsePIC = 0; + static int debugging = 1; /* Offset of a structure field relative to the start of the struct */ @@ -870,6 +872,8 @@ static int BuildModule16( FILE *outfile, int max_code_offset, strcpy( pFileInfo->szPathName, DLLFileName ); pstr = (char *)pFileInfo + pFileInfo->cBytes + 1; +#ifdef __i386__ /* FIXME: Alignment problems! */ + /* Segment table */ pSegment = (SEGTABLEENTRY *)pstr; @@ -985,6 +989,7 @@ static int BuildModule16( FILE *outfile, int max_code_offset, pstr += sizeof(ET_ENTRY); } *pstr++ = 0; +#endif /* Dump the module content */ @@ -1852,13 +1857,14 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) fprintf( outfile, "\tpushl %%ecx\n" ); fprintf( outfile, "\tpushl %%edx\n" ); -#ifdef USE__PIC__ - /* Get Global Offset Table into %ecx */ - fprintf( outfile, "\tcall .LCallFrom16%s.getgot\n", name ); - fprintf( outfile, ".LCallFrom16%s.getgot:\n", name ); - fprintf( outfile, "\tpopl %%ecx\n" ); - fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE+[.-.LCallFrom16%s.getgot], %%ecx\n" ); -#endif + if ( UsePIC ) + { + /* Get Global Offset Table into %ecx */ + fprintf( outfile, "\tcall .LCallFrom16%s.getgot1\n", name ); + fprintf( outfile, ".LCallFrom16%s.getgot1:\n", name ); + fprintf( outfile, "\tpopl %%ecx\n" ); + fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallFrom16%s.getgot1], %%ecx\n", name ); + } /* Load 32-bit segment registers */ fprintf( outfile, "\tmovw $0x%04x, %%dx\n", Data_Selector ); @@ -1870,19 +1876,20 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) fprintf( outfile, "\tdata16\n"); #endif fprintf( outfile, "\tmovw %%dx, %%es\n" ); -#ifdef USE__PIC__ - fprintf( outfile, "\tmovl " PREFIX "SYSLEVEL_Win16CurrentTeb@GOT(%%ecx), %%edx\n" ); - fprintf( outfile, "\tmovw (%%edx), %%fs\n" ); -#else - fprintf( outfile, "\tmovw " PREFIX "SYSLEVEL_Win16CurrentTeb, %%fs\n" ); -#endif + + if ( UsePIC ) + { + fprintf( outfile, "\tmovl " PREFIX "SYSLEVEL_Win16CurrentTeb@GOT(%%ecx), %%edx\n" ); + fprintf( outfile, "\tmovw (%%edx), %%fs\n" ); + } + else + fprintf( outfile, "\tmovw " PREFIX "SYSLEVEL_Win16CurrentTeb, %%fs\n" ); /* Get address of ldt_copy array into %ecx */ -#ifdef USE__PIC__ - fprintf( outfile, "\tmovl " PREFIX "ldt_copy@GOT(%%ecx), %%ecx\n" ); -#else - fprintf( outfile, "\tmovl $" PREFIX "ldt_copy, %%ecx\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tmovl " PREFIX "ldt_copy@GOT(%%ecx), %%ecx\n" ); + else + fprintf( outfile, "\tmovl $" PREFIX "ldt_copy, %%ecx\n" ); /* Translate STACK16FRAME base to flat offset in %edx */ fprintf( outfile, "\tmovw %%ss, %%dx\n" ); @@ -1956,7 +1963,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) /* Build register CONTEXT */ if ( reg_func ) { - fprintf( outfile, "\tsubl $%d, %%esp\n", sizeof(CONTEXT) ); + fprintf( outfile, "\tsubl $%d, %%esp\n", sizeof(CONTEXT86) ); fprintf( outfile, "\tpushfl\n" ); fprintf( outfile, "\tpopl %d(%%esp)\n", CONTEXTOFFSET(EFlags) ); @@ -2001,6 +2008,17 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) /* Print debug info before call */ if ( debugging ) { + if ( UsePIC ) + { + fprintf( outfile, "\tpushl %%ebx\n" ); + + /* Get Global Offset Table into %ebx (for PLT call) */ + fprintf( outfile, "\tcall .LCallFrom16%s.getgot2\n", name ); + fprintf( outfile, ".LCallFrom16%s.getgot2:\n", name ); + fprintf( outfile, "\tpopl %%ebx\n" ); + fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallFrom16%s.getgot2], %%ebx\n", name ); + } + fprintf( outfile, "\tpushl %%ecx\n" ); fprintf( outfile, "\tpushl %%edx\n" ); if ( reg_func ) @@ -2008,14 +2026,18 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) sizeof(CONTEXT) + STRUCTOFFSET(STACK32FRAME, ebp) ); else fprintf( outfile, "\tpushl $0\n" ); -#if USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16@PLT\n "); -#else - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16\n "); -#endif + + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16@PLT\n "); + else + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16\n "); + fprintf( outfile, "\tpopl %%edx\n" ); fprintf( outfile, "\tpopl %%edx\n" ); fprintf( outfile, "\tpopl %%ecx\n" ); + + if ( UsePIC ) + fprintf( outfile, "\tpopl %%ebx\n" ); } /* Call *Thunk* relay routine (which will call the API entry point) */ @@ -2024,19 +2046,34 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) /* Print debug info after call */ if ( debugging ) { + if ( UsePIC ) + { + fprintf( outfile, "\tpushl %%ebx\n" ); + + /* Get Global Offset Table into %ebx (for PLT call) */ + fprintf( outfile, "\tcall .LCallFrom16%s.getgot3\n", name ); + fprintf( outfile, ".LCallFrom16%s.getgot3:\n", name ); + fprintf( outfile, "\tpopl %%ebx\n" ); + fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallFrom16%s.getgot3], %%ebx\n", name ); + } + fprintf( outfile, "\tpushl %%eax\n" ); if ( reg_func ) fprintf( outfile, "\tleal -%d(%%ebp), %%eax\n\tpushl %%eax\n", sizeof(CONTEXT) + STRUCTOFFSET(STACK32FRAME, ebp) ); else fprintf( outfile, "\tpushl $0\n" ); -#if USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret@PLT\n "); -#else - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret\n "); -#endif + + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret@PLT\n "); + else + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret\n "); + fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpopl %%eax\n" ); + + if ( UsePIC ) + fprintf( outfile, "\tpopl %%ebx\n" ); } @@ -2083,6 +2120,9 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) fprintf( outfile, "\t.byte 0x64,0x66,0x0f,0xb2,0x25\n\t.long %d\n", STACKOFFSET ); fprintf( outfile, "\t.byte 0x64\n\tpopl (%d)\n", STACKOFFSET ); + /* Set flags according to return value */ + fprintf( outfile, "\torl %%eax, %%eax\n" ); + /* Restore registers and return to *ThunkRet* routine */ fprintf( outfile, "\tpopl %%edx\n" ); fprintf( outfile, "\tpopl %%ecx\n" ); @@ -2144,24 +2184,24 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) fprintf( outfile, "\tpushl %%esi\n" ); fprintf( outfile, "\tpushl %%edi\n" ); -#ifdef USE__PIC__ - /* Get Global Offset Table into %ebx */ - fprintf( outfile, "\tcall .LCallTo16%s.getgot\n", name ); - fprintf( outfile, ".LCallFrom16%s.getgot:\n", name ); - fprintf( outfile, "\tpopl %%ebx\n" ); - fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE+[.-.LCallFrom16%s.getgot], %%ebx\n" ); -#endif + if ( UsePIC ) + { + /* Get Global Offset Table into %ebx */ + fprintf( outfile, "\tcall .LCallTo16%s.getgot1\n", name ); + fprintf( outfile, ".LCallTo16%s.getgot1:\n", name ); + fprintf( outfile, "\tpopl %%ebx\n" ); + fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot1], %%ebx\n", name ); + } /* Move relay target address to %edi */ if ( !reg_func ) fprintf( outfile, "\tmovl %%eax, %%edi\n" ); /* Enter Win16 Mutex */ -#ifdef USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_EnterWin16Lock@PLT\n" ); -#else - fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_EnterWin16Lock\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_EnterWin16Lock@PLT\n" ); + else + fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_EnterWin16Lock\n" ); /* Print debugging info */ if (debugging) @@ -2176,21 +2216,20 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) fprintf( outfile, "\tleal 8(%%ebp),%%eax\n" ); fprintf( outfile, "\tpushl %%eax\n" ); -#ifdef USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16@PLT\n" ); -#else - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16@PLT\n" ); + else + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16\n" ); + fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpopl %%eax\n" ); } /* Get return address */ -#ifdef USE__PIC__ - fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr@GOTOFF(%%ebx), %%ecx\n" ); -#else - fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr, %%ecx\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr@GOTOFF(%%ebx), %%ecx\n" ); + else + fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr, %%ecx\n" ); /* Call the actual CallTo16 routine (simulate a lcall) */ fprintf( outfile, "\tpushl %%cs\n" ); @@ -2211,22 +2250,29 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) else fprintf( outfile, "\tpushl %%eax\n" ); + if ( UsePIC ) + { + /* Get Global Offset Table into %ebx (might have been overwritten) */ + fprintf( outfile, "\tcall .LCallTo16%s.getgot2\n", name ); + fprintf( outfile, ".LCallTo16%s.getgot2:\n", name ); + fprintf( outfile, "\tpopl %%ebx\n" ); + fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot2], %%ebx\n", name ); + } + /* Print debugging info */ if (debugging) { -#ifdef USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret@PLT\n" ); -#else - fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret@PLT\n" ); + else + fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret\n" ); } /* Leave Win16 Mutex */ -#ifdef USE__PIC__ - fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_LeaveWin16Lock@PLT\n" ); -#else - fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_LeaveWin16Lock\n" ); -#endif + if ( UsePIC ) + fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_LeaveWin16Lock@PLT\n" ); + else + fprintf( outfile, "\tcall " PREFIX "SYSLEVEL_LeaveWin16Lock\n" ); /* Get return value */ fprintf( outfile, "\tpopl %%eax\n" ); @@ -2791,7 +2837,7 @@ static void BuildCallFrom32Regs( FILE *outfile ) fprintf( outfile, "\tmovl %%eax,%d(%%ebp)\n", CONTEXTOFFSET(SegDs) - STACK_SPACE ); fprintf( outfile, "\tmovw %%ax,%%es\n" ); /* set %es equal to %ds just in case */ - fprintf( outfile, "\tmovl $0x%x,%%eax\n", CONTEXT_FULL ); + fprintf( outfile, "\tmovl $0x%x,%%eax\n", CONTEXT86_FULL ); fprintf( outfile, "\tmovl %%eax,%d(%%ebp)\n", CONTEXTOFFSET(ContextFlags) - STACK_SPACE ); fprintf( outfile, "\tmovl 8(%%ebp),%%eax\n" ); /* Get %eip at time of call */ @@ -2895,6 +2941,8 @@ static int BuildGlue( FILE *outfile, char * outname, int argc, char *argv[] ) fprintf( outfile, "/* File generated automatically. Do not edit! */\n\n" ); fprintf( outfile, "\t.text\n" ); +#ifdef __i386__ + #ifdef USE_STABS fprintf( outfile, "\t.file\t\"%s\"\n", outname ); getcwd(buffer, sizeof(buffer)); @@ -2951,6 +2999,13 @@ static int BuildGlue( FILE *outfile, char * outname, int argc, char *argv[] ) fprintf( outfile, ".Letext:\n"); #endif +#else /* __i386__ */ + + /* Just to avoid an empty file */ + fprintf( outfile, "\t.long 0\n" ); + +#endif /* __i386__ */ + fclose( infile ); return 0; } @@ -2971,6 +3026,8 @@ static int BuildCall16( FILE *outfile, char * outname ) fprintf( outfile, "/* File generated automatically. Do not edit! */\n\n" ); fprintf( outfile, "\t.text\n" ); +#ifdef __i386__ + #ifdef USE_STABS fprintf( outfile, "\t.file\t\"%s\"\n", outname ); getcwd(buffer, sizeof(buffer)); @@ -3043,6 +3100,22 @@ static int BuildCall16( FILE *outfile, char * outname ) fprintf( outfile, "\n\t.globl " PREFIX "Call16_Ret_End\n" ); fprintf( outfile, PREFIX "Call16_Ret_End:\n" ); +#else /* __i386__ */ + + fprintf( outfile, PREFIX"Call16_Start:\n" ); + fprintf( outfile, "\t.globl "PREFIX"Call16_Start\n" ); + fprintf( outfile, "\t.byte 0\n\n" ); + fprintf( outfile, PREFIX"Call16_End:\n" ); + fprintf( outfile, "\t.globl "PREFIX"Call16_End\n" ); + + fprintf( outfile, "\t.globl " PREFIX "Call16_Ret_Start\n" ); + fprintf( outfile, PREFIX "Call16_Ret_Start:\n" ); + fprintf( outfile, "\t.byte 0\n\n" ); + fprintf( outfile, "\n\t.globl " PREFIX "Call16_Ret_End\n" ); + fprintf( outfile, PREFIX "Call16_Ret_End:\n" ); + +#endif /* __i386__ */ + return 0; } @@ -3109,10 +3182,10 @@ static int BuildCall32( FILE *outfile, char * outname ) static void usage(void) { fprintf( stderr, - "usage: build [-o outfile] -spec SPECNAMES\n" - " build [-o outfile] -glue SOURCE_FILE\n" - " build [-o outfile] -call16\n" - " build [-o outfile] -call32\n" ); + "usage: build [-pic] [-o outfile] -spec SPECNAMES\n" + " build [-pic] [-o outfile] -glue SOURCE_FILE\n" + " build [-pic] [-o outfile] -call16\n" + " build [-pic] [-o outfile] -call32\n" ); exit(1); } @@ -3128,6 +3201,14 @@ int main(int argc, char **argv) if (argc < 2) usage(); + if (!strcmp( argv[1], "-pic" )) + { + UsePIC = 1; + argv += 1; + argc -= 1; + if (argc < 2) usage(); + } + if (!strcmp( argv[1], "-o" )) { outname = argv[2];