Newer
Older
# overwrite an internal function of autoconf
#
# The function below caused configure to abort if no fortran was available.
# Changed it to just report a warning that we cannot compile
# fortran programms.
# __AC_FC_NAME_MANGLING
# ---------------------
# Test for the name mangling scheme used by the Fortran compiler.
#
# Sets ac_cv_{f77,fc}_mangling. The value contains three fields, separated
# by commas:
#
# lower case / upper case:
# case translation of the Fortran symbols
# underscore / no underscore:
# whether the compiler appends "_" to symbol names
# extra underscore / no extra underscore:
# whether the compiler appends an extra "_" to symbol names already
# containing at least one underscore
#
AC_DEFUN([__AC_FC_NAME_MANGLING],
[_AC_FORTRAN_ASSERT()dnl
AC_CACHE_CHECK([for Fortran name-mangling scheme],
ac_cv_[]_AC_LANG_ABBREV[]_mangling,
[ subroutine foobar()
return
end
subroutine foo_bar()
return
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[mv conftest.$ac_objext cfortran_test.$ac_objext
ac_save_LIBS=$LIBS
LIBS="cfortran_test.$ac_objext $LIBS $[]_AC_LANG_PREFIX[]LIBS"
AC_LANG_PUSH(C)dnl
ac_success=no
for ac_foobar in foobar FOOBAR; do
for ac_underscore in "" "_"; do
ac_func="$ac_foobar$ac_underscore"
AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
[ac_success=yes; break 2])
done
done
AC_LANG_POP(C)dnl
if test "$ac_success" = "yes"; then
case $ac_foobar in
foobar)
ac_case=lower
ac_foo_bar=foo_bar
;;
FOOBAR)
ac_case=upper
ac_foo_bar=FOO_BAR
;;
esac
AC_LANG_PUSH(C)dnl
ac_success_extra=no
for ac_extra in "" "_"; do
ac_func="$ac_foo_bar$ac_underscore$ac_extra"
AC_LINK_IFELSE([AC_LANG_CALL([], [$ac_func])],
[ac_success_extra=yes; break])
done
AC_LANG_POP(C)dnl
if test "$ac_success_extra" = "yes"; then
ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_case case"
if test -z "$ac_underscore"; then
ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no underscore"
else
ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, underscore"
fi
if test -z "$ac_extra"; then
ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, no extra underscore"
else
ac_cv_[]_AC_LANG_ABBREV[]_mangling="$ac_cv_[]_AC_LANG_ABBREV[]_mangling, extra underscore"
fi
else
ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
fi
else
ac_cv_[]_AC_LANG_ABBREV[]_mangling="unknown"
fi
LIBS=$ac_save_LIBS
rm -f cfortran_test* conftest*],
[AC_MSG_WARN([cannot compile a simple Fortran program])])
])
])# __AC_FC_NAME_MANGLING