| 1 |
Description: libatomic linking |
| 2 |
When external library for atomic_ops is used, |
| 3 |
armel, armhf, hppa, and sh4 require functions in atomic_ops, |
| 4 |
because it uses non-inline function(s). |
| 5 |
Add substitution of ATOMIC_OPS_LIBS |
| 6 |
*** Not used now. Using the internal implementation is good *** |
| 7 |
Author: NIIBE Yutaka <[email protected]> |
| 8 |
Last-Update: 2018-10-05 |
| 9 |
|
| 10 |
Index: gauche/configure.ac |
| 11 |
=================================================================== |
| 12 |
--- gauche.orig/configure.ac |
| 13 |
+++ gauche/configure.ac |
| 14 |
@@ -304,10 +304,12 @@ AS_IF([test x"$with_libatomic_ops" = xno |
| 15 |
# even if we don't use libatomic_ops, since some of Gauche code still refers |
| 16 |
# to AO_t etc. |
| 17 |
need_atomic_ops_cflags=no |
| 18 |
+need_libatomic_link=none |
| 19 |
AC_MSG_CHECKING([which libatomic_ops to use]) |
| 20 |
AS_IF([test x"$with_libatomic_ops" != xno], |
| 21 |
[ AS_IF([test x"$GAUCHE_THREAD_TYPE" != xnone], |
| 22 |
- [ AC_MSG_RESULT([external]) ], |
| 23 |
+ [ AC_MSG_RESULT([external]) |
| 24 |
+ need_libatomic_link=external ], |
| 25 |
[ AC_MSG_RESULT([none]) ]) |
| 26 |
need_atomic_ops_cflags=yes ], |
| 27 |
[ AC_MSG_RESULT([internal]) |
| 28 |
@@ -315,10 +317,26 @@ AS_IF([test x"$with_libatomic_ops" != xn |
| 29 |
|
| 30 |
if test "$need_atomic_ops_cflags" = yes; then |
| 31 |
ATOMIC_OPS_CFLAGS='-I$(top_builddir)/gc/libatomic_ops/src -I$(top_srcdir)/gc/libatomic_ops/src' |
| 32 |
- ATOMIC_OPS_LIBS="" |
| 33 |
AC_SUBST([ATOMIC_OPS_CFLAGS]) |
| 34 |
fi |
| 35 |
|
| 36 |
+if test "$need_libatomic_link" = external; then |
| 37 |
+ case $host in |
| 38 |
+ armel-*|armhf-*|hppa-*|sh4-*) |
| 39 |
+ need_libatomic_link=yes |
| 40 |
+ ;; |
| 41 |
+ *) |
| 42 |
+ ;; |
| 43 |
+ esac |
| 44 |
+fi |
| 45 |
+ |
| 46 |
+if test "$need_libatomic_link" = yes; then |
| 47 |
+ ATOMIC_OPS_LIBS="-latomic_ops" |
| 48 |
+else |
| 49 |
+ ATOMIC_OPS_LIBS="" |
| 50 |
+fi |
| 51 |
+AC_SUBST([ATOMIC_OPS_LIBS]) |
| 52 |
+ |
| 53 |
AM_CONDITIONAL([USE_INTERNAL_LIBATOMIC_OPS], |
| 54 |
[test x$with_libatomic_ops = xno -a x"$GAUCHE_THREAD_TYPE" != xnone]) |
| 55 |
AM_CONDITIONAL([NEED_ATOMIC_OPS_ASM], |