-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
168 lines (132 loc) · 5.44 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# WOSS - World Ocean Simulation System -
#
# Copyright (C) 2009 Federico Guerra
# and regents of the SIGNET lab, University of Padova
#
# Author: Federico Guerra - federico@guerra-tlc.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# This software has been developed by Federico Guerra
# and SIGNET lab, University of Padova,
# in collaboration with the NATO Centre for Maritime Research
# and Experimentation (http://www.cmre.nato.int ;
# E-mail: pao@cmre.nato.int),
# whose support is gratefully acknowledged.
AC_INIT([WOSS], [1.13.0], [woss@guerra-tlc.com])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_MSG_NOTICE([WOSS AC_PACKAGE_VERSION])
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIRS([m4])
AC_MSG_NOTICE([checking user options])
AC_PATH_NS_ALLINONE([have_nsallinone=yes],[have_nsallinone=no])
AC_ARG_WITH_NSMIRACLE
AC_CHECK_NSMIRACLE([have_nsmiracle=yes],[have_nsmiracle=no])
#if test x$have_nsmiracle != xyes ; then
# AC_MSG_ERROR([Could not find nsmiracle,
# is --with-nsmiracle set correctly?])
#fi
AC_ARG_WITH_NETCDF
AC_CHECK_NETCDF([have_netcdf=yes],[have_netcdf=no])
#if test x$have_netcdf != xyes ; then
# AC_MSG_ERROR([Could not find netcdf,
# is --with-netcdf set correctly?])
#fi
AC_ARG_WITH_NETCDF4
AC_CHECK_NETCDF4([have_netcdf4=yes],[have_netcdf4=no])
#if test x$have_netcdf4 != xyes ; then
# AC_MSG_ERROR([Could not find netcdf,
# is --with-netcdf4 set correctly?])
#fi
AC_ARG_WITH(pthread, [--with-pthread enables pthread extensions])
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-I$(top_srcdir)/woss/woss_def'
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-I$(top_srcdir)/woss/woss_db'
UW_WOSS_WARN="$UW_WOSS_WARN "'-Wall -Werror'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-I$(top_srcdir)/woss/woss_def'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-I$(top_srcdir)/woss/woss_db'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-I$(top_srcdir)/woss'
UW_WOSS_PHY_WARN="$UW_WOSS_PHY_WARN "'-Wall -Werror -Wno-write-strings'
UW_WOSS_LDFLAGS='-L$(top_srcdir)/woss/woss_def'
UW_WOSS_LDFLAGS="$UW_WOSS_LDFLAGS "'-L$(top_srcdir)/woss/woss_db'
UW_WOSS_PHY_LDFLAGS="$UW_WOSS_PHY_LDFLAGS "'-L$(top_srcdir)/woss/woss_def'
UW_WOSS_PHY_LDFLAGS="$UW_WOSS_PHY_LDFLAGS "'-L$(top_srcdir)/woss/woss_db'
UW_WOSS_PHY_LDFLAGS="$UW_WOSS_PHY_LDFLAGS "'-L$(top_srcdir)/woss'
UW_WOSS_PHY_LIBADD="$UW_WOSS_PHY_LIBADD -lWOSS"
if test "$have_netcdf" == "yes"
then
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-DWOSS_NETCDF_SUPPORT'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-DWOSS_NETCDF_SUPPORT'
AC_MSG_NOTICE([NETCDF support will be built.])
else
AC_MSG_NOTICE([NETCDF support will NOT be built.])
fi
if test "$have_netcdf4" == "yes"
then
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-DWOSS_NETCDF_SUPPORT -DWOSS_NETCDF4_SUPPORT'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-DWOSS_NETCDF_SUPPORT -DWOSS_NETCDF4_SUPPORT'
AC_MSG_NOTICE([NETCDF4 support will be built.])
else
AC_MSG_NOTICE([NETCDF4 support will NOT be built.])
fi
if test "$have_nsallinone" == "yes"
then
if test "$have_nsmiracle" == "yes"
then
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-DWOSS_NS_MIRACLE_SUPPORT'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-DWOSS_NS_MIRACLE_SUPPORT'
AC_MSG_NOTICE([NS MIRACLE support will be built.])
else
AC_MSG_NOTICE([NS ALLINONE path is correct, but NS MIRACLE is NOT, NS MIRACLE support will NOT be built.])
fi
else
AC_MSG_NOTICE([NS ALLINONE path is NOT correct, NS MIRACLE support will NOT be built.])
fi
if test "$with_pthread" == "yes"
then
AC_MSG_NOTICE([Pthread support will be built.])
UW_WOSS_CPPFLAGS="$UW_WOSS_CPPFLAGS "'-DWOSS_MULTITHREAD -pthread'
UW_WOSS_PHY_CPPFLAGS="$UW_WOSS_PHY_CPPFLAGS "'-DWOSS_MULTITHREAD -pthread'
UW_WOSS_LIBADD="$UW_WOSS_LIBADD "'-lpthread'
UW_WOSS_PHY_LIBADD="$UW_WOSS_PHY_LIBADD "'-lpthread'
else
AC_MSG_NOTICE([Pthread support will NOT be built.])
fi
AC_SUBST(UW_WOSS_CPPFLAGS)
AC_SUBST(UW_WOSS_PHY_CPPFLAGS)
AC_SUBST(UW_WOSS_WARN)
AC_SUBST(UW_WOSS_PHY_WARN)
AC_SUBST(UW_WOSS_LDFLAGS)
AC_SUBST(UW_WOSS_PHY_LDFLAGS)
AC_SUBST(UW_WOSS_LIBADD)
AC_SUBST(UW_WOSS_PHY_LIBADD)
AM_CONDITIONAL([NS_MIRACLE_BUILD], [test "x$have_nsmiracle" = xyes -a "x$have_nsallinone" = xyes])
AM_CONDITIONAL([NETCDF_BUILD], [test "x$have_netcdf" = xyes -o "x$have_netcdf4" = xyes])
AC_DEFINE(CPP_NAMESPACE,std)
AC_MSG_NOTICE([generating header files and makefiles])
AC_CONFIG_FILES([Makefile
doxy/Makefile
doxy/imgs/Makefile
woss/woss_def/Makefile
woss/woss_db/Makefile
woss/Makefile
m4/Makefile
samples/Makefile
woss_phy/Makefile
woss_phy/tcl_hooks/Makefile
tests/Makefile
])
AC_OUTPUT()