1#! /bin/sh
2#
3# This forms the basis for the nf-config utility, which tells you
4# various things about the netCDF Fortran installation.
5
6
7prefix=@CMAKE_INSTALL_PREFIX@
8exec_prefix=@CMAKE_INSTALL_PREFIX@
9libdir=@CMAKE_INSTALL_PREFIX@/lib
10includedir=@CMAKE_INSTALL_PREFIX@/include
11fmoddir=@CMAKE_INSTALL_PREFIX@/@Fortran_INSTALL_MODDIR@
12#
13cc="@CMAKE_C_COMPILER@"
14fc="@CMAKE_Fortran_COMPILER@"
15cflags="-I@CMAKE_INSTALL_PREFIX@/include @CMAKE_C_FLAGS@ @CMAKE_CPP_FLAGS@"
16fflags="-I${includedir} @MOD_FLAG@${fmoddir}"
17#
18has_dap="@HAS_DAP@"
19has_nc2="@HAS_NC2@"
20has_nc4="@HAS_NC4@"
21has_f90="@HAS_F90@"
22has_f03="@HAS_F03@"
23flibs="-L${libdir} @NC_FLIBS@"
24version="@PACKAGE_NAME@ @PACKAGE_VERSION@"
25
26 usage()
27 {
28         echo
29         echo "This $version has been built with the following features: "
30         echo
31         echo "  --cc        -> $cc"
32         echo "  --cflags    -> $cflags"
33         echo
34         echo "  --fc        -> $fc"
35         echo "  --fflags    -> $fflags"
36         echo "  --flibs     -> $flibs"
37         echo "  --has-f90   -> $has_f90"
38         echo "  --has-f03   -> $has_f03"
39         echo
40         echo "  --has-nc2   -> $has_nc2"
41         echo "  --has-nc4   -> $has_nc4"
42 	echo
43         echo "  --prefix    -> $prefix"
44         echo "  --includedir-> $includedir"
45         echo "  --version   -> $version"
46         echo
47 }
48
49 if test $# -eq 0; then
50     usage 1
51 fi
52
53 while test $# -gt 0; do
54     case "$1" in
55      #this deals with options in the style
56      #--option=value and extracts the value part
57      #[not currently used]
58     -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
59     *) value= ;;
60     esac
61
62     case "$1" in
63
64     --help)
65 	usage 0
66 	;;
67
68     --all)
69 	all
70 	;;
71
72     --cc)
73 	echo $cc
74 	;;
75
76     --fc)
77 	echo $fc
78 	;;
79
80     --cflags)
81 	echo $cflags
82 	;;
83
84     --fflags)
85 	echo $fflags
86 	;;
87
88     --has-dap)
89        	echo $has_dap
90        	;;
91
92     --has-nc2)
93        	echo $has_nc2
94        	;;
95
96     --has-nc4)
97        	echo $has_nc4
98        	;;
99
100     --has-f90)
101        	echo $has_f90
102        	;;
103
104     --has-f03)
105        	echo $has_f03
106        	;;
107
108     --flibs)
109        	echo $flibs
110        	;;
111
112     --prefix)
113        	echo "${CMAKE_INSTALL_PREFIX}"
114        	;;
115
116     --includedir)
117        	echo "${includedir}"
118        	;;
119
120     --version)
121 	echo $version
122 	;;
123
124     *)
125         echo "unknown option: $1"
126 	usage
127 	exit 1
128 	;;
129     esac
130     shift
131 done
132
133 exit 0
134