Added WINE_CHECK_DEFINE macro to factor out some repeated code.

This commit is contained in:
Alexandre Julliard 2002-12-11 00:21:55 +00:00
parent 4d6ba25d4b
commit 05783b55e0
3 changed files with 63 additions and 120 deletions

16
aclocal.m4 vendored
View File

@ -94,6 +94,22 @@ CFLAGS="$CFLAGS $1"
AC_TRY_LINK([],[],[$2],[$3]) AC_TRY_LINK([],[],[$2],[$3])
CFLAGS=$ac_wine_try_cflags_saved]) CFLAGS=$ac_wine_try_cflags_saved])
dnl **** Check whether we need to define a symbol on the compiler command line ****
dnl
dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
dnl
AC_DEFUN([WINE_CHECK_DEFINE],
[AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
AC_CACHE_CHECK([whether we need to define $1],ac_var,
AC_EGREP_CPP(yes,[#ifndef $1
yes
#endif],
[AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
AS_IF([test AS_VAR_GET(ac_var) = yes],
[CFLAGS="$CFLAGS -D$1"
LINTFLAGS="$LINTFLAGS -D$1"])dnl
AS_VAR_POPDEF([ac_var])])
dnl **** Check for ln **** dnl **** Check for ln ****
dnl dnl
dnl Usage: WINE_PROG_LN dnl Usage: WINE_PROG_LN

101
configure vendored
View File

@ -13616,10 +13616,9 @@ fi
case $host_cpu in case $host_cpu in
*i345678986* ) *i[3456789]86*) echo "$as_me:$LINENO: checking whether we need to define __i386__" >&5
echo "$as_me:$LINENO: checking whether we need to define __i386__" >&5
echo $ECHO_N "checking whether we need to define __i386__... $ECHO_C" >&6 echo $ECHO_N "checking whether we need to define __i386__... $ECHO_C" >&6
if test "${ac_cv_cpp_def_i386+set}" = set; then if test "${ac_cv_cpp_def___i386__+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -13631,29 +13630,23 @@ yes
_ACEOF _ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ac_cv_cpp_def_i386="yes" ac_cv_cpp_def___i386__=yes
else else
ac_cv_cpp_def_i386="no" ac_cv_cpp_def___i386__=no
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $ac_cv_cpp_def_i386" >&5 echo "$as_me:$LINENO: result: $ac_cv_cpp_def___i386__" >&5
echo "${ECHO_T}$ac_cv_cpp_def_i386" >&6 echo "${ECHO_T}$ac_cv_cpp_def___i386__" >&6
;; if test $ac_cv_cpp_def___i386__ = yes; then
esac CFLAGS="$CFLAGS -D__i386__"
if test "$ac_cv_cpp_def_i386" = "yes" LINTFLAGS="$LINTFLAGS -D__i386__"
then
CFLAGS="$CFLAGS -D__i386__"
LINTFLAGS="$LINTFLAGS -D__i386__"
fi fi
;;
*alpha*) echo "$as_me:$LINENO: checking whether we need to define __ALPHA__" >&5
case $host_cpu in
*alpha* )
echo "$as_me:$LINENO: checking whether we need to define __ALPHA__" >&5
echo $ECHO_N "checking whether we need to define __ALPHA__... $ECHO_C" >&6 echo $ECHO_N "checking whether we need to define __ALPHA__... $ECHO_C" >&6
if test "${ac_cv_cpp_def_alpha+set}" = set; then if test "${ac_cv_cpp_def___ALPHA__+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -13665,29 +13658,23 @@ yes
_ACEOF _ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ac_cv_cpp_def_alpha="yes" ac_cv_cpp_def___ALPHA__=yes
else else
ac_cv_cpp_def_alpha="no" ac_cv_cpp_def___ALPHA__=no
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $ac_cv_cpp_def_alpha" >&5 echo "$as_me:$LINENO: result: $ac_cv_cpp_def___ALPHA__" >&5
echo "${ECHO_T}$ac_cv_cpp_def_alpha" >&6 echo "${ECHO_T}$ac_cv_cpp_def___ALPHA__" >&6
;; if test $ac_cv_cpp_def___ALPHA__ = yes; then
esac CFLAGS="$CFLAGS -D__ALPHA__"
if test "$ac_cv_cpp_def_alpha" = "yes" LINTFLAGS="$LINTFLAGS -D__ALPHA__"
then
CFLAGS="$CFLAGS -D__ALPHA__"
LINTFLAGS="$LINTFLAGS -D__ALPHA__"
fi fi
;;
*sparc*) echo "$as_me:$LINENO: checking whether we need to define __sparc__" >&5
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 echo $ECHO_N "checking whether we need to define __sparc__... $ECHO_C" >&6
if test "${ac_cv_cpp_def_sparc+set}" = set; then if test "${ac_cv_cpp_def___sparc__+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -13699,29 +13686,26 @@ yes
_ACEOF _ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ac_cv_cpp_def_sparc="yes" ac_cv_cpp_def___sparc__=yes
else else
ac_cv_cpp_def_sparc="no" ac_cv_cpp_def___sparc__=no
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $ac_cv_cpp_def_sparc" >&5 echo "$as_me:$LINENO: result: $ac_cv_cpp_def___sparc__" >&5
echo "${ECHO_T}$ac_cv_cpp_def_sparc" >&6 echo "${ECHO_T}$ac_cv_cpp_def___sparc__" >&6
;; if test $ac_cv_cpp_def___sparc__ = yes; then
esac CFLAGS="$CFLAGS -D__sparc__"
if test "$ac_cv_cpp_def_sparc" = "yes" LINTFLAGS="$LINTFLAGS -D__sparc__"
then
CFLAGS="$CFLAGS -D__sparc__"
LINTFLAGS="$LINTFLAGS -D__sparc__"
fi fi
;;
esac
case $host_vendor in case $host_vendor in
*sun* ) *sun*) echo "$as_me:$LINENO: checking whether we need to define __sun__" >&5
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 echo $ECHO_N "checking whether we need to define __sun__... $ECHO_C" >&6
if test "${ac_cv_cpp_def_sun+set}" = set; then if test "${ac_cv_cpp_def___sun__+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -13733,22 +13717,21 @@ yes
_ACEOF _ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ac_cv_cpp_def_sun="yes" ac_cv_cpp_def___sun__=yes
else else
ac_cv_cpp_def_sun="no" ac_cv_cpp_def___sun__=no
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$as_me:$LINENO: result: $ac_cv_cpp_def_sun" >&5 echo "$as_me:$LINENO: result: $ac_cv_cpp_def___sun__" >&5
echo "${ECHO_T}$ac_cv_cpp_def_sun" >&6 echo "${ECHO_T}$ac_cv_cpp_def___sun__" >&6
;; if test $ac_cv_cpp_def___sun__ = yes; then
esac CFLAGS="$CFLAGS -D__sun__"
if test "$ac_cv_cpp_def_sun" = "yes" LINTFLAGS="$LINTFLAGS -D__sun__"
then
CFLAGS="$CFLAGS -D__sun__"
LINTFLAGS="$LINTFLAGS -D__sun__"
fi fi
;;
esac

