[gcc/devel/coarray_native] Add correct link flags to libgfortran.spec.in.

Thomas König tkoenig@gcc.gnu.org
Fri Sep 24 17:04:25 GMT 2021


https://gcc.gnu.org/g:d2bcab37e126261299cc91fb0df53e34663da64b

commit d2bcab37e126261299cc91fb0df53e34663da64b
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Fri Sep 24 17:45:44 2021 +0200

    Add correct link flags to libgfortran.spec.in.
    
    Removed extraneous HUHU.

Diff:
---
 libgfortran/Makefile.am         |   4 +-
 libgfortran/Makefile.in         | 110 +++++++++++++++++++++-------------------
 libgfortran/aclocal.m4          |  37 ++++++++++++++
 libgfortran/configure           |  13 ++++-
 libgfortran/configure.ac        |   3 ++
 libgfortran/libgfortran.spec.in |   2 +-
 6 files changed, 111 insertions(+), 58 deletions(-)

diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 467be559a3d..bebe958b710 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -78,8 +78,8 @@ i_cas_collsub_s_c = \
 
 if LIBGFOR_NATIVE_COARRAY
 
-mylib_LTLIBRARIES = libcaf_shared.la
-mylibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+caf_shared_LTLIBRARIES = libcaf_shared.la
+caf_shareddir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
 libcaf_shared_la_SOURCES = caf_shared/alloc.c caf_shared/allocator.c caf_shared/coarraynative.c \
 	caf_shared/hashmap.c  \
 	caf_shared/sync.c caf_shared/util.c caf_shared/wrapper.c caf_shared/collective_subroutine.c \
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 0fcf12a34a0..495cb9c4a6a 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -215,10 +215,11 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(cafexeclibdir)" "$(DESTDIR)$(mylibdir)" \
-	"$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \
-	"$(DESTDIR)$(gfor_cdir)" "$(DESTDIR)$(fincludedir)"
-LTLIBRARIES = $(cafexeclib_LTLIBRARIES) $(mylib_LTLIBRARIES) \
+am__installdirs = "$(DESTDIR)$(caf_shareddir)" \
+	"$(DESTDIR)$(cafexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" \
+	"$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(gfor_cdir)" \
+	"$(DESTDIR)$(fincludedir)"
+LTLIBRARIES = $(caf_shared_LTLIBRARIES) $(cafexeclib_LTLIBRARIES) \
 	$(toolexeclib_LTLIBRARIES)
 libcaf_shared_la_LIBADD =
 am__objects_1 = cas_collsub_i1.lo cas_collsub_i2.lo cas_collsub_i4.lo \
@@ -235,7 +236,7 @@ am__objects_2 = cas_collsub_s1.lo cas_collsub_s4.lo
 @LIBGFOR_NATIVE_COARRAY_TRUE@	$(am__objects_1) $(am__objects_2)
 libcaf_shared_la_OBJECTS = $(am_libcaf_shared_la_OBJECTS)
 @LIBGFOR_NATIVE_COARRAY_TRUE@am_libcaf_shared_la_rpath = -rpath \
-@LIBGFOR_NATIVE_COARRAY_TRUE@	$(mylibdir)
+@LIBGFOR_NATIVE_COARRAY_TRUE@	$(caf_shareddir)
 libcaf_single_la_LIBADD =
 am_libcaf_single_la_OBJECTS = single.lo
 libcaf_single_la_OBJECTS = $(am_libcaf_single_la_OBJECTS)
@@ -600,6 +601,9 @@ AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+@LIBGFOR_NATIVE_COARRAY_FALSE@COARRAY_LIBS = ""
+@LIBGFOR_NATIVE_COARRAY_TRUE@COARRAY_LIBS = $(PTHREAD_LIBS) $(RT_LIBS)
+COARRAY_LIBS = @COARRAY_LIBS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -751,8 +755,6 @@ gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
 	    $(lt_host_flags)
 
-@LIBGFOR_NATIVE_COARRAY_FALSE@COARRAY_LIBS = ""
-@LIBGFOR_NATIVE_COARRAY_TRUE@COARRAY_LIBS = $(PTHREAD_LIBS) $(RT_LIBS)
 toolexeclib_LTLIBRARIES = libgfortran.la
 toolexeclib_DATA = libgfortran.spec
 libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
