Bill Yi | 4e213d5 | 2015-06-23 13:53:11 -0700 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT(viterbi27.c) |
| 3 | AC_CONFIG_HEADER(config.h) |
| 4 | SO_NAME=3 |
| 5 | VERSION=3.0.0 |
| 6 | AC_SUBST(SO_NAME) |
| 7 | AC_SUBST(VERSION) |
| 8 | |
| 9 | dnl Checks for programs. |
| 10 | AC_PROG_CC |
| 11 | if test $GCC != "yes" |
| 12 | then |
| 13 | AC_MSG_ERROR([Need GNU C compiler]) |
| 14 | fi |
| 15 | dnl Checks for libraries. |
| 16 | AC_CHECK_LIB(c, malloc) |
| 17 | |
| 18 | dnl Checks for header files. |
| 19 | AC_CHECK_HEADERS(getopt.h stdio.h stdlib.h memory.h string.h) |
| 20 | if test -z "$HAVE_stdio.h" |
| 21 | then |
| 22 | AC_MSG_ERROR([Need stdio.h!]) |
| 23 | fi |
| 24 | if test -z "$HAVE_stdlib.h" |
| 25 | then |
| 26 | AC_MSG_ERROR([Need stdlib.h!]) |
| 27 | fi |
| 28 | if test -z "$HAVE_stdlib.h" |
| 29 | then |
| 30 | AC_MSG_ERROR([Need memory.h!]) |
| 31 | fi |
| 32 | if test -z "$HAVE_string.h" |
| 33 | then |
| 34 | AC_MSG_ERROR([Need string.h]) |
| 35 | fi |
| 36 | |
| 37 | AC_CANONICAL_SYSTEM |
| 38 | case $target_cpu in |
| 39 | i386|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 | ;; |
| 55 | powerpc*) |
| 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= |
| 63 | esac |
| 64 | case $target_os in |
| 65 | darwin*) |
| 66 | SH_LIB=libfec.dylib |
| 67 | REBIND="" |
| 68 | ;; |
| 69 | *) |
| 70 | SH_LIB=libfec.so |
| 71 | REBIND=ldconfig |
| 72 | ;; |
| 73 | esac |
| 74 | AC_SUBST(SH_LIB) |
| 75 | AC_SUBST(REBIND) |
| 76 | AC_SUBST(MLIBS) |
| 77 | AC_SUBST(ARCH_OPTION) |
| 78 | |
| 79 | |
| 80 | dnl Checks for library functions. |
| 81 | AC_CHECK_FUNCS(getopt_long memset memmove) |
| 82 | |
| 83 | AC_OUTPUT(makefile) |