1
dnl----------------------------------------------------------------------------
2
dnl This file is part of the Code_Saturne Kernel, element of the
3
dnl Code_Saturne CFD tool.
5
dnl Copyright (C) 2009 EDF S.A., France
7
dnl The Code_Saturne Kernel is free software; you can redistribute it
8
dnl and/or modify it under the terms of the GNU General Public License
9
dnl as published by the Free Software Foundation; either version 2 of
10
dnl the License, or (at your option) any later version.
12
dnl The Code_Saturne Kernel is distributed in the hope that it will be
13
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14
dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
dnl GNU General Public License for more details.
17
dnl You should have received a copy of the GNU General Public Licence
18
dnl along with the Code_Saturne Preprocessor; if not, write to the
19
dnl Free Software Foundation, Inc.,
20
dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
dnl-----------------------------------------------------------------------------
23
# CS_AC_CONFIG_INFO_INIT([OUTPUT FILE NAME])
24
#-----------------------
25
# Write main config info file header.
27
AC_DEFUN([CS_AC_CONFIG_INFO_INIT], [
29
# First arg is output file name
30
if test "$1" = "" ; then
31
cs_ac_config_info="cs-config"
36
outfile="$cs_ac_config_info"-tmp
40
AC_MSG_NOTICE([initializing $cs_ac_config_info])
43
# CS_AC_CONFIG_INFO_EXTRA([extra config info strings])
44
#------------------------
45
# Write extra info to config info file header.
47
AC_DEFUN([CS_AC_CONFIG_INFO_EXTRA], [
49
AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
51
outfile="$cs_ac_config_info"-tmp
53
echo "# Configuration:" >> $outfile
54
echo "# --------------" >> $outfile
59
# CS_AC_CONFIG_INFO_CC([version], [version_full])
60
#---------------------
61
# Write available compiler info to config info file header.
63
AC_DEFUN([CS_AC_CONFIG_INFO_CC], [
65
AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
67
outfile="$cs_ac_config_info"-tmp
69
if test "$1" != "" -o "$2" != "" ; then
71
echo "# C compiler used for build: $1" >> $outfile
72
echo "# --------------------------" >> $outfile
73
if test "$2" != "" ; then
74
echo "$2" | sed 's/^/# /' >> $outfile
77
AC_MSG_NOTICE([C compiler version info unavailable for configuration file])
81
# CS_AC_CONFIG_INFO_FC([version], [version_full])
82
#---------------------
83
# Write available compiler info to config info file header.
85
AC_DEFUN([CS_AC_CONFIG_INFO_FC], [
87
AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
89
outfile="$cs_ac_config_info"-tmp
91
if test "$1" != "" -o "$2" != "" ; then
93
echo "# Fortran compiler used for build: $1" >> $outfile
94
echo "# --------------------------------" >> $outfile
95
if test "$2" != "" ; then
96
echo "$2" | sed 's/^/# /' >> $outfile
99
AC_MSG_NOTICE([Fortran compiler version info unavailable for configuration file])
103
# CS_AC_CONFIG_INFO_FINALIZE
104
#---------------------------
105
# Write main config info file body (script part).
107
AC_DEFUN([CS_AC_CONFIG_INFO_FINALIZE], [
109
AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
111
outfile="$cs_ac_config_info"-tmp
113
AC_MSG_NOTICE([closing $cs_ac_config_info])
115
diff $outfile $cs_ac_config_info > /dev/null 2>&1
116
if test $? -eq 0 ; then
117
AC_MSG_NOTICE([$cs_ac_config_info is unchanged])
120
mv $outfile $cs_ac_config_info
121
chmod +x $cs_ac_config_info