Commit cbf94a7b authored by Alexandre Julliard's avatar Alexandre Julliard

configure: Add a __WINE_PE_BUILD define for files that are built as PE.

parent c53736d1
......@@ -630,7 +630,6 @@ LDAP_CFLAGS
RT_LIBS
TOOLSEXT
MSVCRTFLAGS
EXTRACFLAGS
VKD3D_SHADER_LIBS
VKD3D_SHADER_CFLAGS
VKD3D_LIBS
......@@ -751,6 +750,7 @@ TOP_INSTALL_DEV
TOP_INSTALL_LIB
UNIXLDFLAGS
UNIXDLLFLAGS
EXTRACFLAGS
LDEXECFLAGS
LDDLLFLAGS
DLLFLAGS
......@@ -7935,6 +7935,8 @@ LDDLLFLAGS=""
LDEXECFLAGS=""
EXTRACFLAGS=""
UNIXDLLFLAGS="-fPIC"
UNIXLDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname,\$(UNIXLIB)"
......@@ -8311,6 +8313,7 @@ else
fi
LIBEXT="dll"
EXTRACFLAGS="-D__WINE_PE_BUILD"
case $host_cpu in
*i[3456]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--disable-stdcall-fixup" >&5
$as_echo_n "checking whether the compiler supports -Wl,--disable-stdcall-fixup... " >&6; }
......@@ -9628,7 +9631,7 @@ test -n "$CROSSCC" || CROSSCC="false"
saved_LDFLAGS=$LDFLAGS
CROSSCFLAGS=${CROSSCFLAGS:-"-g -O2"}
EXTRACROSSCFLAGS="-DWINE_CROSS_PE -Wall"
EXTRACROSSCFLAGS="-D__WINE_PE_BUILD -Wall"
......@@ -16871,11 +16874,9 @@ fi
test "x$ac_cv_lib_soname_vkd3d" != "x" || enable_d3d12=${enable_d3d12:-no}
EXTRACFLAGS=""
if test "x${GCC}" = "xyes"
then
EXTRACFLAGS="-Wall -pipe"
EXTRACFLAGS="$EXTRACFLAGS -Wall -pipe"
saved_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5
......
......@@ -696,6 +696,7 @@ dnl **** Check for working dll ****
AC_SUBST(DLLFLAGS,"")
AC_SUBST(LDDLLFLAGS,"")
AC_SUBST(LDEXECFLAGS,"")
AC_SUBST(EXTRACFLAGS,"")
AC_SUBST(UNIXDLLFLAGS,"-fPIC")
AC_SUBST(UNIXLDFLAGS,["-shared -Wl,-Bsymbolic -Wl,-soname,\$(UNIXLIB)"])
AC_SUBST(TOP_INSTALL_LIB,"")
......@@ -715,6 +716,7 @@ case $host_os in
cygwin*|mingw32*)
AC_CHECK_TOOL(DLLTOOL,dlltool,false)
LIBEXT="dll"
EXTRACFLAGS="-D__WINE_PE_BUILD"
dnl Disable stdcall fixups to catch prototype mismatches
case $host_cpu in
*i[[3456]]86*) WINE_TRY_CFLAGS([-Wl,--disable-stdcall-fixup],
......@@ -953,7 +955,7 @@ then
saved_CFLAGS=$CFLAGS
saved_LDFLAGS=$LDFLAGS
AC_SUBST(CROSSCFLAGS,${CROSSCFLAGS:-"-g -O2"})
AC_SUBST(EXTRACROSSCFLAGS,"-DWINE_CROSS_PE -Wall")
AC_SUBST(EXTRACROSSCFLAGS,"-D__WINE_PE_BUILD -Wall")
AC_SUBST(CROSSLDFLAGS)
CC="$CROSSCC"
......@@ -1955,10 +1957,9 @@ test "x$ac_cv_lib_soname_vkd3d" != "x" || enable_d3d12=${enable_d3d12:-no}
dnl **** Check for gcc specific options ****
AC_SUBST(EXTRACFLAGS,"")
if test "x${GCC}" = "xyes"
then
EXTRACFLAGS="-Wall -pipe"
EXTRACFLAGS="$EXTRACFLAGS -Wall -pipe"
dnl Check for some compiler flags
dnl clang needs to be told to fail on unknown options
......@@ -2584,10 +2585,7 @@ esac
dnl **** Generate output files ****
AH_TOP([#ifndef __WINE_CONFIG_H
#define __WINE_CONFIG_H
#ifdef WINE_CROSS_PE
#error config.h should not be used when cross-compiling
#endif])
#define __WINE_CONFIG_H])
AH_BOTTOM([#endif /* __WINE_CONFIG_H */])
AC_CONFIG_COMMANDS([include/stamp-h], [echo timestamp > include/stamp-h])
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
#include <stdarg.h>
#include <stdio.h>
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
/* referenced by MSVC to pull crt support for floating points. we don't use it. */
int _fltused = 0;
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
#include <stdio.h>
#include <stdarg.h>
......@@ -249,4 +249,4 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
return p__wine_dbg_header( cls, channel, function );
}
#endif /* _WIN32 */
#endif /* __WINE_PE_BUILD */
......@@ -25,7 +25,7 @@
WINBASEAPI void *WINAPI DelayLoadFailureHook( LPCSTR name, LPCSTR function );
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
extern IMAGE_DOS_HEADER __ImageBase;
......@@ -39,7 +39,7 @@ FARPROC WINAPI __delayLoadHelper2( const IMAGE_DELAYLOAD_DESCRIPTOR *descr, IMAG
return ResolveDelayLoadedAPI( &__ImageBase, descr, NULL, DelayLoadFailureHook, addr, 0 );
}
#else /* _WIN32 */
#else /* __WINE_PE_BUILD */
struct ImgDelayDescr
{
......@@ -79,4 +79,4 @@ static void free_delay_imports(void)
}
#endif
#endif /* _WIN32 */
#endif /* __WINE_PE_BUILD */
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
#include <stdarg.h>
......@@ -65,4 +65,4 @@ NTSTATUS WINAPI __wine_unix_call( unixlib_handle_t handle, unsigned int code, vo
return p__wine_unix_call( handle, code, args );
}
#endif /* _WIN32 */
#endif /* __WINE_PE_BUILD */
......@@ -2,9 +2,6 @@
#ifndef __WINE_CONFIG_H
#define __WINE_CONFIG_H
#ifdef WINE_CROSS_PE
#error config.h should not be used when cross-compiling
#endif
/* Define to the file extension for executables. */
#undef EXEEXT
......
......@@ -21,13 +21,13 @@
#ifndef __WINE_WINE_ASM_H
#define __WINE_WINE_ASM_H
#if defined(__APPLE__) || (defined(_WIN32) && defined(__i386__))
#if defined(__APPLE__) || (defined(__WINE_PE_BUILD) && defined(__i386__))
# define __ASM_NAME(name) "_" name
#else
# define __ASM_NAME(name) name
#endif
#if defined(_WIN32) && defined(__i386__)
#if defined(__WINE_PE_BUILD) && defined(__i386__)
# define __ASM_STDCALL(name,args) "_" name "@" #args
# define __ASM_FASTCALL(name,args) "@" name "@" #args
#else
......@@ -55,7 +55,7 @@
# define __ASM_SEH(str)
#endif
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
# define __ASM_FUNC_TYPE(name) ".def " name "\n\t.scl 2\n\t.type 32\n\t.endef"
#elif defined(__APPLE__)
# define __ASM_FUNC_TYPE(name) ""
......@@ -67,7 +67,7 @@
# define __ASM_FUNC_TYPE(name) ".type " name ",@function"
#endif
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
# define __ASM_FUNC_SIZE(name) ""
#elif defined(__APPLE__)
# define __ASM_FUNC_SIZE(name) ""
......@@ -107,7 +107,7 @@
__ASM_BLOCK_END
#endif
#ifdef _WIN32
#ifdef __WINE_PE_BUILD
#define __ASM_GLOBAL_IMPORT(name) __ASM_DEFINE_IMPORT(__ASM_NAME(#name))
#define __ASM_STDCALL_IMPORT(name,args) __ASM_DEFINE_IMPORT(__ASM_STDCALL(#name,args))
#else
......@@ -117,7 +117,7 @@
/* fastcall support */
#if defined(__i386__) && !defined(_WIN32)
#if defined(__i386__) && !defined(__WINE_PE_BUILD)
# define __ASM_USE_FASTCALL_WRAPPER
# define DEFINE_FASTCALL1_WRAPPER(func) \
......@@ -176,7 +176,7 @@
#endif /* __i386__ */
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(__WINE_PE_BUILD) && !defined(__APPLE__) && !defined(__ANDROID__)
#define __ASM_OBSOLETE(func) __asm__( ".symver " #func "_obsolete," #func "@WINE_1.0" )
#else
#undef __ASM_OBSOLETE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment