2
2
# Process this file with autoconf to produce a configure script.
3
3
4
4
AC_PREREQ ( [ 2.69] )
5
+ # Do not forget to update version.
5
6
AC_INIT ( [ network-tests2] ,
[ 2.0.1] ,
[ Alexey Salnikov <[email protected] >] )
6
7
AC_PREFIX_DEFAULT ( [ $HOME/network_tests-$PACKAGE_VERSION] )
7
8
9
+ # Directory with user-defined macros (macros with 'AX_' prefix).
8
10
AC_CONFIG_MACRO_DIR ( [ ac-macros] )
11
+
12
+ # Configure variables declaration.
9
13
# TODO: Change the value for qmake for QT5 later
10
14
AC_ARG_VAR ( [ QMAKE] , [ Place where qmake-qt4 is installed] )
11
15
AC_ARG_VAR ( [ MPICC] , [ Path to MPI2 compatible C-compiler] )
@@ -16,24 +20,31 @@ AC_ARG_VAR([MPI_LIBS], [Additional libs for parallel program])
16
20
AC_ARG_VAR ( [ MPI_LDFLAGS] , [ Path to additional libs for parallel program] )
17
21
AC_ARG_VAR ( [ GOALS] , [ List of goals to be built] )
18
22
23
+ # Explicitly enables build for network_viewer_qt_v2 component.
19
24
AX_ARG_ENABLE([ qt-gui] , [ " network_viewer_qt_v2 "] , [ ""] , [
20
25
Enable Qt version of network-viewer program (disabled by default)
21
- ] ) # network_viewer_qt_v2
26
+ ] )
27
+
28
+ # Explicitly enables build for network_test component.
22
29
AX_ARG_ENABLE([ network-test] , [ " network_test "] , [ " network_test "] , [
23
30
Enable testing (enabled by default)
24
- ] ) # network-test
31
+ ] )
32
+
33
+ # Explicitly enables build for clustering component.
25
34
AX_ARG_ENABLE([ clustering] , [ " clustering "] , [ ""] , [
26
35
Enable clustering (disabled by default)
27
- ] ) # clustering
36
+ ] )
28
37
38
+ # Enables build for all components of the project.
29
39
AC_ARG_ENABLE ( [ all] , [ AS_HELP_STRING ( [ --enable-all] , [ Enable all modules] ) ] , [
30
40
AS_CASE ( [ "${enableval}"] ,
31
41
[ yes] , [ AC_SUBST ( [ GOALS] , [ "network_test network_viewer_qt_v2 clustering"] ) ] ,
32
42
[ no] , [ ] ,
33
43
[ AC_MSG_ERROR ( [ Bad value ${enableval} for --enable-all] ) ]
34
44
)
35
- ] ) # all
45
+ ] )
36
46
47
+ # Checks for non-default specific tools.
37
48
AS_IF ( [ test "x$MPICC" = "x"] , [ AC_SUBST ( [ MPICC] , [ mpicc] ) ] )
38
49
AS_IF ( [ test "x$MPICXX" = "x"] , [ AC_SUBST ( [ MPICXX] , [ mpicxx] ) ] )
39
50
# TODO: Change the value for qmake for QT5 later
@@ -61,37 +72,41 @@ AC_FUNC_REALLOC
61
72
AC_FUNC_STRTOD
62
73
AC_CHECK_FUNCS ( [ clock_gettime floor gethostname gettimeofday localeconv memset sqrt strchr strstr] )
63
74
64
- # Checks for -lnetcdf
75
+ # Checks for required function of netcdf library.
65
76
AX_CHECK_LIB([ netcdf] , [ nc_create nc_sync nc_close nc_enddef nc_def_dim \
66
77
nc_def_var nc_put_var_int nc_put_vara_double
67
78
] )
68
79
69
- # Checks for chosen targets
80
+ # Checks for chosen components
70
81
for target in $GOALS
71
82
do
72
83
AS_CASE ( [ "$target"] ,
73
84
[ *"network_viewer_qt"*] , [
85
+ # Checks for tools and libraries required by network_viewer_qt_v2
74
86
AX_CHECK_PROG([ QMAKE] , [ qmake-qt4 is required but has not been found] )
75
87
AX_RAW_CHECK_PROG([ lrelease] , [ lrelease is required but has not been found] )
76
- # Checks for libraries.
77
- # -lqwt-qt4 -lGLU -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
78
88
AX_CHECK_LIB([ netcdf] , [ nc_open nc_inq_varid nc_get_var1 \
79
89
nc_inq_nvars nc_inq_varids nc_inq_varndims nc_inq_dimlen \
80
90
nc_inq_vardimid nc_get_vara_double nc_get_var1_int
81
91
] )
92
+ # TODO: Add checks for libraries.
93
+ # -lqwt-qt4 -lGLU -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
82
94
] ,
83
95
[ *"network_test"*] , [
96
+ # Checks for tools and libraries required by network_test
84
97
AX_CHECK_LIB([ netcdf] , [ nc_open nc_get_var_int nc_get_vara_double \
85
98
nc_inq_dimid nc_inq_dimlen nc_inq_varid
86
99
] )
87
100
]
88
101
)
89
102
done
90
103
104
+ # Use flags of non-MPI compilers for MPI ones
91
105
AS_IF ( [ test "x$MPI_CFLAGS" = "x"] , [ AC_SUBST ( [ MPI_CFLAGS] , $CFLAGS ) ] )
92
106
AS_IF ( [ test "x$MPI_CXXFLAGS" = "x"] , [ AC_SUBST ( [ MPI_CXXFLAGS] , $CXXFLAGS ) ] )
93
107
AS_IF ( [ test "x$MPI_LDFLAGS" = "x"] , [ AC_SUBST ( [ MPI_LDFLAGS] , $LDFLAGS ) ] )
94
108
AS_IF ( [ test "x$MPI_LIBS" = "x"] , [ AC_SUBST ( [ MPI_LIBS] , $LIBS ) ] )
95
109
110
+ # Define output files to be built from templates
96
111
AC_CONFIG_FILES ( [ config Makefile parus_config.h] )
97
112
AC_OUTPUT
0 commit comments