forked from dbry/WavPack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
138 lines (116 loc) · 3.94 KB
/
configure.ac
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
# wavpack 4.70.0 configure.ac
AC_INIT(wavpack, 4.70.0, [email protected])
AM_INIT_AUTOMAKE(wavpack, 4.70.0, [email protected])
AC_CONFIG_SRCDIR([src/pack.c])
AM_MAINTAINER_MODE
LIBWAVPACK_MAJOR=4
LIBWAVPACK_MINOR=70
LIBWAVPACK_MICRO=0
LIBWAVPACK_VERSION_STRING=$LIBWAVPACK_MAJOR.$LIBWAVPACK_MINOR.$LIBWAVPACK_MICRO
AC_DEFINE_UNQUOTED(LIBWAVPACK_MAJOR, $LIBWAVPACK_MAJOR, [libwavpack major version])
AC_DEFINE_UNQUOTED(LIBWAVPACK_MINOR, $LIBWAVPACK_MINOR, [libwavpack minor version])
AC_DEFINE_UNQUOTED(LIBWAVPACK_MICRO, $LIBWAVPACK_MICRO, [libwavpack micro version])
AC_DEFINE_UNQUOTED(LIBWAVPACK_VERSION_STRING, "$LIBWAVPACK_VERSION_STRING", [libwavpack version string])
# set libtool versioning
# +1 : 0 : +1 == new interface that does not break old one.
# +1 : 0 : 0 == changed/removed an interface. Breaks old apps.
# ? : +1 : ? == internal changes that doesn't break anything.
# CURRENT : REVISION : AGE
LT_CURRENT=2
LT_REVISION=5
LT_AGE=1
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# Check for os version
VERSION_OS=$(uname -s)
AC_DEFINE_UNQUOTED(VERSION_OS, "$VERSION_OS", [os version])
# Check for processor characteristics
AC_C_BIGENDIAN(AC_DEFINE([HIGHFIRST], [1], [big-endian machine]))
# Checks for programs.
AC_PROG_CC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AM_PROG_CC_C_O
AC_HEADER_STDC
# Checks for libraries.
AC_CHECK_LIBM
AC_SUBST(LIBM)
# Check for large files support
AC_SYS_LARGEFILE
# Check if cross-compiling on mingw
AC_MINGW32
if test "x$MINGW32" != "xyes" ; then
# Check for iconv
AC_ARG_WITH(iconv, [[ --with-iconv[=DIR] add ICONV support [yes]]])
if test "$with_iconv" = "no" ; then
AC_MSG_ERROR([[Sorry, you can't deactivate iconv.]])
else
if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
ICONV_CFLAGS="${CPPFLAGS} -I$with_iconv/include"
ICONV_LIBS="-L$with_iconv/lib"
fi
AC_CHECK_HEADER(iconv.h,
AC_MSG_CHECKING(for iconv)
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for iconv in -liconv)
old_ldflags="${LDFLAGS}"
old_libs="${LIBS}"
LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
LIBS="${LIBS} -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1
ICONV_LIBS="${ICONV_LIBS} -liconv"
ICONV="-liconv"],[
AC_MSG_ERROR([[Can't find iconv libraries.]])])
LDFLAGS=$old_ldflags
LIBS=$old_libs
]),
AC_MSG_ERROR([[Can't find iconv headers.]]))
fi
AC_SUBST(ICONV_LIBS)
AC_SUBST(ICONV)
fi
AC_ARG_ENABLE(mmx, [[ --enable-mmx enable MMX optimizations [default=no]]])
if test "x$enable_mmx" = "xyes" ; then
AC_DEFINE([OPT_MMX], 1, [MMX optimization])
$CC $CFLAGS -mmmx -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && CFLAGS="-mmmx $CFLAGS"
fi
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],enable_man=yes,
enable_man=no)
if test "${enable_man}" != no; then
dnl
dnl Check for xsltproc
dnl
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
enable_man=no
fi
dnl check for DocBook DTD and stylesheets in the local catalog.
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
[DocBook XML DTD V4.1.2],,enable_man=no)
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
[DocBook XSL Stylesheets],,enable_man=no)
fi
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
AC_CONFIG_FILES(
Makefile
wavpack.pc
src/Makefile
include/Makefile
cli/Makefile
man/Makefile)
AC_OUTPUT