-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
142 lines (115 loc) · 3.32 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
# Autoconf configuration for ckyfd
#
AC_INIT([ckyfd],[0.0.1],[[email protected]],[ckyfd])
PACKAGE=ckyfd
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR([build])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([include/auto_config.h])
AC_PREFIX_DEFAULT(`pwd`/install)
AC_MSG_RESULT("prefix is $prefix.")
AC_ARG_ENABLE(debug,
[ --enable-debug=val remove optimization option gcc, val=yes or no],
[case "${enableval}" in
yes) debug=true CFLAGS="-g";;
no) debug=false CFLAGS="-g -O2" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=false])
AM_CONDITIONAL(DEBUG,test x"$debug" = xtrue)
AC_ARG_ENABLE(gprof,
[ --enable-gprof=val using gnu profiler, val=yes or no, use exclusively with --enable-pprof],
[case "${enableval}" in
yes) gprof=true CFLAGS="-g -pg";;
no) gprof=false CFLAGS="-g -O2" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gprof) ;;
esac],[gprof=false])
AM_CONDITIONAL(GPROF,test x"$gprof" = xtrue)
AC_ARG_WITH(kyfd,
AC_HELP_STRING(
[--with-kyfd=DIRECTORY],
[set kyfd directory path]),
[kyfd="$withval"],
[path=/home/kyfd/install
if test -f ${path}/include/decoder.h ; then
kyfd_path=${path}
else
AC_MSG_ERROR(Cannot locate kyfd include header. You should either use --with-kyfd option or install kyfd in ${path})
fi
kyfd=${kyfd_path}
]
)
AC_MSG_RESULT(found kyfd in $kyfd.);
AC_SUBST(kyfd)
AC_ARG_ENABLE(python,
[ --enable-python=val make python wrapper library, val=yes or no],
[case "${enableval}" in
yes) python=true ;;
no) python=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
esac],[python=false])
AM_CONDITIONAL(PYTHON_USE,test x"$python" = xtrue)
AM_COND_IF( [PYTHON_USE],[
AC_ARG_WITH(pythoninc,
AC_HELP_STRING(
[--with-pythoninc=DIRECTORY],
[set python include directory path]),
[pythoninc="$withval"],
[path=/usr/include/python2.7
if test -f ${path}/Python.h ; then
python_header=${path}
else
AC_MSG_ERROR(Cannot locate python include header. You should either use --with-pythoninc option or place python header in ${path})
fi
pythoninc=${python_header}
]
)
AC_MSG_RESULT(found python header in $pythoninc.);
AC_SUBST(pythoninc) ] )
dnl ---------------------------------------------------------------------------
AH_TOP([#ifndef AUTO_CONFIG_H
#define AUTO_CONFIG_H 1
])
AH_BOTTOM([
#endif /* AUTO_CONFIG_H */
])
AH_VERBATIM([1_NEAR_TOP__],[
/* example */
#undef CKYFD_HOME
])
AC_DEFINE(CKYFD_HOME,`pwd`)
dnl ---------------------------------------------------------------------------
dnl Checks for programs
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
dnl should fail configure when followings headers does not exist.
AC_CHECK_HEADERS( \
string.h stdlib.h stdio.h sys/types.h sys/stat.h fcntl.h \
getopt.h \
)
AC_CHECK_FUNCS( \
getopt \
getopt_long \
)
CKYFD_RELEASE_DATE=`LANG=C date "+%a %b %d %T %Z %Y"`
AC_SUBST(PACKAGE)
AC_SUBST(CKYFD_RELEASE_DATE)
AC_SUBST(LIBTOOL)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(AM_LIBTOOLFLAGS)
AC_CONFIG_FILES([
Makefile
src/Makefile
include/Makefile
])
AM_COND_IF( [PYTHON_USE], [
AC_CONFIG_FILES([
wrapper/python/Makefile
wrapper/python/test.py
wrapper/python/test_rouzeta.py
])] )
AC_OUTPUT