-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
141 lines (123 loc) · 4.47 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
dnl Process this file with autoconf to produce a new configure script if it has changed.
dnl ------------------------------------------------------------------------------------
# non-affective change to see if it fires off a new build immediately.
AC_INIT(README.md)
AC_MSG_CHECKING([ADMIT config])
ADMIT="`pwd`"
AC_SUBST(ADMIT)
EDIT_MSG="Do not edit this file, it has been generated via configure in ADMIT `python admit/version.py`"
AC_SUBST(EDIT_MSG)
dnl A dummy matplotlibbackend.py, should be using --with-backend=Agg or so
dnl touch lib/matplotlibbackend.py
# Check if there is a CASA installation in the path. - ignoring $CASAPATH for now
# We are assuming casa-config means that casa is there as well.
AC_PATH_PROG(CASAPY_LOC, casa-config,[])
if test "x${CASAPY_LOC}" != "x"; then
CASA_ROOT=$(casa-config --prefix)
AC_MSG_NOTICE([Found CASA in $CASA_ROOT])
fi
# Using CRB1, CRB2 and CRB3 for possible PATH elements. Repeat if fewer needed
# uname -s = Linux: CASA_ROOT/bin and CASA_ROOT/lib/casa/bin
# uname -s = Darwin: CASA_ROOT/MacOS
# Check if they gave -with-casa-root (and it was valid)
AC_ARG_WITH([casa-root],
AC_HELP_STRING([--with-casa-root=DIR],[directory containing CASA installation]),
[
case "$with_casa_root" in
yes|no|'')
AC_MSG_RESULT([failed,])
AC_MSG_ERROR([--with-casa-root requires an argument])
;;
*)
with_casa_root_src="command line"
;;
esac
AC_MSG_CHECKING([CASA in $with_casa_root ($with_casa_root_src)])
if test ! -d "$with_casa_root/data/alma"; then
AC_MSG_ERROR([$with_casa_root does not appear to be a valid CASA installation.1])
else
AC_MSG_RESULT([$with_casa_root appears to be a valid CASA installation.1])
AC_SUBST([CASA_ROOT],[$with_casa_root])
fi
],[
for casaroot in /Applications/CASA.app/Contents/ /home/casa/packages/ /astromake/opt/casa/; do
if test -d $casaroot; then
AC_MSG_NOTICE([Found a casa-root in or below $casaroot])
fi
done
if test "x$CASA_ROOT" = "x"; then
AC_MSG_WARN([CASA not found and --with-casa-root not given])
with_casa_root=""
else
# Finally, check if CASA_ROOT environment variable was defined
with_casa_root="$CASA_ROOT"
with_casa_root_src="CASA_ROOT environment variable"
AC_MSG_CHECKING([CASA in $with_casa_root ($with_casa_root_src)])
if test ! -d "$with_casa_root/data/alma"; then
AC_MSG_ERROR([$with_casa_root does not appear to be a valid CASA installation.2])
else
AC_MSG_RESULT([$with_casa_root appears to be a valid CASA installation.2])
fi
with_casa_root=`cd $with_casa_root; pwd`
fi
])
AC_SUBST([CASA_ROOT],[$with_casa_root])
AC_MSG_NOTICE([Using $CASA_ROOT ($with_casa_root_src)])
uname_s="`uname -s`"
case "$uname_s" in
Linux|linux)
CRB1=bin
CRB2=lib/casa/bin
CRB3=""
TCLTK=share
;;
Darwin|darwin)
CRB1=MacOS
CRB2=darwin/bin
CRB3=Macos
TCLTK=Resources
;;
*)
esac
AC_SUBST(CRB1)
AC_SUBST(CRB2)
AC_SUBST(CRB3)
AC_SUBST(TCLTK)
# Check if they gave -with-testdata (and it was valid)
AC_ARG_WITH([testdata],
AC_HELP_STRING([--with-testdata=DIR],[directory containing ADMIT testdata]),
[
case "$with_testdata" in
yes|no|'')
AC_MSG_RESULT([failed,])
AC_MSG_ERROR([--with-testdata requires an argument])
;;
*)
with_testdata_src="command line"
;;
esac
AC_MSG_CHECKING([DATA in $with_testdata ($with_testdata_src)])
if test ! -d "$with_testdata"; then
AC_MSG_ERROR([$with_testdata does not appear to be a valid directory.])
else
AC_MSG_RESULT([$with_testdata appears to be a valid directory.])
AC_SUBST([TESTDATA],[$with_testdata])
ln -s $with_testdata testdata
fi
])
AC_CHECK_PROG(HAVE_SPHINX, sphinx-build, yes)
if test "x$HAVE_SPHINX" = "x"; then
AC_MSG_WARN([Sphinx not found -- You will not be able to build documentation.])
fi
####################################
#@todo check Sphinx version >=1.3.2
####################################
# Check for dot. Assume that the dot in $path is the correct program!
# @TODO get a more sophisticated test for this.
AC_CHECK_PROG(HAVE_DOT, dot, yes)
if test "x$HAVE_DOT" = "x"; then
AC_MSG_WARN([dot not found -- You won't be able to display workflows.])
fi
# put these in a single AC_OUTPUT command so config.status is not
# called multiple times.
AC_OUTPUT([admit_start.csh admit_start.sh runadmit])