-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.in
140 lines (131 loc) · 3.7 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
# Process this file with autoconf to produce a configure script.
AC_INIT(Yate-IPP, 0.0.1)
AC_CONFIG_SRCDIR([README])
AC_PREREQ(2.52)
PACKAGE_RELEASE="1"
PACKAGE_VERSION_MAJOR="${PACKAGE_VERSION%%.*}"
PACKAGE_VERSION_MINOR="${PACKAGE_VERSION#*.}"
PACKAGE_VERSION_MINOR="${PACKAGE_VERSION_MINOR%.*}"
PACKAGE_VERSION_BUILD="${PACKAGE_VERSION##*.}"
PACKAGE_VERSION_RELEASE="$((0+${PACKAGE_RELEASE}))"
AC_SUBST(PACKAGE_VERSION_MAJOR)
AC_SUBST(PACKAGE_VERSION_MINOR)
AC_SUBST(PACKAGE_VERSION_BUILD)
AC_SUBST(PACKAGE_VERSION_RELEASE)
AC_SUBST(PACKAGE_RELEASE)
# We may need the host OS type but avoid the overhead of AC_CANONICAL_SYSTEM
AC_MSG_CHECKING([for local operating system type])
uname_os=`uname -s`
test -x "$uname_os" && uname_os=Unknown
AC_MSG_RESULT([$uname_os])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_AWK
# Check for Yate (required)
YATE_VER=""
YATE_INC=""
YATE_LIB=""
YATE_STR=""
YATE_MOD=""
YATE_SCR=""
YATE_SKN=""
YATE_CFG=""
yc="yate-config"
AC_ARG_WITH(yate,AC_HELP_STRING([--with-yate=DIR],[use Yate from DIR]),[ac_cv_use_yate=$withval],[ac_cv_use_yate=yes])
if [[ "x$ac_cv_use_yate" = "xno" ]]; then
YATE_VER="no"
else
if [[ "x$ac_cv_use_yate" != "xyes" ]]; then
yc="$ac_cv_use_yate/$yc"
YATE_INC="-I$ac_cv_use_yate"
YATE_LIB="-L$ac_cv_use_yate"
fi
AC_MSG_CHECKING([for Yate using $yc])
YATE_VER=`"$yc" --version 2>/dev/null`
YATE_INC="$YATE_INC "`"$yc" --c-all 2>/dev/null`
YATE_LIB="$YATE_LIB "`"$yc" --ld-nostrip 2>/dev/null`
YATE_STR=`"$yc" --ld-strip 2>/dev/null`
YATE_MOD=`"$yc" --modules 2>/dev/null`
YATE_SCR=`"$yc" --scripts 2>/dev/null`
YATE_SKN=`"$yc" --skins 2>/dev/null`
YATE_CFG=`"$yc" --config 2>/dev/null`
if [[ "x$YATE_VER" = "x" ]]; then
YATE_VER="no"
fi
AC_MSG_RESULT([$YATE_VER])
if [[ "x$YATE_VER" = "xno" ]]; then
AC_ERROR([Could not find Yate])
fi
fi
AC_SUBST(YATE_VER)
AC_SUBST(YATE_INC)
AC_SUBST(YATE_LIB)
AC_SUBST(YATE_STR)
AC_SUBST(YATE_MOD)
AC_SUBST(YATE_SCR)
AC_SUBST(YATE_SKN)
AC_SUBST(YATE_CFG)
# Check for IPP (required)
HAS_IPP="no"
IPP_DIR=""
IPP_INC=""
IPP_LIB=""
IPP_7="no"
AC_ARG_WITH(ipp,AC_HELP_STRING([--with-ipp=DIR],[use IPP from DIR]),[ac_cv_use_ipp=$withval],[ac_cv_use_ipp=yes])
if [[ "x$ac_cv_use_ipp" = "xyes" ]]; then
ac_cv_use_ipp=`echo /opt/intel/ipp/*/*`
fi
AC_MSG_CHECKING([for IPP in $ac_cv_use_ipp])
if [[ -f "$ac_cv_use_ipp/include/ipp.h" -a -d "$ac_cv_use_ipp/lib" ]]; then
IPP_DIR="$ac_cv_use_ipp"
IPP_INC="-I$IPP_DIR/include"
# Check for new IPP directories layout
IPP_LIB="-L$IPP_DIR/lib"
if [[ -d "$IPP_DIR/lib/ia32" ]]; then
IPP_7="yes"
IPP_LIB="-L$IPP_DIR/lib/ia32"
fi
if [[ -d "$IPP_DIR/lib/intel64" ]]; then
IPP_7="yes"
IPP_LIB="-L$IPP_DIR/lib/intel64"
fi
HAS_IPP="yes"
fi
AC_MSG_RESULT([$HAS_IPP])
if [[ "x$IPP_DIR" = "x" ]]; then
AC_ERROR([Could not find IPP])
fi
AC_SUBST(IPP_DIR)
AC_SUBST(IPP_INC)
AC_SUBST(IPP_LIB)
IPP_CORE=""
IPP_MERGED="yes"
IPP_SUFFIX=""
IPP_INC_CORE=""
case "$IPP_DIR" in
*/em64t*)
IPP_SUFFIX="em64t"
;;
esac
AC_ARG_WITH(ippcore,AC_HELP_STRING([--with-ippcore=CORE],[use static core]),[ac_cv_use_ippcore=$withval],[ac_cv_use_ippcore=])
if [[ "x$ac_cv_use_ippcore" != "x" ]]; then
if [[ -f "$IPP_DIR/tools/staticlib/ipp_$ac_cv_use_ippcore.h" ]]; then
IPP_CORE="$ac_cv_use_ippcore"
IPP_MERGED="no"
IPP_INC_CORE="-include $IPP_DIR/tools/staticlib/ipp_$ac_cv_use_ippcore.h"
fi
if [[ "x$IPP_CORE" = "x" ]]; then
AC_ERROR([Could not find IPP core '$ac_cv_use_ippcore'])
fi
fi
AC_SUBST(IPP_CORE)
AC_SUBST(IPP_MERGED)
AC_SUBST(IPP_7)
AC_SUBST(IPP_SUFFIX)
AC_SUBST(IPP_INC_CORE)
AC_CONFIG_FILES([yate-ipp.spec
Makefile])
CONFIGURE_FILES=`echo "$ac_config_files config.status config.log" | sed 's/yate-[[^ ]]*\.spec *//'`
AC_SUBST(CONFIGURE_FILES)
AC_OUTPUT