-
Notifications
You must be signed in to change notification settings - Fork 57
/
configure.in
104 lines (95 loc) · 2.27 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(viterbi27.c)
AC_CONFIG_HEADER(config.h)
SO_NAME=3
VERSION=3.0.0
AC_SUBST(SO_NAME)
AC_SUBST(VERSION)
dnl Checks for programs.
AC_PROG_CC
if test $GCC != "yes"
then
AC_MSG_ERROR([Need GNU C compiler])
fi
dnl Checks for libraries.
AC_CHECK_LIB(c, malloc)
dnl Checks for header files.
AC_CHECK_HEADERS(getopt.h stdio.h stdlib.h memory.h string.h)
if test -z "$HAVE_stdio.h"
then
AC_MSG_ERROR([Need stdio.h!])
fi
if test -z "$HAVE_stdlib.h"
then
AC_MSG_ERROR([Need stdlib.h!])
fi
if test -z "$HAVE_stdlib.h"
then
AC_MSG_ERROR([Need memory.h!])
fi
if test -z "$HAVE_string.h"
then
AC_MSG_ERROR([Need string.h])
fi
AC_PROG_RANLIB
AN_MAKEVAR([AS], [AC_PROG_AS])
AN_PROGRAM([as], [AC_PROG_AS])
AC_DEFUN([AC_PROG_AS], [AC_CHECK_TOOL(AS, as, :)])
AC_PROG_AS
AN_MAKEVAR([AR], [AC_PROG_AR])
AN_PROGRAM([ar], [AC_PROG_AR])
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
AC_PROG_AR
AC_CANONICAL_SYSTEM
case $target_cpu in
i386|i486|i586|i686)
ARCH_OPTION="-march=$target_cpu"
MLIBS="viterbi27_mmx.o mmxbfly27.o viterbi27_sse.o ssebfly27.o viterbi27_sse2.o sse2bfly27.o \
viterbi29_mmx.o mmxbfly29.o viterbi29_sse.o ssebfly29.o viterbi29_sse2.o sse2bfly29.o \
viterbi39_sse2.o viterbi39_sse.o viterbi39_mmx.o \
viterbi615_mmx.o viterbi615_sse.o viterbi615_sse2.o \
dotprod_mmx.o dotprod_mmx_assist.o \
dotprod_sse2.o dotprod_sse2_assist.o \
peakval_mmx.o peakval_mmx_assist.o \
peakval_sse.o peakval_sse_assist.o \
peakval_sse2.o peakval_sse2_assist.o \
sumsq.o sumsq_port.o \
sumsq_sse2.o sumsq_sse2_assist.o \
sumsq_mmx.o sumsq_mmx_assist.o \
cpu_features.o cpu_mode_x86.o"
;;
powerpc*)
ARCH_OPTION="-fno-common -faltivec"
MLIBS="viterbi27_av.o viterbi29_av.o viterbi39_av.o viterbi615_av.o \
encode_rs_av.o \
dotprod_av.o sumsq_av.o peakval_av.o cpu_mode_ppc.o"
;;
x86_64*)
MLIBS="cpu_mode_unknown.o"
;;
*)
MLIBS="cpu_mode_unknown.o"
;;
esac
case $target_os in
darwin*)
SH_LIB=libfec.dylib
REBIND=""
;;
*)
SH_LIB=libfec.so
REBIND=ldconfig
;;
esac
if test "$target" != "$build"
then
echo "skipping ldconfig for cross-compiling"
REBIND=""
fi
AC_SUBST(SH_LIB)
AC_SUBST(REBIND)
AC_SUBST(MLIBS)
AC_SUBST(ARCH_OPTION)
dnl Checks for library functions.
AC_CHECK_FUNCS(getopt_long memset memmove)
AC_OUTPUT(makefile)