#!/usr/bin/env python
# bin/cs_config_build.py.  Generated from cs_config_build.py.in by configure.
#============================================================================
#
#     This file is part of the Code_Saturne Kernel, element of the
#     Code_Saturne CFD tool.
#
#     Copyright (C) 2009 EDF S.A., France
#
#     contact: saturne-support@edf.fr
#
#     The Code_Saturne Kernel is free software; you can redistribute it
#     and/or modify it under the terms of the GNU General Public License
#     as published by the Free Software Foundation; either version 2 of
#     the License, or (at your option) any later version.
#
#     The Code_Saturne Kernel is distributed in the hope that it will be
#     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with the Code_Saturne Kernel; if not, write to the
#     Free Software Foundation, Inc.,
#     51 Franklin St, Fifth Floor,
#     Boston, MA  02110-1301  USA
#
#============================================================================

#-------------------------------------------------------------------------------

# Configuration:
# --------------

# use debugging code:                              false
# use graphical user interface:                    yes
# MPI (Message Passing Interface) support:         yes
# BLAS (Basic Linear Algebra Subprograms) support: yes
# Libxml2 (XML Reader) support:                    yes
# IP socket support (for SYRTHES 3 or CFD_Proxy):  yes
# Dynamic loader support (for YACS):               no


# C compiler used for build: gcc46 (FreeBSD Ports Collection) 4.6.3
# --------------------------
# Using built-in specs.
# COLLECT_GCC=/usr/local/bin/gcc46
# COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.1/4.6.3/lto-wrapper
# Target: x86_64-portbld-freebsd9.1
# Configured with: ./../gcc-4.6.3/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd9.1
# Thread model: posix
# gcc version 4.6.3 (FreeBSD Ports Collection) 

# Fortran compiler used for build: GNU Fortran (FreeBSD Ports Collection) 4.6.3
# --------------------------------
# Using built-in specs.
# COLLECT_GCC=gfortran46
# COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd9.1/4.6.3/lto-wrapper
# Target: x86_64-portbld-freebsd9.1
# Configured with: ./../gcc-4.6.3/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd9.1
# Thread model: posix
# gcc version 4.6.3 (FreeBSD Ports Collection) 

#-------------------------------------------------------------------------------

# Build tools, option, and libraries
#-----------------------------------

class build:
    cc="gcc46"
    fc="gfortran46"
    cppflags=" -I/usr/local/include/libxml2 -DNDEBUG -I/usr/local/include       -I/usr/include/libxml2 "
    cflags="-std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing  -O2 -fexcess-precision=fast"
    fcflags="-x f95-cpp-input -Wall -Wno-unused  -D_CS_FC_HAVE_FLUSH  -O"
    ldflags=" -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib          -Wl,-rpath=/usr/local/lib/gcc46 -O"
    libs="-lfvm -lcgns -lmedC -lhdf5 -pthread -lm -lfvm_coupl -lmei -lbft -lz -lmpich -lmpl -pthread -lxml2 -lblas  -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.1/4.6.3 -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.1/4.6.3/../../../../../x86_64-portbld-freebsd9.1/lib -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.1/4.6.3/../../.. -lgfortran -lm -lquadmath  "
    rpath=""

class build_syrthes:
    cc=""
    fc=""
    cppflags=""
    cflags=""
    fcflags=""
    ldflags=""
    libs=" "

#-------------------------------------------------------------------------------

def get_config():
    """
    Get the configuration information.
    """
    msg = """\
Compilers and associated options:
  cc = %(cc)s
  fc = %(fc)s
  cppflags = %(cppflags)s
  cflags = %(cflags)s
  fcflags = %(fcflags)s
  ldflags = %(ldflags)s
  libs = %(libs)s
  rpath = %(rpath)s\
"""

    return msg \
        % { 'cc':build.cc, 'fc':build.fc,
            'cppflags':build.cppflags, 'cflags':build.cflags,
            'fcflags':build.fcflags, 'ldflags':build.ldflags,
            'libs':build.libs, 'rpath':build.rpath }

#-------------------------------------------------------------------------------

def get_config_syrthes():
    """
    Get the configuration information.
    """
    msg = """\
Compilers and associated options for SYRTHES build:
  cc = %(cc)s
  fc = %(fc)s
  cppflags = %(cppflags)s
  cflags = %(cflags)s
  fcflags = %(fcflags)s
  ldflags = %(ldflags)s
  libs = %(libs)s\
"""

    return msg \
        % { 'cc':build_syrthes.cc, 'fc':build_syrthes.fc,
            'cppflags':build_syrthes.cppflags, 'cflags':build_syrthes.cflags,
            'fcflags':build_syrthes.fcflags, 'ldflags':build_syrthes.ldflags,
            'libs':build_syrthes.libs }

#-------------------------------------------------------------------------------

def main(argv):
    """
    Main configuration info function.
    """
    import sys
    sys.stdout.write("%(b)s\n\n%(s)s\n" %
                     {'b':get_config(),
                      's':get_config_syrthes()})

if __name__ == '__main__':
    import sys
    main(sys.argv[1:])
