summaryrefslogtreecommitdiff
path: root/m4/ax_f90_library.m4
diff options
context:
space:
mode:
authorTimothy Brown <tbrown@freeshell.org>2014-07-24 08:22:40 -0600
committerPeter Simons <simons@cryp.to>2014-10-15 10:37:32 +0200
commit9dd93cb6f66f289de0f6bd8e182454aaddf753e0 (patch)
tree81390e6309f85272a62d30561a28558a8495582f /m4/ax_f90_library.m4
parent825427776a2a1223b64c29c9a458ee31874a8e82 (diff)
downloadautoconf-archive-9dd93cb6f66f289de0f6bd8e182454aaddf753e0.tar.gz
Bug fix and improvements to ax_f90_library.m4.
1) The message uses a lower case "f" for the word fortran. However most other autoconf macros use "F". 2) The search path prepends $prefix, yet does not check to see if this "NONE" (the default). When it is NONE, the find command complains (as a directory called NONE normally does not exist). 3) Removed a white space between the "-L" and the directory for the LDFLAGS search path. 4) The "action-found" and "action-not-found" logic was incorrect. The default test is for not found, which would execute the users supplied found action. Swapped these around.
Diffstat (limited to 'm4/ax_f90_library.m4')
-rw-r--r--m4/ax_f90_library.m416
1 files changed, 10 insertions, 6 deletions
diff --git a/m4/ax_f90_library.m4 b/m4/ax_f90_library.m4
index 3d96d8b..58a1b6a 100644
--- a/m4/ax_f90_library.m4
+++ b/m4/ax_f90_library.m4
@@ -32,17 +32,21 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 9
+#serial 10
AC_DEFUN([AX_F90_LIBRARY],[
AS_VAR_PUSHDEF([ax_ldflags],[ax_cv_f90_ldflags_$1])
AS_VAR_PUSHDEF([ax_libs],[ax_cv_f90_libs_$1])
-AC_MSG_CHECKING([$1 fortran 90 library])
+AC_MSG_CHECKING([$1 Fortran 90 library])
AC_LANG_PUSH(Fortran)
AS_VAR_SET([ax_ldflags],"")
AS_VAR_SET([ax_libs],"not found")
if test "x$4" = x ; then
-ax_search="$prefix:$ac_default_prefix"
+ if test "x$prefix" != "xNONE" ; then
+ ax_search="$prefix:$ac_default_prefix"
+ else
+ ax_search="$ac_default_prefix"
+ fi
for ax_base in "" `echo $LD_LIBRARY_PATH | tr ':' '\012'` ; do
if test "x$ax_base" != x ; then
changequote(,)dnl
@@ -69,7 +73,7 @@ for ax_base in `echo $ax_search | tr ':' '\012'` ; do
changequote(,)dnl
ax_lib="`echo $ax_lib | sed 's,lib\(.*\)\.[^.]*$,\1,'`"
changequote([,])dnl
- AS_VAR_SET([ax_ldflags],"-L $ax_dir")
+ AS_VAR_SET([ax_ldflags],"-L$ax_dir")
AS_VAR_SET([ax_libs],"-l$ax_lib")
;;
*)
@@ -94,11 +98,11 @@ AC_MSG_RESULT([AS_VAR_GET(ax_ldflags) AS_VAR_GET(ax_libs)])
if test "AS_VAR_GET(ax_libs)" = "not found"; then
AS_TR_SH(F90_LDFLAGS_$1)=""
AS_TR_SH(F90_LIBS_$1)=""
- $5
+ $6
else
AS_TR_SH(F90_LDFLAGS_$1)=AS_VAR_GET(ax_ldflags)
AS_TR_SH(F90_LIBS_$1)=AS_VAR_GET(ax_libs)
- $6
+ $5
fi
AC_SUBST(AS_TR_SH(F90_LDFLAGS_$1))
AC_SUBST(AS_TR_SH(F90_LIBS_$1))