Commit 13ca3c88 authored by Nicholas Fraser's avatar Nicholas Fraser Committed by Alexandre Julliard

configure: Add --enable-build-id option.

Build-ids are required for doing certain kinds of performance tracing. For example build-ids let Linux perf find the correct objects and transfer them to other machines via "perf archive". Signed-off-by: 's avatarNicholas Fraser <nfraser@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3898ad40
...@@ -842,6 +842,7 @@ enable_option_checking ...@@ -842,6 +842,7 @@ enable_option_checking
enable_win16 enable_win16
enable_win64 enable_win64
enable_tests enable_tests
enable_build_id
enable_maintainer_mode enable_maintainer_mode
enable_silent_rules enable_silent_rules
enable_werror enable_werror
...@@ -2580,6 +2581,7 @@ Optional Features: ...@@ -2580,6 +2581,7 @@ Optional Features:
--enable-win64 build a Win64 emulator on AMD64 (won't run Win32 --enable-win64 build a Win64 emulator on AMD64 (won't run Win32
binaries) binaries)
--disable-tests do not build the regression tests --disable-tests do not build the regression tests
--enable-build-id include .buildid section in output objects
--enable-maintainer-mode --enable-maintainer-mode
enable maintainer-specific build rules enable maintainer-specific build rules
--enable-silent-rules use silent build rules (override: "make V=1") --enable-silent-rules use silent build rules (override: "make V=1")
...@@ -3910,6 +3912,11 @@ if test "${enable_tests+set}" = set; then : ...@@ -3910,6 +3912,11 @@ if test "${enable_tests+set}" = set; then :
enableval=$enable_tests; enableval=$enable_tests;
fi fi
# Check whether --enable-build-id was given.
if test "${enable_build_id+set}" = set; then :
enableval=$enable_build_id;
fi
# Check whether --enable-maintainer-mode was given. # Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then : if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; enableval=$enable_maintainer_mode;
...@@ -10677,6 +10684,41 @@ if test "x$ac_cv_crosscflags__Werror" = xyes; then : ...@@ -10677,6 +10684,41 @@ if test "x$ac_cv_crosscflags__Werror" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Werror" EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Werror"
fi fi
fi fi
if test "x$enable_build_id" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wl,--build-id" >&5
$as_echo_n "checking whether the cross-compiler supports -Wl,--build-id... " >&6; }
if ${ac_cv_crosscflags__Wl___build_id+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -Wl,--build-id"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int __cdecl mainCRTStartup(void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_crosscflags__Wl___build_id=yes
else
ac_cv_crosscflags__Wl___build_id=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__Wl___build_id" >&5
$as_echo "$ac_cv_crosscflags__Wl___build_id" >&6; }
if test "x$ac_cv_crosscflags__Wl___build_id" = xyes; then :
CROSSCFLAGS="$CROSSCFLAGS -Wl,--build-id"
CROSSLDFLAGS="$CROSSLDFLAGS -Wl,--build-id"
fi
fi
CFLAGS=$saved_CFLAGS CFLAGS=$saved_CFLAGS
CC="$ac_save_CC" CC="$ac_save_CC"
...@@ -17797,6 +17839,35 @@ if test "x$ac_cv_cflags__Werror" = xyes; then : ...@@ -17797,6 +17839,35 @@ if test "x$ac_cv_cflags__Werror" = xyes; then :
EXTRACFLAGS="$EXTRACFLAGS -Werror" EXTRACFLAGS="$EXTRACFLAGS -Werror"
fi fi
fi fi
if test "x$enable_build_id" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--build-id" >&5
$as_echo_n "checking whether the compiler supports -Wl,--build-id... " >&6; }
if ${ac_cv_cflags__Wl___build_id+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Wl,--build-id"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wl___build_id=yes
else
ac_cv_cflags__Wl___build_id=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___build_id" >&5
$as_echo "$ac_cv_cflags__Wl___build_id" >&6; }
if test "x$ac_cv_cflags__Wl___build_id" = xyes; then :
CFLAGS="$CFLAGS -Wl,--build-id"
LDFLAGS="$LDFLAGS -Wl,--build-id"
fi
fi
fi fi
......
...@@ -31,6 +31,7 @@ dnl **** Command-line arguments **** ...@@ -31,6 +31,7 @@ dnl **** Command-line arguments ****
AC_ARG_ENABLE(win16, AS_HELP_STRING([--disable-win16],[do not include Win16 support])) AC_ARG_ENABLE(win16, AS_HELP_STRING([--disable-win16],[do not include Win16 support]))
AC_ARG_ENABLE(win64, AS_HELP_STRING([--enable-win64],[build a Win64 emulator on AMD64 (won't run Win32 binaries)])) AC_ARG_ENABLE(win64, AS_HELP_STRING([--enable-win64],[build a Win64 emulator on AMD64 (won't run Win32 binaries)]))
AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[do not build the regression tests])) AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[do not build the regression tests]))
AC_ARG_ENABLE(build-id, AS_HELP_STRING([--enable-build-id],[include .buildid section in output objects]))
AC_ARG_ENABLE(maintainer-mode, AS_HELP_STRING([--enable-maintainer-mode],[enable maintainer-specific build rules])) AC_ARG_ENABLE(maintainer-mode, AS_HELP_STRING([--enable-maintainer-mode],[enable maintainer-specific build rules]))
AC_ARG_ENABLE(silent-rules, AS_HELP_STRING([--enable-silent-rules],[use silent build rules (override: "make V=1")])) AC_ARG_ENABLE(silent-rules, AS_HELP_STRING([--enable-silent-rules],[use silent build rules (override: "make V=1")]))
AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[treat compilation warnings as errors])) AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[treat compilation warnings as errors]))
...@@ -1086,6 +1087,11 @@ then ...@@ -1086,6 +1087,11 @@ then
then then
WINE_TRY_CROSSCFLAGS([-Werror]) WINE_TRY_CROSSCFLAGS([-Werror])
fi fi
if test "x$enable_build_id" = "xyes"
then
WINE_TRY_CROSSCFLAGS([-Wl,--build-id], [CROSSCFLAGS="$CROSSCFLAGS -Wl,--build-id"
CROSSLDFLAGS="$CROSSLDFLAGS -Wl,--build-id"])
fi
CFLAGS=$saved_CFLAGS CFLAGS=$saved_CFLAGS
CC="$ac_save_CC" CC="$ac_save_CC"
...@@ -2111,6 +2117,11 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy= ...@@ -2111,6 +2117,11 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
then then
WINE_TRY_CFLAGS([-Werror]) WINE_TRY_CFLAGS([-Werror])
fi fi
if test "x$enable_build_id" = "xyes"
then
WINE_TRY_CFLAGS([-Wl,--build-id], [CFLAGS="$CFLAGS -Wl,--build-id"
LDFLAGS="$LDFLAGS -Wl,--build-id"])
fi
fi fi
dnl **** Disable Fortify, it has too many false positives dnl **** Disable Fortify, it has too many false positives
......
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