@@ -785,8 +787,8 @@ i_cas_collsub_s_c = \
 	$(srcdir)/generated/cas_collsub_s1.c \
 	$(srcdir)/generated/cas_collsub_s4.c
 
-@LIBGFOR_NATIVE_COARRAY_TRUE@mylib_LTLIBRARIES = libcaf_shared.la
-@LIBGFOR_NATIVE_COARRAY_TRUE@mylibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+@LIBGFOR_NATIVE_COARRAY_TRUE@caf_shared_LTLIBRARIES = libcaf_shared.la
+@LIBGFOR_NATIVE_COARRAY_TRUE@caf_shareddir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
 @LIBGFOR_NATIVE_COARRAY_TRUE@libcaf_shared_la_SOURCES = caf_shared/alloc.c caf_shared/allocator.c caf_shared/coarraynative.c \
 @LIBGFOR_NATIVE_COARRAY_TRUE@	caf_shared/hashmap.c  \
 @LIBGFOR_NATIVE_COARRAY_TRUE@	caf_shared/sync.c caf_shared/util.c caf_shared/wrapper.c caf_shared/collective_subroutine.c \
@@ -1685,33 +1687,33 @@ distclean-hdr:
 libgfortran.spec: $(top_builddir)/config.status $(srcdir)/libgfortran.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 
