-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.in
executable file
·142 lines (117 loc) · 3.84 KB
/
configure.in
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
# OpenR2
# MFC/R2 call setup library
# www.libopenr2.org
#
# Moises Silva <moises.silva@gmail.com>
# Copyright (C) 2008 Moises Silva
#
# Package and LT versions are not the same (they can match sometimes though)
# see http://sources.redhat.com/autobook/autobook/autobook_91.html for details
# more info on versioning: http://www.nondot.org/sabre/Mirrored/libtool-2.1a/libtool_6.html#SEC33
AC_INIT([OpenR2], [2.0.0])
m4_include(config/ax_check_real_file.m4)
# final lib name will be: libopenr2-<current - age>,<age>,<revision>.so
OPENR2_LT_CURRENT=5
OPENR2_LT_REVISION=0
OPENR2_LT_AGE=0
AC_SUBST(OPENR2_LT_CURRENT)
AC_SUBST(OPENR2_LT_REVISION)
AC_SUBST(OPENR2_LT_AGE)
# AC_CONFIG_SRCDIR ???
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
# let's default to compile with debugging information
# most users will not even care about it
CFLAGS='-ggdb3 -O0'
CXXFLAGS='-ggdb3 -O0'
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_LANG([C])
if test "${build}" == "${host}"
then
case "${host}" in
x86_64-*)
# X86_64 Linux machines may have both 64 bit and 32 bit libraries. We need to choose the right set
AX_CHECK_REAL_FILE([${prefix}/lib64], libdir='$(exec_prefix)/lib64')
;;
esac
fi
AC_CHECK_LIB([m],[cosf], [], [AC_MSG_FAILURE([library libm is required but not present])])
AC_CHECK_HEADER([math.h],[],[AC_MSG_FAILURE([header math.h is required but not present])])
AC_CHECK_HEADER([pthread.h],[],[AC_MSG_FAILURE([header pthread.h is required but not present])])
AC_CHECK_HEADERS([sys/time.h],[],[])
AC_CHECK_HEADERS([sys/ioctl.h],[],[])
AC_CHECK_HEADERS([fcntl.h],[],[])
AC_DEFUN([AX_GCC_OPTION], [
AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if gcc accepts $1 option])
AS_IF([ test "x$GCC" = "xyes" ],[
AS_IF([ test -z "$3" ],[
ax_gcc_option_test="int main()
{
return 0;
}"
],[
ax_gcc_option_test="$3"
])
# Dump the test program to file
cat <<EOF > conftest.c
$ax_gcc_option_test
EOF
# Dump back the file to the log, useful for debugging purposes
AC_TRY_COMMAND(cat conftest.c 1>&AS_MESSAGE_LOG_FD)
AS_IF([ AC_TRY_COMMAND($CC $2 $1 -c conftest.c 1>&AS_MESSAGE_LOG_FD) ],[
AC_MSG_RESULT([yes])
$4
],[
AC_MSG_RESULT([no])
$5
])
],[
AC_MSG_RESULT([no gcc available])
])
])
AX_GCC_OPTION([-fvisibility=hidden],[],[],[have_visibility=yes],[have_visibility=no])
AM_CONDITIONAL([HAVE_ATTR_VISIBILITY_HIDDEN], [test "x$have_visibility" = xyes])
if [test "x$have_visibility" = xyes]
then
AC_MSG_RESULT([GCC supports -fvisibility and will be used to compile the library])
else
AC_MSG_RESULT([GCC does NOT support -fvisibility and will not used to compile the library])
fi
nozaptel=no
nozaptelzaptel=no
nodahdiuser=no
AC_CHECK_HEADERS([linux/zaptel.h],[],[nozaptel=yes])
AC_CHECK_HEADERS([zaptel/zaptel.h],[],[nozaptelzaptel=yes])
AC_CHECK_HEADERS([dahdi/user.h],[],[nodahdiuser=yes])
if [test "x$nozaptel" = xyes] && [test "x$nozaptelzaptel" = xyes] && [test "x$nodahdiuser" = xyes]
then
AC_MSG_RESULT([Zaptel or DAHDI headers are not present. Zaptel/DAHDI support will not be enabled])
fi
AC_ARG_WITH([r2test], [AS_HELP_STRING([--without-r2test],
[disable the r2test program.])],
[with_r2test=no],
[with_r2test=yes])
AM_CONDITIONAL([WANT_R2TEST], [test "x$with_r2test" = xyes])
if [test "x$with_r2test" = xyes]
then
AC_MSG_RESULT([r2test program will be compiled])
else
AC_MSG_RESULT([r2test program will NOT be compiled])
fi
AC_ARG_WITH([trace-stacks], [AS_HELP_STRING([--with-trace-stacks],
[enable r2's stacks debugging.])],
[],
[with_tracestacks=no])
AM_CONDITIONAL([WANT_OR2_TRACE_STACKS], [test "x$with_tracestacks" != xno])
if [test "x$svnversioncommand" = "x"]
then
openr2_revision="(release)"
else
openr2_revision="svnversion -n"
fi
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT