forked from golems/reflex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
171 lines (137 loc) · 5.08 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
169
170
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([reflex], [0.20120504], [ntd@gatech.edu])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_SRCDIR([include/reflex.h])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_FC
m4_ifdef([AX_CXX_HEADER_STDCXX_11],
[AX_CXX_HEADER_STDCXX_11],
[AX_CXX_COMPILE_STDCXX_0X
if test x"$ax_cv_cxx_compile_cxx0x_gxx" = xyes; then CXXFLAGS="$CXXFLAGS -std=gnu++0x"; fi])
# Enable C++11
dnl AC_LANG([C++])
dnl AC_LANG_CPLUSPLUS
m4_ifdef([AX_CXX_HEADER_STDCXX_11],
[AX_CXX_HEADER_STDCXX_11],
[AX_CXX_COMPILE_STDCXX_0X
if test x"$ax_cv_cxx_compile_cxx0x_gxx" = xyes; then CXXFLAGS="$CXXFLAGS -std=gnu++0x"; fi])
# Checks for libraries.
#AC_SEARCH_LIBS([cblas_dgemm],[blas], [true], [echo "Failed: need BLAS library" && exit 1])
#AC_SEARCH_LIBS([dgesvd_],[lapack], [true], [echo "Failed: need LAPACK library" && exit 1])
#AC_SEARCH_LIBS([aa_la_dlsnp],[amino])
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
DX_HTML_FEATURE(ON)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(reflex)
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([memset])
# Default Install Prefix
AS_IF( [test "x$prefix" = xNONE], [prefix=/usr/local] )
# Find amino fortran modules
FCFLAGS="$FCFLAGS -I$prefix/include"
# Enable maximum warnings
AX_CFLAGS_WARN_ALL
dnl APPEND_FLAG( [FLAG] )
dnl Check if FLAG is supported, and if so, add it
m4_ifdef([AX_CHECK_COMPILE_FLAG],
[AC_DEFUN([APPEND_CFLAG],
[AX_CHECK_COMPILE_FLAG([$1], [CFLAGS="$1 $CFLAGS"])])
AC_DEFUN([APPEND_FCFLAG],
[AX_CHECK_COMPILE_FLAG([$1], [FCFLAGS="$1 $FCFLAGS"])])])
m4_ifdef([AX_CHECK_COMPILER_FLAGS],
[AC_DEFUN([APPEND_CFLAG],
[AX_CHECK_COMPILER_FLAGS([$1], [CFLAGS="$1 $CFLAGS"])])
AC_DEFUN([APPEND_FCFLAG],
[AX_CHECK_COMPILER_FLAGS([$1], [FCFLAGS="$1 $FCFLAGS"])])])
APPEND_CFLAG([-Wextra])
APPEND_CFLAG([-Wconversion])
APPEND_CFLAG([-Wpointer-arith])
APPEND_CFLAG([-Wfloat-equal])
APPEND_CFLAG([-Wshadow])
APPEND_CFLAG([-Wwrite-strings])
APPEND_CFLAG([-Wc++-compat])
AC_LANG([Fortran])
APPEND_FCFLAG([-fimplicit-none])
APPEND_FCFLAG([-ffree-line-length-none])
APPEND_FCFLAG([-Wall])
APPEND_FCFLAG([-pedantic])
APPEND_FCFLAG([-Wextra])
APPEND_FCFLAG([-Wconversion])
APPEND_FCFLAG([-Wconversion-extra])
APPEND_FCFLAG([-Wshadow])
APPEND_FCFLAG([-Wimplicit-interface])
APPEND_FCFLAG([-Wimplicit-procedure])
APPEND_FCFLAG([-Wunderflow])
APPEND_FCFLAG([-Warray-temporaries])
APPEND_FCFLAG([-Wtabs])
APPEND_FCFLAG([-Wunused-parameter])
APPEND_FCFLAG([-Wintrinsic-shadow])
AC_CHECK_PROGS([HELP2MAN], [help2man])
AC_CHECK_PROGS([MAN2HTML], [man2html])
AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN != x])
AM_CONDITIONAL([HAVE_MAN2HTML], [test x$MAN2HTML != x])
AC_CHECK_FILE( [$srcdir/doc/man/rfx-trajgen.1], [FOUND_MANPAGES=yes])
AC_CHECK_FILE( [$srcdir/doc/man/rfx-trajgen.html], [FOUND_MANHTML=yes])
AM_CONDITIONAL([HAVE_MANPAGES], [test x$HELP2MAN != x -o x$FOUND_MANPAGES = xyes])
AM_CONDITIONAL([HAVE_MANHTML], [test '(' x$HELP2MAN != x -a x$MAN2HTML != x ')' -o x$FOUND_MANHTML = xyes])
dnl JAVA
AS_IF( [test "x$JAVAPREFIX" = x],
[
AS_IF( [test "x$JAVA" = x], [AC_CHECK_PROGS(JAVA, java kaffe)], )
AS_IF( [test "x$JAVAC" = x], [AC_CHECK_PROGS(JAVAC, javac "gcj -C" jikes guavac)] )
AS_IF( [test "x$JAVAH" = x], [AC_CHECK_PROGS(JAVAH, javah)] )
AS_IF( [test "x$JAR" = x], [AC_CHECK_PROGS(JAR, jar)] )
],
[
AS_IF( [test "x$JAVA" = x], [AC_CHECK_PROGS(JAVA, java kaffe)],
[$JAVAPREFIX] )
AS_IF( [test "x$JAVAC" = x], [AC_CHECK_PROGS(JAVAC, javac "gcj -C" jikes guavac)],
[$JAVAPREFIX] )
AS_IF( [test "x$JAVAH" = x], [AC_CHECK_PROGS(JAVAH, javah)],
[$JAVAPREFIX] )
AS_IF( [test "x$JAR" = x], [AC_CHECK_PROGS(JAR, jar)],
[$JAVAPREFIX] )
]
)
AS_IF([test "x$JAVAC" = "x"],
[BUILD_JAVA=no],
[
BUILD_JAVA=yes
AX_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
JNICPPFLAGS="$JNICPPFLAGS -I$JNI_INCLUDE_DIR"
done
dnl Guess the classpath
AS_IF([test "x$CLASSPATH" = x],
[CLASSPATH=.:$prefix/share/java/\*])
AC_SUBST([CLASSPATH])
])
AC_SUBST([JNICPPFLAGS])
AM_CONDITIONAL([HAVE_JAVAC], [test "x$JAVAC" != x])
dnl TODO: better (any) handling of CLASSPATH variable
AC_CONFIG_FILES([Makefile doc/Makefile])
AC_OUTPUT
AC_MSG_NOTICE([CONFIGURATION SUMMARY])
AC_MSG_NOTICE([=====================])
AC_MSG_NOTICE([PREFIX: $prefix])
AC_MSG_NOTICE([BUILD JAVA LIB: $BUILD_JAVA])
AC_MSG_NOTICE([CLASSPATH: $CLASSPATH])
AC_MSG_NOTICE([CFLAGS: $CFLAGS])
AC_MSG_NOTICE([FCFLAGS: $FCFLAGS])