View File

@ -1292,73 +1292,17 @@ WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
#endif], #endif],
[AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])]) [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
dnl *** check for the need to define __i386__ dnl *** check for the need to define platform-specific symbols
case $host_cpu in case $host_cpu in
*i[3456789]86* ) *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
AC_CACHE_CHECK([whether we need to define __i386__],ac_cv_cpp_def_i386, *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;;
AC_EGREP_CPP(yes,[#ifndef __i386__ *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;;
yes
#endif],
ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
;;
esac esac
if test "$ac_cv_cpp_def_i386" = "yes"
then
CFLAGS="$CFLAGS -D__i386__"
LINTFLAGS="$LINTFLAGS -D__i386__"
fi
dnl *** check for the need to define __ALPHA__
case $host_cpu in
*alpha* )
AC_CACHE_CHECK([whether we need to define __ALPHA__],ac_cv_cpp_def_alpha,
AC_EGREP_CPP(yes,[#ifndef __ALPHA__
yes
#endif],
ac_cv_cpp_def_alpha="yes", ac_cv_cpp_def_alpha="no"))
;;
esac
if test "$ac_cv_cpp_def_alpha" = "yes"
then
CFLAGS="$CFLAGS -D__ALPHA__"
LINTFLAGS="$LINTFLAGS -D__ALPHA__"
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 case $host_vendor in
*sun* ) *sun*) WINE_CHECK_DEFINE([__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 esac
if test "$ac_cv_cpp_def_sun" = "yes"
then
CFLAGS="$CFLAGS -D__sun__"
LINTFLAGS="$LINTFLAGS -D__sun__"
fi
dnl **** Generate output files **** dnl **** Generate output files ****