| 1 |
dnl Process this file with autoconf to produce a configure script. |
| 2 |
AC_INIT(libdv/parse.c) |
| 3 |
dnl AC_CONFIG_AUX_DIR(config) |
| 4 |
AM_CONFIG_HEADER(config.h) |
| 5 |
|
| 6 |
RPM_RELEASE=1 |
| 7 |
AC_CANONICAL_HOST |
| 8 |
AC_CANONICAL_TARGET |
| 9 |
AM_INIT_AUTOMAKE(libdv, 1.0.0) |
| 10 |
|
| 11 |
AM_MAINTAINER_MODE |
| 12 |
AC_LIBTOOL_PICMODE(no) |
| 13 |
|
| 14 |
dnl Checks for programs. |
| 15 |
|
| 16 |
AC_SUBST(CFLAGS) |
| 17 |
AC_PROG_CC |
| 18 |
AM_PROG_AS |
| 19 |
AS="${CC}" # stupid automake bug |
| 20 |
|
| 21 |
dnl CPPFLAGS=-I'$(top_srcdir)'/src |
| 22 |
|
| 23 |
dnl Add -Wall if gcc |
| 24 |
if test "$GCC" = "yes"; then |
| 25 |
CFLAGS="$CFLAGS -Wall" |
| 26 |
fi |
| 27 |
|
| 28 |
AH_TEMPLATE([_GNU_SOURCE], |
| 29 |
[Define to enable GNU extensions of glibc, notably large file support]) |
| 30 |
|
| 31 |
AH_TEMPLATE([YUV_420_USE_YV12], |
| 32 |
[Define to 1 to use planar YUV format for 420 blocks in IEC PAL]) |
| 33 |
|
| 34 |
AH_TEMPLATE([ARCH_X86], |
| 35 |
[Define as 1 if host is an IA32]) |
| 36 |
|
| 37 |
AH_TEMPLATE([ARCH_X86_64], |
| 38 |
[Define as 1 if host is an AMD64]) |
| 39 |
|
| 40 |
AH_TEMPLATE([DEBUG], |
| 41 |
[Define to indicate DEBUGGING is enabled possibly with a level]) |
| 42 |
|
| 43 |
AH_TEMPLATE([HAVE_SDL], |
| 44 |
[Define as 1 if you have libsdl]) |
| 45 |
|
| 46 |
AH_TEMPLATE([HAVE_GTK], |
| 47 |
[Define as 1 if you have gtk]) |
| 48 |
|
| 49 |
AH_TEMPLATE([HAVE_LIBXV], |
| 50 |
[Define if you have the `Xv' library (-lXv).]) |
| 51 |
|
| 52 |
AC_DEFINE(_GNU_SOURCE) |
| 53 |
|
| 54 |
AC_PROG_INSTALL |
| 55 |
AC_PROG_LIBTOOL |
| 56 |
|
| 57 |
use_asm=: |
| 58 |
arch_x86=false |
| 59 |
arch_x86_64=false |
| 60 |
|
| 61 |
AC_ARG_ENABLE(asm, |
| 62 |
[ --disable-asm disable use of architecture specific assembly code], |
| 63 |
[ if test "$enableval" = "no"; then |
| 64 |
use_asm=false |
| 65 |
fi |
| 66 |
]) |
| 67 |
|
| 68 |
use_sdl=false |
| 69 |
AC_ARG_ENABLE(sdl, |
| 70 |
[ --enable-sdl enable use of SDL for display], |
| 71 |
[ if test "$enableval" = "yes"; then |
| 72 |
use_sdl=: |
| 73 |
fi |
| 74 |
]) |
| 75 |
|
| 76 |
use_gtk=: |
| 77 |
AC_ARG_ENABLE(gtk, |
| 78 |
[ --disable-gtk disable use of gtk for display], |
| 79 |
[ if test "$enableval" = "no"; then |
| 80 |
use_gtk=false |
| 81 |
fi |
| 82 |
]) |
| 83 |
|
| 84 |
use_xv=: |
| 85 |
AC_ARG_ENABLE(xv, |
| 86 |
[ --disable-xv disable use of XVideo extension for display], |
| 87 |
[ if test "$enableval" = "no"; then |
| 88 |
use_xv=false |
| 89 |
fi |
| 90 |
]) |
| 91 |
|
| 92 |
AC_ARG_ENABLE(gprof, |
| 93 |
[ --enable-gprof enable compiler options for gprof profiling], |
| 94 |
[ if test "$enableval" = "yes"; then |
| 95 |
CFLAGS="$CFLAGS -g -pg" |
| 96 |
fi |
| 97 |
]) |
| 98 |
|
| 99 |
if $use_asm; then |
| 100 |
case "$host_cpu" in |
| 101 |
i?86) |
| 102 |
arch_x86=true |
| 103 |
AC_DEFINE(ARCH_X86) |
| 104 |
;; |
| 105 |
x86_64) |
| 106 |
arch_x86_64=true |
| 107 |
AC_DEFINE(ARCH_X86_64) |
| 108 |
;; |
| 109 |
*) |
| 110 |
;; |
| 111 |
esac |
| 112 |
fi |
| 113 |
|
| 114 |
AC_ARG_WITH(pal-yuv, |
| 115 |
[ --with-pal-yuv=(YV12|YUY2) Select YUV format for IEC PAL (YUY2 by default) ], |
| 116 |
[ |
| 117 |
case "$with_pal_yuv" in |
| 118 |
YV12) |
| 119 |
AC_MSG_RESULT(YV12) |
| 120 |
AC_DEFINE(YUV_420_USE_YV12) |
| 121 |
;; |
| 122 |
*) |
| 123 |
AC_MSG_RESULT(YUY2) |
| 124 |
;; |
| 125 |
esac |
| 126 |
] |
| 127 |
) |
| 128 |
|
| 129 |
AC_MSG_CHECKING(whether to enable debugging) |
| 130 |
AC_ARG_WITH(debug, |
| 131 |
[ --with-debug[=level] Enable debugging. |
| 132 |
--without-debug Disable debugging (default). ], |
| 133 |
[ |
| 134 |
case "$with_debug" in |
| 135 |
no) |
| 136 |
AC_MSG_RESULT(no) |
| 137 |
;; |
| 138 |
yes) |
| 139 |
AC_MSG_RESULT(yes) |
| 140 |
AC_DEFINE(DEBUG) |
| 141 |
CFLAGS="$CFLAGS -g" |
| 142 |
;; |
| 143 |
*) |
| 144 |
AC_MSG_RESULT(DEBUG=$with_debug) |
| 145 |
AC_DEFINE_UNQUOTED(DEBUG,$with_debug) |
| 146 |
CFLAGS="$CFLAGS -g" |
| 147 |
;; |
| 148 |
esac |
| 149 |
], |
| 150 |
[ AC_MSG_RESULT(default=yes) |
| 151 |
AC_DEFINE(DEBUG) |
| 152 |
CFLAGS="$CFLAGS -g" |
| 153 |
] |
| 154 |
) |
| 155 |
|
| 156 |
|
| 157 |
AM_CONDITIONAL(HOST_X86, test x$arch_x86 = xtrue) |
| 158 |
AM_CONDITIONAL(HOST_X86_64, test x$arch_x86_64 = xtrue) |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
dnl Checks for libraries. |
| 163 |
have_gtk="false" |
| 164 |
if $use_gtk; then |
| 165 |
REQUIRES='glib >= 1.2.4 gtk+ >= 1.2.4' |
| 166 |
PKG_CHECK_MODULES(GTK,$REQUIRES,have_gtk="true",have_gtk="false") |
| 167 |
AC_DEFINE(HAVE_GTK) |
| 168 |
fi |
| 169 |
|
| 170 |
AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xtrue) |
| 171 |
|
| 172 |
dnl used in Makefile.am |
| 173 |
AC_SUBST(GTK_CFLAGS) |
| 174 |
AC_SUBST(GTK_LIBS) |
| 175 |
|
| 176 |
if $use_sdl; then |
| 177 |
AM_PATH_SDL(1.1.6, |
| 178 |
[ |
| 179 |
AC_DEFINE(HAVE_SDL) |
| 180 |
]) |
| 181 |
fi |
| 182 |
|
| 183 |
if [ $use_gtk && $use_xv ]; then |
| 184 |
AC_CHECK_LIB(Xv, XvQueryAdaptors, |
| 185 |
[AC_DEFINE(HAVE_LIBXV) |
| 186 |
AC_SUBST(XV_LIB) |
| 187 |
XV_LIB='-lXv' |
| 188 |
], |
| 189 |
[AC_MSG_ERROR([Could not find Xv Lib])], |
| 190 |
$GTK_LIBS |
| 191 |
) |
| 192 |
fi |
| 193 |
|
| 194 |
|
| 195 |
dnl ********************************************************************* |
| 196 |
dnl Check for the pthread lib |
| 197 |
dnl |
| 198 |
AC_SUBST(PTHREAD_LIBS) |
| 199 |
AC_CHECK_LIB(pthread, pthread_create, [ PTHREAD_LIBS="-lpthread" ],,) |
| 200 |
|
| 201 |
OS_ARCH=`uname -s | sed -e 's|/|_|g'` |
| 202 |
# FreeBSD and OpenBSD have neither -lpthread nor integrated pthreads in libc. |
| 203 |
# Instead -pthread is used to the compiler/linker to get pthreads working right. |
| 204 |
if test x$OS_ARCH = xFreeBSD -o x$OS_ARCH = xOpenBSD; then |
| 205 |
CFLAGS="$CFLAGS -pthread" |
| 206 |
CXXFLAGS="$CXXFLAGS -pthread" |
| 207 |
fi |
| 208 |
|
| 209 |
|
| 210 |
AC_CHECK_LIB(m, sqrt) |
| 211 |
|
| 212 |
dnl Don't bother with popt on non-gcc build, because we make heavy use of |
| 213 |
dnl gcc struct initialization extension in our popt code. (Could be fixed) |
| 214 |
REQUIRES_NOPKGCONFIG="" |
| 215 |
if test "$GCC" = "yes"; then |
| 216 |
AC_CHECK_LIB(popt, poptGetContext, |
| 217 |
[ |
| 218 |
POPT_LIB="-lpopt" |
| 219 |
AC_DEFINE(HAVE_LIBPOPT, 1, [Define if you have the 'popt' library]) |
| 220 |
], |
| 221 |
[ |
| 222 |
AC_MSG_WARN(playdv needs the popt package for command line parsing. |
| 223 |
The source archive for popt is available at: |
| 224 |
ftp://ftp.redhat.com/pub/redhat/code/popt) |
| 225 |
]) |
| 226 |
fi |
| 227 |
AC_SUBST(POPT_LIB) |
| 228 |
AC_SUBST(REQUIRES_NOPKGCONFIG) |
| 229 |
|
| 230 |
dnl Checks for header files. |
| 231 |
AC_PATH_X |
| 232 |
AC_HEADER_STDC |
| 233 |
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h linux/videodev.h sys/soundcard.h \ |
| 234 |
endian.h machine/endian.h inttypes.h) |
| 235 |
|
| 236 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 237 |
AC_C_CONST |
| 238 |
AC_C_INLINE |
| 239 |
AC_TYPE_OFF_T |
| 240 |
AC_TYPE_SIZE_T |
| 241 |
AC_HEADER_TIME |
| 242 |
|
| 243 |
dnl Checks for library functions. |
| 244 |
AC_FUNC_MMAP |
| 245 |
AC_CHECK_FUNCS(gettimeofday) |
| 246 |
|
| 247 |
AC_SUBST(ac_aux_dir) |
| 248 |
AC_SUBST(RPM_RELEASE) |
| 249 |
|
| 250 |
AC_CONFIG_FILES(Makefile libdv.spec libdv.pc libdv/Makefile playdv/Makefile encodedv/Makefile) |
| 251 |
AC_OUTPUT |