-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
122 lines (105 loc) · 4.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
AC_INIT([.])
SHELL=/bin/bash
host_os=$(uname -a);
case $host_os in
*Cygwin*) CYGWINPREFIX=$SYSTEMDRIVE/cygwin;
echo "Detected Cygwin environment";
echo " OS: '$host_os'";
echo " using CYGWINPREFIX=$CYGWINPREFIX";
;;
*) CYGWINPREFIX="";
#echo "Cygwin environment NOT detected: $host_os";
;;
esac
dnl need to also check for basic unix utilities: rm chmod mkdir find etc
dnl see http://www.edwardrosten.com/code/autoconf/ for tips
dnl find and test make utils
AC_PROG_MAKE_SET
dnl find and test the C compiler
AC_PROG_CC
AC_LANG_C
AC_PROG_CXX
AC_HEADER_STDC
AC_PATH_PROG(CAT,cat,AC_MSG_ERROR([echo cat not found - is this a Unix installation?]))
AC_PATH_PROG(CHMOD,chmod,AC_MSG_ERROR([echo chmod not found - is this a Unix installation?]))
AC_PATH_PROG(CP,cp,AC_MSG_ERROR([echo cp not found - is this a Unix installation?]))
AC_PATH_PROG(MV,mv,AC_MSG_ERROR([echo mv not found - is this a Unix installation?]))
AC_PATH_PROG(INSTALL,install,AC_MSG_ERROR([echo mv not found - is this a Unix installation?]))
AC_PATH_PROG(HEAD,head,AC_MSG_ERROR([echo head not found - is this a Unix installation?]))
AC_PATH_PROG(TAR,tar,AC_MSG_ERROR([echo tar not found - is this a Unix installation?]))
AC_PROG_SED(sed)
dnl find perl
AC_PATH_PROG(PERL,perl,AC_MSG_ERROR([echo perl not found - is this a Unix installation?]))
dnl find python
dnl AC_PATH_PROG(PYTHON,python,AC_MSG_ERROR([echo python not found - is this a Unix installation?]))
dnl find make
AC_PATH_PROG(MAKE,make,AC_MSG_ERROR([echo make not found - is this a Unix installation?]))
dnl find matlab
AC_PATH_PROG(MATLAB,matlab,AC_MSG_ERROR([echo Matlab not found. Please install it first!]))
AC_PATH_PROG(MEX,mex,AC_MSG_WARN([echo mex not found - check your MATLAB installation.]))
# set version and user
GITVERSION=$(git log -n 1 --pretty=oneline | perl -ane "@_ = split; print @_[[0]]")
BRANCHNAME=$(git symbolic-ref --short HEAD)
#echo GITVERSION=$GITVERSION
THEVERSION=`head -n 1 ./00-VERSION | sed -e "s/GETVERSIONFROMGIT/$GITVERSION/" -e "s/GETBRANCHNAMEFROMGIT/$BRANCHNAME/" -e "s/USER/$USER/" -e 's/ /_/g'`
#echo THEVERSION=$THEVERSION
# set up installation directories
#AC_ARG_WITH(MAPPlocalLinksDir, [ --with-MAPPlocalLinksDir=ARG (default is $(pwd)/$THEVERSION)])
#if test "$with_MAPPlocalLinksDir" == ""
#then
# #AC_MSG_NOTICE([MAPPlocalLinksDir set to $with_MAPPlocalLinksDir])
# with_MAPPlocalLinksDir="$(pwd)/$THEVERSION"; # AC_MSG_NOTICE([MAPPlocalLinksDir set to default value $with_MAPPlocalLinksDir])
with_MAPPlocalLinksDir="$(pwd)/$THEVERSION"
AC_ARG_WITH(VVimplementation, [ --with-VVimplementation=ARG vecvalder implementation (vv1 or vv2; default is vv2)])
if test "$with_VVimplementation" == ""
then
with_VVimplementation="vv2"; # AC_MSG_NOTICE([VVimplementation set to default value vv2])
fi
AC_PREFIX_DEFAULT("--prefix is NOT USED by MAPP")
#THE_PREFIX=`test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${prefix}"` # "hairy", because ac_default_prefix undocumented
VECVALDER="vecvalder"
UTILS="utils"
MODSPEC="ModSpec-MATLAB"
LOCALMODSPEC="ModSpec/ModSpec-MATLAB-API"
DAEAPI="DAEAPI-MATLAB"
LOCALDAEAPI="DAEAPI"
DOCUMENTATION="Documentation"
A1oDAEAPI="A1oDAEAPI-MATLAB"
A2oDAEAPI="A2oDAEAPI-MATLAB"
STEAM="STEAM"
PPI="STEAM/polynomial-interpolation/matlab"
LOCALA1oDAEAPI="Analyses1-on-DAEAPI"
LOCALA2oDAEAPI="Analyses2-on-DAEAPI"
AC_SUBST(MAPPVERSION, $THEVERSION)
AC_SUBST(BRANCHNAME, $BRANCHNAME)
AC_SUBST(CYGWINPREFIX, $CYGWINPREFIX)
AC_SUBST(MAPPLOCALLINKSDIR, $with_MAPPlocalLinksDir)
AC_SUBST(VVIMPLEMENTATION, $with_VVimplementation)
AC_SUBST(VECVALDER, $VECVALDER)
AC_SUBST(UTILS, $UTILS)
AC_SUBST(MODSPEC, $MODSPEC)
AC_SUBST(LOCALMODSPEC, $LOCALMODSPEC)
AC_SUBST(DAEAPI, $DAEAPI)
AC_SUBST(LOCALDAEAPI, $LOCALDAEAPI)
AC_SUBST(A1oDAEAPI, $A1oDAEAPI)
AC_SUBST(A2oDAEAPI, $A2oDAEAPI)
AC_SUBST(LOCALA1oDAEAPI, $LOCALA1oDAEAPI)
AC_SUBST(LOCALA2oDAEAPI, $LOCALA2oDAEAPI)
AC_SUBST(CONTRIBS, $CONTRIBS)
AC_SUBST(DOCUMENTATION, $DOCUMENTATION)
AC_SUBST(THEVERSION, $THEVERSION)
AC_SUBST(MAPPTOP, `pwd`)
dnl read <each file below>.in and write <each file below>
AC_OUTPUT(Makefile setuppaths_MAPP.m start_MAPP.m)
echo "--------------------------------------------------------------------"
echo "$THEVERSION configured."
echo ""
echo "Local installation (soft links into the git working copy) will be in:"
echo " ${with_MAPPlocalLinksDir}"
echo ""
echo "Next steps:"
echo " $ make installlocallinks"
echo " or just"
echo " $ make"
echo ""
echo "--------------------------------------------------------------------"