forked from rwogburn/gcp-arcfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
126 lines (103 loc) · 3.57 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
# Add the static library to configure.ac
AC_PREREQ([2.60])
AC_INIT([arcfile], [0.1], [rwogburn@gmail.com])
AC_CONFIG_SRCDIR([src/lib/readarc.c])
# AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
# Checks for programs. These may set default variables, such as CFLAGS
AC_PROG_CPP
AC_PROG_CC_C99
AC_PROG_RANLIB
# Use the C language and compiler for the following checks
AC_LANG([C])
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdio.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# --------------------------------------------
# Check if we should build the binary executables
# --------------------------------------------
AC_ARG_ENABLE(
[bin],
[ --enable-bin Enable build of binary executables (default: enabled)],
[case "${enableval}" in
yes) build_bin=yes ;;
no) build_bin=no ;;
*) AC_MSG_ERROR([bad value of ${enableval} for --enable-bin option]) ;;
esac],
build_bin=yes)
AM_CONDITIONAL(BUILD_BIN, test x"$build_bin" = xyes)
# --------------------------------------------
# Check if we should build python extension
# --------------------------------------------
AC_PATH_PROG(PYTHON, python)
AM_CONDITIONAL(HAVE_PYTHON, test x"$PYTHON" != x)
AC_ARG_ENABLE(
[python],
[ --enable-python Enable build of python extension (default: disabled)],
[case "${enableval}" in
yes) python_ext=yes ;;
no) python_ext=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
esac],
python_ext=no)
if test x"$python_ext" = xyes; then
if test x"$PYTHON" = x; then
AC_MSG_ERROR([Can't build python extension, as python executable could not be found])
fi
CFLAGS="$CFLAGS -fPIC"
# AC_PYTHON_DEVEL
fi
AM_CONDITIONAL(BUILD_PYTHON_EXTENSION, test x"$python_ext" = xyes)
# --------------------------------------------
# Check if we should build octave extension
# --------------------------------------------
AC_PATH_PROG(MKOCTFILE, mkoctfile)
AM_CONDITIONAL(HAVE_MKOCTFILE, test x"$MKOCTFILE" != x)
AC_ARG_ENABLE(
[octave],
[ --enable-octave Enable build of octave extension (default: disabled)],
[case "${enableval}" in
yes) octave_ext=yes ;;
no) octave_ext=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-octave option]) ;;
esac],
octave_ext=no)
if test x"$octave_ext" = xyes; then
if test x"$MKOCTFILE" = x; then
AC_MSG_ERROR([Can't build octave extension, as mkoctfile executable could not be found])
fi
# AC_OCTAVE_DEVEL
fi
AM_CONDITIONAL(BUILD_OCTAVE_EXTENSION, test x"$octave_ext" = xyes)
# --------------------------------------------
# Check if we should build matlab extension
# --------------------------------------------
AC_PATH_PROG(MATLABMEX, mex)
AM_CONDITIONAL(HAVE_MATLABMEX, test x"$MATLABMEX" != x)
AC_ARG_ENABLE(
[matlab],
[ --enable-matlab Enable build of matlab extension (default: disabled)],
[case "${enableval}" in
yes) mex_ext=yes ;;
no) mex_ext=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-matlab option]) ;;
esac],
mex_ext=no)
if test x"$mex_ext" = xyes; then
if test x"$MATLABMEX" = x; then
AC_MSG_ERROR([Can't build Matlab extension, as mex executable could not be found])
fi
# AC_MATLAB_DEVEL
fi
AM_CONDITIONAL(BUILD_MATLAB_EXTENSION, test x"$mex_ext" = xyes)
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/lib/Makefile
src/bin/Makefile
oct_ext/Makefile
py_ext/Makefile
mex_ext/Makefile])
AC_OUTPUT