From 5d7f4e020970ec1aaaa1efa92463f3c0077e6bfa Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Mon, 2 Jul 2012 11:54:10 +0900
Subject: [PATCH] OS/2: Use i486 architecture by default

This fixes the following linker error.

-----
  GEN    stamp-revision
make  all-recursive
make[1]: Entering directory `F:/lang/work/vlc/vlc.git/src'
Making all in .
make[2]: Entering directory `F:/lang/work/vlc/vlc.git/src'
  CCLD   libvlccore.la
weakld: error: Unresolved symbol (UNDEF) '___sync_fetch_and_sub_4'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_item_o_9c814ff0f7481eb988.obj
    P:\tmp\ldconv_resource_o_9c814ff0f749143df0.obj
    P:\tmp\ldconv_picture_o_9c814ff0f74a1591c8.obj
weakld: error: Unresolved symbol (UNDEF) '___sync_val_compare_and_swap_4'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_dec_o_9c814ff0f7491ce0e0.obj
weakld: error: Unresolved symbol (UNDEF) '___sync_fetch_and_add_4'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_item_o_9c814ff0f7481eb988.obj
weakld: error: Unresolved symbol (UNDEF) '___sync_bool_compare_and_swap_4'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_dec_o_9c814ff0f7491ce0e0.obj
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: ___sync_fetch_and_add_4 is an undefined reference
Error! E2028: ___sync_fetch_and_sub_4 is an undefined reference
Error! E2028: ___sync_bool_compare_and_swap_4 is an undefined reference
Error! E2028: ___sync_val_compare_and_swap_4 is an undefined reference
file P:/tmp\ldconv_item_o_9c814ff0f7481eb988.obj(input\item.c): undefined symbol ___sync_fetch_and_add_4
file P:/tmp\ldconv_item_o_9c814ff0f7481eb988.obj(input\item.c): undefined symbol ___sync_fetch_and_sub_4
file P:/tmp\ldconv_resource_o_9c814ff0f749143df0.obj(input\resource.c): undefined symbol ___sync_fetch_and_sub_4
file P:/tmp\ldconv_dec_o_9c814ff0f7491ce0e0.obj(audio_output\dec.c): undefined symbol ___sync_bool_compare_and_swap_4
file P:/tmp\ldconv_dec_o_9c814ff0f7491ce0e0.obj(audio_output\dec.c): undefined symbol ___sync_val_compare_and_swap_4
file P:/tmp\ldconv_picture_o_9c814ff0f74a1591c8.obj(misc\picture.c): undefined symbol ___sync_fetch_and_sub_4
make[2]: *** [libvlccore.la] Error 1
make[2]: Leaving directory `F:/lang/work/vlc/vlc.git/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `F:/lang/work/vlc/vlc.git/src'
make.exe: *** [all] Error 2
-----
---
 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3fecbaf..f713a1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,6 +267,9 @@ case "${host_os}" in
     ;;
   *os2*)
     SYS=os2
+    test -z "${ARCHFLAGS}" && ARCHFLAGS="-march=i486"
+    CFLAGS="${CFLAGS} ${ARCHFLAGS}"
+    CXXFLAGS="${CXXFLAGS} ${ARCHFLAGS}"
     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild"
     ;;
   *)
-- 
1.7.3.2

