Resubmitting, with changes recommended by Alexandre. ChangeLog: configure configure.ac include/wine/port.h - __sparc__ and __sun__ are not defined with Forte C, so a configure test was added - Forte C doesn't like @function. Added a configure test for it, and replaced it with 2 when it is not available >To: Gregg Mattinson <gm138242@opcom-mail.canada.sun.com> >Cc: wine-devel@winehq.com >Subject: Re: __sparc__ not defined with Forte C >From: Alexandre Julliard <julliard@winehq.com> >Date: 15 Jul 2002 18:49:04 -0700 >User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) >MIME-Version: 1.0 > >Gregg Mattinson <gm138242@scot.canada.sun.com> writes: > >> ChangeLog: dlls/ntdll/signal_sparc.c include/basetsd.h >> include/wine/port.h server/context_sparc.c >> - __sparc__ is not defined with Forte C, but __sparc is defined with both Forte >> and GCC. Same goes for __sun__ > >If __sparc and __sun work for all compilers we should use them >everywhere, no need to try to support other forms. Otherwise it should >be done with a configure test like we do for __i386__. > >> - Forte C doesn't like @function. Replaced it with 2. > >This needs a configure test. A #ifdef SUNPRO_C is almost always the >wrong thing to do. > >-- >Alexandre Julliard >julliard@winehq.com Gregg Mattinson Co-op Developer Sun Microsystems of Canada
Index: configure =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/configure,v retrieving revision 1.2 diff -u -r1.2 configure --- /tmp/T0CRaWLe Wed Jul 17 07:44:59 2002 +++ configure Tue Jul 16 09:13:30 2002 @@ -9523,6 +9523,29 @@ fi +echo "$as_me:$LINENO: checking whether @function is defined" >&5 +echo $ECHO_N "checking whether @function is defined... $ECHO_C" >&6 +if test "${ac_cv_at_function_is_defined+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_try_asm_link_saved_libs=$LIBS +LIBS="conftest_asm.s $LIBS" +cat > conftest_asm.s <<EOF + .globl _ac_test + .type _ac_test +fi +echo "$as_me:$LINENO: result: $ac_cv_at_function_is_defined" >&5 +echo "${ECHO_T}$ac_cv_at_function_is_defined" >&6 +if test "$ac_cv_at_function_is_defined" = "yes" +then + +cat >>confdefs.h <<\_ACEOF +#define AT_FUNCTION_IS_DEFINED 1 +_ACEOF + +fi + + echo "$as_me:$LINENO: checking whether external symbols need an underscore prefix" >&5 echo $ECHO_N "checking whether external symbols need an underscore prefix... $ECHO_C" >&6 if test "${ac_cv_c_extern_prefix+set}" = set; then @@ -13214,6 +13237,74 @@ then CFLAGS="$CFLAGS -D__i386__" LINTFLAGS="$LINTFLAGS -D__i386__" +fi + + +case $host_cpu in + *sparc* ) + echo "$as_me:$LINENO: checking whether we need to define __sparc__" >&5 +echo $ECHO_N "checking whether we need to define __sparc__... $ECHO_C" >&6 +if test "${ac_cv_cpp_def_sparc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#ifndef __sparc__ +yes +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + ac_cv_cpp_def_sparc="yes" +else + ac_cv_cpp_def_sparc="no" +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_cpp_def_sparc" >&5 +echo "${ECHO_T}$ac_cv_cpp_def_sparc" >&6 + ;; +esac +if test "$ac_cv_cpp_def_sparc" = "yes" +then + CFLAGS="$CFLAGS -D__sparc__" + LINTFLAGS="$LINTFLAGS -D__sparc__" +fi + + +case $host_vendor in + *sun* ) + echo "$as_me:$LINENO: checking whether we need to define __sun__" >&5 +echo $ECHO_N "checking whether we need to define __sun__... $ECHO_C" >&6 +if test "${ac_cv_cpp_def_sun+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#ifndef __sun__ +yes +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + ac_cv_cpp_def_sun="yes" +else + ac_cv_cpp_def_sun="no" +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_cpp_def_sun" >&5 +echo "${ECHO_T}$ac_cv_cpp_def_sun" >&6 + ;; +esac +if test "$ac_cv_cpp_def_sun" = "yes" +then + CFLAGS="$CFLAGS -D__sun__" + LINTFLAGS="$LINTFLAGS -D__sun__" fi Index: configure.ac =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/configure.ac,v retrieving revision 1.2 diff -u -r1.2 configure.ac --- /tmp/T0x8aiMe Wed Jul 17 07:45:00 2002 +++ configure.ac Tue Jul 16 09:12:13 2002 @@ -650,6 +650,20 @@ AC_DEFINE(NEED_TYPE_IN_DEF, 1, [Define if .type asm directive must be inside a .def directive]) fi +dnl **** Check if @function is defined **** + +AC_CACHE_CHECK([whether @function is defined], ac_cv_at_function_is_defined, + WINE_TRY_ASM_LINK( +[ .globl _ac_test + .type _ac_test, @function +_ac_test: + .long 0],,, + ac_cv_at_function_is_defined="yes",ac_cv_at_function_is_defined="no")) +if test "$ac_cv_at_function_is_defined" = "yes" +then + AC_DEFINE(AT_FUNCTION_IS_DEFINED, 1, [Define if @function is defined]) +fi + dnl **** Check for underscore on external symbols **** AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix, @@ -1185,6 +1199,40 @@ then CFLAGS="$CFLAGS -D__i386__" LINTFLAGS="$LINTFLAGS -D__i386__" +fi + +dnl *** check for the need to define __sparc__ + +case $host_cpu in + *sparc* ) + AC_CACHE_CHECK([whether we need to define __sparc__],ac_cv_cpp_def_sparc, + AC_EGREP_CPP(yes,[#ifndef __sparc__ +yes +#endif], + ac_cv_cpp_def_sparc="yes", ac_cv_cpp_def_sparc="no")) + ;; +esac +if test "$ac_cv_cpp_def_sparc" = "yes" +then + CFLAGS="$CFLAGS -D__sparc__" + LINTFLAGS="$LINTFLAGS -D__sparc__" +fi + +dnl *** check for the need to define __sun__ + +case $host_vendor in + *sun* ) + AC_CACHE_CHECK([whether we need to define __sun__],ac_cv_cpp_def_sun, + AC_EGREP_CPP(yes,[#ifndef __sun__ +yes +#endif], + ac_cv_cpp_def_sun="yes", ac_cv_cpp_def_sun="no")) + ;; +esac +if test "$ac_cv_cpp_def_sun" = "yes" +then + CFLAGS="$CFLAGS -D__sun__" + LINTFLAGS="$LINTFLAGS -D__sun__" fi dnl **** Generate output files **** Index: include/wine/port.h =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/include/wine/port.h,v retrieving revision 1.2 diff -u -r1.2 port.h --- /tmp/T0lFaaXe Wed Jul 17 07:46:24 2002 +++ port.h Tue Jul 16 08:56:12 2002 @@ -141,7 +141,11 @@ #ifdef NEED_TYPE_IN_DEF # define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef" #else +#ifdef AT_FUNCTION_IS_DEFINED # define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function" +#else +# define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",2" +#endif #endif #ifdef __GNUC__