Skip to content

Commit

Permalink
* configure.ac: Choose link format based on host_os on emu.
Browse files Browse the repository at this point in the history
  • Loading branch information
phcoder committed Dec 21, 2013
1 parent 0b602bf commit bf08219
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-12-21 Vladimir Serbinenko <[email protected]>

* configure.ac: Choose link format based on host_os on emu.

2013-12-21 Vladimir Serbinenko <[email protected]>

* grub-core/osdep/unix/getroot.c: Non-unix build fix.
Expand Down
27 changes: 24 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,35 @@ AC_SUBST([EFIEMU64_LINK_FORMAT])

CFLAGS="$TARGET_CFLAGS"

if test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then

if test x"$platform" = xemu ; then
TARGET_OBJ2ELF=
grub_cv_target_cc_link_format=
case "$host_os" in
*darwin* | *mac*)
grub_cv_target_cc_link_format="-arch,${target_cpu}"
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
;;
*windows* | *cygwin* | *mingw*)
if test x${target_cpu} = xi386 ; then
grub_cv_target_cc_link_format=-mi386pe;
TARGET_OBJ2ELF='./build-grub-pe2elf';
fi
if test x${target_cpu} = xx86_64 ; then
grub_cv_target_cc_link_format=-mi386pep;
TARGET_OBJ2ELF='./build-grub-pep2elf';
fi
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
;;
esac
elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [
grub_cv_target_cc_link_format=unknown
for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -mi386pe -mi386pep -arch,${target_cpu}; do
if test x${target_cpu} != xi386 && test x$format = xi386pe; then
if test x${target_cpu} != xi386 && test x$format = x-mi386pe; then
continue
fi
if test x${target_cpu} != xx86_64 && test x$format = xi386pep; then
if test x${target_cpu} != xx86_64 && test x$format = x-mi386pep; then
continue
fi
CFLAGS="$TARGET_CFLAGS"
Expand Down

0 comments on commit bf08219

Please sign in to comment.