-install-cafexeclibLTLIBRARIES: $(cafexeclib_LTLIBRARIES)
+install-caf_sharedLTLIBRARIES: $(caf_shared_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	@list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
+	@list='$(caf_shared_LTLIBRARIES)'; test -n "$(caf_shareddir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(cafexeclibdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(cafexeclibdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(cafexeclibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(cafexeclibdir)"; \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(caf_shareddir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(caf_shareddir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(caf_shareddir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(caf_shareddir)"; \
 	}
 
-uninstall-cafexeclibLTLIBRARIES:
+uninstall-caf_sharedLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
+	@list='$(caf_shared_LTLIBRARIES)'; test -n "$(caf_shareddir)" || list=; \
 	for p in $$list; do \
 	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(cafexeclibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(cafexeclibdir)/$$f"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(caf_shareddir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(caf_shareddir)/$$f"; \
 	done
 
-clean-cafexeclibLTLIBRARIES:
-	-test -z "$(cafexeclib_LTLIBRARIES)" || rm -f $(cafexeclib_LTLIBRARIES)
-	@list='$(cafexeclib_LTLIBRARIES)'; \
+clean-caf_sharedLTLIBRARIES:
+	-test -z "$(caf_shared_LTLIBRARIES)" || rm -f $(caf_shared_LTLIBRARIES)
+	@list='$(caf_shared_LTLIBRARIES)'; \
 	locs=`for p in $$list; do echo $$p; done | \
 	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
 	      sort -u`; \
@@ -1720,33 +1722,33 @@ clean-cafexeclibLTLIBRARIES:
 	  rm -f $${locs}; \
 	}
 
-install-mylibLTLIBRARIES: $(mylib_LTLIBRARIES)
+install-cafexeclibLTLIBRARIES: $(cafexeclib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	@list='$(mylib_LTLIBRARIES)'; test -n "$(mylibdir)" || list=; \
+	@list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(mylibdir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(mylibdir)" || exit 1; \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(mylibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(mylibdir)"; \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(cafexeclibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(cafexeclibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(cafexeclibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(cafexeclibdir)"; \
 	}
 
-uninstall-mylibLTLIBRARIES:
+uninstall-cafexeclibLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(mylib_LTLIBRARIES)'; test -n "$(mylibdir)" || list=; \
+	@list='$(cafexeclib_LTLIBRARIES)'; test -n "$(cafexeclibdir)" || list=; \
 	for p in $$list; do \
 	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(mylibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(mylibdir)/$$f"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(cafexeclibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(cafexeclibdir)/$$f"; \
 	done
 
-clean-mylibLTLIBRARIES:
-	-test -z "$(mylib_LTLIBRARIES)" || rm -f $(mylib_LTLIBRARIES)
-	@list='$(mylib_LTLIBRARIES)'; \
+clean-cafexeclibLTLIBRARIES:
+	-test -z "$(cafexeclib_LTLIBRARIES)" || rm -f $(cafexeclib_LTLIBRARIES)
+	@list='$(cafexeclib_LTLIBRARIES)'; \
 	locs=`for p in $$list; do echo $$p; done | \
 	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
 	      sort -u`; \
@@ -7093,7 +7095,7 @@ check: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h all-local
 installdirs:
-	for dir in "$(DESTDIR)$(cafexeclibdir)" "$(DESTDIR)$(mylibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(gfor_cdir)" "$(DESTDIR)$(fincludedir)"; do \
+	for dir in "$(DESTDIR)$(caf_shareddir)" "$(DESTDIR)$(cafexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(gfor_cdir)" "$(DESTDIR)$(fincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: $(BUILT_SOURCES)
@@ -7130,8 +7132,8 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
-clean-am: clean-cafexeclibLTLIBRARIES clean-generic clean-libtool \
-	clean-local clean-mylibLTLIBRARIES \
+clean-am: clean-caf_sharedLTLIBRARIES clean-cafexeclibLTLIBRARIES \
+	clean-generic clean-libtool clean-local \
 	clean-toolexeclibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
@@ -7153,7 +7155,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-gfor_cHEADERS install-mylibLTLIBRARIES \
+install-data-am: install-caf_sharedLTLIBRARIES install-gfor_cHEADERS \
 	install-nodist_fincludeHEADERS
 
 install-dvi: install-dvi-am
@@ -7204,34 +7206,36 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-cafexeclibLTLIBRARIES uninstall-gfor_cHEADERS \
-	uninstall-mylibLTLIBRARIES uninstall-nodist_fincludeHEADERS \
-	uninstall-toolexeclibDATA uninstall-toolexeclibLTLIBRARIES
+uninstall-am: uninstall-caf_sharedLTLIBRARIES \
+	uninstall-cafexeclibLTLIBRARIES uninstall-gfor_cHEADERS \
+	uninstall-nodist_fincludeHEADERS uninstall-toolexeclibDATA \
+	uninstall-toolexeclibLTLIBRARIES
 
 .MAKE: all check install install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
-	check-am clean clean-cafexeclibLTLIBRARIES clean-cscope \
-	clean-generic clean-libtool clean-local clean-mylibLTLIBRARIES \
-	clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-hdr distclean-libtool distclean-local distclean-tags \
-	dvi dvi-am html html-am info info-am install install-am \
+	check-am clean clean-caf_sharedLTLIBRARIES \
+	clean-cafexeclibLTLIBRARIES clean-cscope clean-generic \
+	clean-libtool clean-local clean-toolexeclibLTLIBRARIES cscope \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-local distclean-tags dvi dvi-am html html-am info \
+	info-am install install-am install-caf_sharedLTLIBRARIES \
 	install-cafexeclibLTLIBRARIES install-data install-data-am \
 	install-dvi install-dvi-am install-exec install-exec-am \
 	install-exec-local install-gfor_cHEADERS install-html \
 	install-html-am install-info install-info-am install-man \
-	install-mylibLTLIBRARIES install-nodist_fincludeHEADERS \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip install-toolexeclibDATA \
+	install-nodist_fincludeHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip install-toolexeclibDATA \
 	install-toolexeclibLTLIBRARIES installcheck installcheck-am \
 	installdirs maintainer-clean maintainer-clean-generic \
 	maintainer-clean-local mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
 	pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-caf_sharedLTLIBRARIES \
 	uninstall-cafexeclibLTLIBRARIES uninstall-gfor_cHEADERS \
-	uninstall-mylibLTLIBRARIES uninstall-nodist_fincludeHEADERS \
-	uninstall-toolexeclibDATA uninstall-toolexeclibLTLIBRARIES
+	uninstall-nodist_fincludeHEADERS uninstall-toolexeclibDATA \
+	uninstall-toolexeclibLTLIBRARIES
 
 .PRECIOUS: Makefile
 
diff --git a/libgfortran/aclocal.m4 b/libgfortran/aclocal.m4
index 89e5496db5e..2408a18c484 100644
--- a/libgfortran/aclocal.m4
+++ b/libgfortran/aclocal.m4
@@ -108,6 +108,43 @@ AC_DEFUN([AM_AUX_DIR_EXPAND],
 am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
+# AM_COND_IF                                            -*- Autoconf -*-
+
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_COND_IF
+# _AM_COND_ELSE
+# _AM_COND_ENDIF
+# --------------
+# These macros are only used for tracing.
+m4_define([_AM_COND_IF])
+m4_define([_AM_COND_ELSE])
+m4_define([_AM_COND_ENDIF])
+
+# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
+# ---------------------------------------
+# If the shell condition COND is true, execute IF-TRUE, otherwise execute
+# IF-FALSE.  Allow automake to learn about conditional instantiating macros
+# (the AC_CONFIG_FOOS).
+AC_DEFUN([AM_COND_IF],
+[m4_ifndef([_AM_COND_VALUE_$1],
+	   [m4_fatal([$0: no such condition "$1"])])dnl
+_AM_COND_IF([$1])dnl
+if test -z "$$1_TRUE"; then :
+  m4_n([$2])[]dnl
+m4_ifval([$3],
+[_AM_COND_ELSE([$1])dnl
+else
+  $3
+])dnl
+_AM_COND_ENDIF([$1])dnl
+fi[]dnl
+])
+
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
 # Copyright (C) 1997-2017 Free Software Foundation, Inc.
diff --git a/libgfortran/configure b/libgfortran/configure
index 34a08a2213d..599c8804f37 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -637,6 +637,7 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 get_gcc_base_ver
+COARRAY_LIBS
 LIBGFOR_NATIVE_COARRAY_FALSE
 LIBGFOR_NATIVE_COARRAY_TRUE
 RT_LIBS
@@ -12733,7 +12734,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12736 "configure"
+#line 12737 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12839,7 +12840,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12842 "configure"
+#line 12843 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -27430,6 +27431,13 @@ fi
 done
 
 
+if test -z "$LIBGFOR_NATIVE_COARRAY_TRUE"; then :
+  COARRAY_LIBS="-lcaf_shared $PTHREAD_LIBS $RT_LIBS"
+else
+  COARRAY_LIBS=""
+fi
+
+
 CFLAGS="$CFLAGS_hold"
 LIBS="$LIBS_hold"
 
@@ -30641,3 +30649,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+echo HUHU $LIBGFOR_NATIVE_COARRAY
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 59bc2e047b3..532d0726fd1 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -714,6 +714,9 @@ LIBS="$LIBS $PTHREAD_LIBS $RT_LIBS"
 # Find the functions that we need
 AC_CHECK_FUNCS([pthread_condattr_setpshared pthread_mutexattr_setpshared pthread_barrierattr_setpshared shm_open shm_unlink],[AM_CONDITIONAL(LIBGFOR_NATIVE_COARRAY,true)],[AM_CONDITIONAL(LIBGFOR_NATIVE_COARRAY,false)])
 
+AM_COND_IF(LIBGFOR_NATIVE_COARRAY,[COARRAY_LIBS="-lcaf_shared $PTHREAD_LIBS $RT_LIBS"],[COARRAY_LIBS=""])
+AC_SUBST(COARRAY_LIBS)
+
 CFLAGS="$CFLAGS_hold"
 LIBS="$LIBS_hold"
 
diff --git a/libgfortran/libgfortran.spec.in b/libgfortran/libgfortran.spec.in
index 367d485c230..bc18137928b 100644
--- a/libgfortran/libgfortran.spec.in
+++ b/libgfortran/libgfortran.spec.in
@@ -5,4 +5,4 @@
 #
 
 %rename lib liborig
-*lib: @LIBQUADSPEC@ @LIBM@ %(libgcc) %(liborig)
+*lib: @LIBQUADSPEC@ @LIBM@ %(libgcc) %(liborig) %{fcoarray=shared:@COARRAY_LIBS@}


More information about the Gcc-cvs mailing list