blob: 4e4110b7e4992dbbc3cef03609f9212a3a86e594 [file] [log] [blame]
Bill Yi4e213d52015-06-23 13:53:11 -07001dnl Process this file with autoconf to produce a configure script.
2AC_INIT(viterbi27.c)
3AC_CONFIG_HEADER(config.h)
4SO_NAME=3
5VERSION=3.0.0
6AC_SUBST(SO_NAME)
7AC_SUBST(VERSION)
8
9dnl Checks for programs.
10AC_PROG_CC
11if test $GCC != "yes"
12then
13 AC_MSG_ERROR([Need GNU C compiler])
14fi
15dnl Checks for libraries.
16AC_CHECK_LIB(c, malloc)
17
18dnl Checks for header files.
19AC_CHECK_HEADERS(getopt.h stdio.h stdlib.h memory.h string.h)
20if test -z "$HAVE_stdio.h"
21then
22 AC_MSG_ERROR([Need stdio.h!])
23fi
24if test -z "$HAVE_stdlib.h"
25then
26 AC_MSG_ERROR([Need stdlib.h!])
27fi
28if test -z "$HAVE_stdlib.h"
29then
30 AC_MSG_ERROR([Need memory.h!])
31fi
32if test -z "$HAVE_string.h"
33then
34 AC_MSG_ERROR([Need string.h])
35fi
36
37AC_CANONICAL_SYSTEM
38case $target_cpu in
39i386|i486|i586|i686)
40 ARCH_OPTION="-march=$target_cpu"
41 MLIBS="viterbi27_mmx.o mmxbfly27.o viterbi27_sse.o ssebfly27.o viterbi27_sse2.o sse2bfly27.o \
42 viterbi29_mmx.o mmxbfly29.o viterbi29_sse.o ssebfly29.o viterbi29_sse2.o sse2bfly29.o \
43 viterbi39_sse2.o viterbi39_sse.o viterbi39_mmx.o \
44 viterbi615_mmx.o viterbi615_sse.o viterbi615_sse2.o \
45 dotprod_mmx.o dotprod_mmx_assist.o \
46 dotprod_sse2.o dotprod_sse2_assist.o \
47 peakval_mmx.o peakval_mmx_assist.o \
48 peakval_sse.o peakval_sse_assist.o \
49 peakval_sse2.o peakval_sse2_assist.o \
50 sumsq.o sumsq_port.o \
51 sumsq_sse2.o sumsq_sse2_assist.o \
52 sumsq_mmx.o sumsq_mmx_assist.o \
53 cpu_features.o cpu_mode_x86.o"
54 ;;
55powerpc*)
56 ARCH_OPTION="-fno-common -faltivec"
57 MLIBS="viterbi27_av.o viterbi29_av.o viterbi39_av.o viterbi615_av.o \
58 encode_rs_av.o \
59 dotprod_av.o sumsq_av.o peakval_av.o cpu_mode_ppc.o"
60 ;;
61*)
62 MLIBS=
63esac
64case $target_os in
65darwin*)
66 SH_LIB=libfec.dylib
67 REBIND=""
68 ;;
69*)
70 SH_LIB=libfec.so
71 REBIND=ldconfig
72 ;;
73esac
74AC_SUBST(SH_LIB)
75AC_SUBST(REBIND)
76AC_SUBST(MLIBS)
77AC_SUBST(ARCH_OPTION)
78
79
80dnl Checks for library functions.
81AC_CHECK_FUNCS(getopt_long memset memmove)
82
83AC_OUTPUT(makefile)