Skip to content

Commit

Permalink
Fix issue with libyaml being a requirement for F77 support
Browse files Browse the repository at this point in the history
It seems that any library checked using AC_CHECK_LIB (e.g libyaml)
automatically gets added to the list of linker options required to work
with Fortran if AC_CHECK_LIB is used before AC_FC_LIBRARY_LDFLAGS. So
this commit moves the use of AC_FC_LIBRARY_LDFLAGS so that it comes beore
all use of AC_CHECK_LIB.

This changes the "flibs" value in ast_link and ast_link_adam so that they
no longer include -lyaml and -pthread.
  • Loading branch information
dsberry committed Sep 16, 2020
1 parent 0eda864 commit 2d580e2
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,29 @@ else
fi
AM_CONDITIONAL(EXTERNAL_PAL, test x$external_pal = x1)

# Conditional defining whether we want to support Fortran libraries
# (e.g. pgplot) and applications. It seems that this must come before
# any uses of AC_CHECK_LIB as otherwise the library checked using
# AC_CHECK_LIB is automatically added to the list of linker options
# created by AC_FC_LIBRARY_LDFLAGS
AC_ARG_WITH([fortran],
[ --without-fortran Build package without Fortran support],
if test "$withval" = "yes"; then
use_fortran="1"
else
use_fortran="0"
fi,
use_fortran="1")
AM_CONDITIONAL(NOFORTRAN, test x$use_fortran = x0)
AC_SUBST(FORTRAN, $use_fortran)

# ast_link needs to be able to link against the Fortran runtime if
# necessary
if test "$use_fortran" = "1"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
fi


# Checks for programs
AC_PROG_CC
Expand Down Expand Up @@ -177,26 +200,6 @@ AC_DEFUN([CIT_FUNCTIONSTRING], [

CIT_FUNCTIONSTRING

# Conditional defining whether we want to support Fortran libraries
# (e.g. pgplot) and applications.
AC_ARG_WITH([fortran],
[ --without-fortran Build package without Fortran support],
if test "$withval" = "yes"; then
use_fortran="1"
else
use_fortran="0"
fi,
use_fortran="1")
AM_CONDITIONAL(NOFORTRAN, test x$use_fortran = x0)
AC_SUBST(FORTRAN, $use_fortran)

# ast_link needs to be able to link against the Fortran runtime if
# necessary
if test "$use_fortran" = "1"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
fi

# Find an absolute path to the Perl binary, augmenting the path with the
# location of the Starlink Perl build. If this fails, then set @PERL@
# to the backup `/usr/bin/env perl', which will find Perl if it exists
Expand Down

0 comments on commit 2d580e2

Please sign in to comment.