-
Notifications
You must be signed in to change notification settings - Fork 12
/
configure.ac
118 lines (97 loc) · 3.28 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
AC_PREREQ(2.69)
AC_INIT([SNOPT-APIs],[2.0.0],[[email protected]],[snopt-interfaces])
AC_CONFIG_SRCDIR([src/snoptProblem.cpp])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config/m4])
AC_PREFIX_DEFAULT([`pwd`])
user_CFLAGS=${CFLAGS}
user_CXXFLAGS=${CXXFLAGS}
user_LDFLAGS=${LDFLAGS}
# Libtool
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
# Check compilers.
AC_PROG_INSTALL
AC_PROG_FC
AC_PROG_CC
AC_PROG_CXX
AC_FC_LIBRARY_LDFLAGS
AC_SUBST([FCLIBS])
AC_FC_MODULE_OUTPUT_FLAG([],
[ case $FC in
*nagfor* ) FC_MODOUT="-mdir ";;
esac
])
AC_FC_MODULE_FLAG([],
[ case $FC in
*nagfor* ) FC_MODINC="-mdir ";;
esac
])
AC_SUBST(FC_MODOUT)
AC_SUBST(FC_MODINC)
dnl ----------------------------------------------------------------------------
# BLAS library.
AC_ARG_WITH([blas],
[AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])],
[with_blas=${withval} ], [ blas=no ] )
case $with_blas in
yes | "" | no) blas=no ;;
-* | */* | *.a | *.so | *.so.* | *.o)
blas=yes; BLAS_LIBS="$with_blas" ;;
*)
blas=yes; BLAS_LIBS="-l$with_blas" ;;
esac
AC_SUBST([blas])
AC_SUBST([BLAS_LIBS])
dnl ----------------------------------------------------------------------------
AC_ARG_WITH([snopt],
[AS_HELP_STRING([--with-snopt=/path/to/snopt], [location of SNOPT library])],
[snopt_dir=${withval}; ], [ snopt_dir=${libdir}; ] )
AC_SUBST([snopt_dir])
dnl ----------------------------------------------------------------------------
AC_ARG_WITH([c],[AS_HELP_STRING([--with-c, --without-c],
[Compile C interfaces for SNOPT (default: with-c)]) ],
[with_c=no;], [with_c=yes;] )
AC_MSG_CHECKING([for C interface])
AC_MSG_RESULT([${with_c}])
AC_ARG_WITH([cpp],
[AS_HELP_STRING([--with-cpp, --without-cpp],
[Compile C++ interfaces for SNOPT (default: with-cpp)]) ],
[with_cpp=no;], [with_cpp=yes;] )
AC_MSG_CHECKING([for C++ interface])
AC_MSG_RESULT([${with_cpp}])
dnl ----------------------------------------------------------------------------
CFLAGS="${user_CFLAGS}"
CXXFLAGS="${user_CXXFLAGS}"
LDFLAGS="${user_LDFLAGS}"
AC_SUBST([CFLAGS])
AC_SUBST([CXXFLAGS])
AC_OUTPUT([Makefile])
echo ""
echo "The SNOPT interface libraries will be compiled:"
echo " C support? ${with_c}"
echo " C++ support? ${with_cpp}"
echo ""
echo "Libraries will be installed into ${prefix}/lib"
echo " Shared libraries will be created: ${enable_shared}"
echo " Static libraries will be created: ${enable_static}"
echo ""
echo "SNOPT library location? ${snopt_dir}"
echo ""
echo "Using external BLAS library? ${blas} ${BLAS_LIBS} "
echo ""
echo "To build everything 'make' "
echo "To install the libraries 'make install' "
echo "To build the examples 'make examples' "
if test x"${with_c}" == xyes; then
echo ""
echo "To build the SNOPT C interface 'make snopt_c'"
echo "To install the SNOPT C interface 'make install_c'"
echo "To build the C examples 'make examples_c' "
fi
if test x"${with_cpp}" == xyes; then
echo ""
echo "To build the SNOPT C++ interface 'make snopt_cpp'"
echo "To install the SNOPT C++ interface 'make install_cpp'"
echo "To build the C++ examples 'make examples_cpp' "
fi