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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libdv/parse.c)
dnl AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
RPM_RELEASE=1
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(libdv, 0.103)
dnl AM_MAINTAINER_MODE
AC_LIBTOOL_PICMODE(no)
dnl Checks for programs.
AC_SUBST(CFLAGS)
AC_PROG_CC
AM_PROG_AS
AS="${CC}" # stupid automake bug
dnl CPPFLAGS=-I'$(top_srcdir)'/src
dnl Add -Wall if gcc
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -Wall"
fi
AH_TEMPLATE([_GNU_SOURCE],
[Define to enable GNU extensions of glibc, notably large file support])
AH_TEMPLATE([YUV_420_USE_YV12],
[Define to 1 to use planar YUV format for 420 blocks in IEC PAL])
AH_TEMPLATE([ARCH_X86],
[Define as 1 if host is an IA32])
AH_TEMPLATE([DEBUG],
[Define to indicate DEBUGGING is enabled possibly with a level])
AH_TEMPLATE([HAVE_SDL],
[Define as 1 if you have libsdl])
AH_TEMPLATE([HAVE_GTK],
[Define as 1 if you have gtk])
AH_TEMPLATE([HAVE_LIBXV],
[Define if you have the `Xv' library (-lXv).])
AC_DEFINE(_GNU_SOURCE)
AC_PROG_INSTALL
AC_PROG_LIBTOOL
use_asm=:
arch_x86=false
AC_ARG_ENABLE(asm,
[ --disable-asm disable use of architecture specific assembly code],
[ if test "$enableval" = "no"; then
use_asm=false
fi
])
use_sdl=false
AC_ARG_ENABLE(sdl,
[ --enable-sdl enable use of SDL for display],
[ if test "$enableval" = "yes"; then
use_sdl=:
fi
])
use_gtk=:
AC_ARG_ENABLE(gtk,
[ --disable-gtk disable use of gtk for display],
[ if test "$enableval" = "no"; then
use_gtk=false
fi
])
use_xv=:
AC_ARG_ENABLE(xv,
[ --disable-xv disable use of XVideo extension for display],
[ if test "$enableval" = "no"; then
use_xv=false
fi
])
AC_ARG_ENABLE(gprof,
[ --enable-gprof enable compiler options for gprof profiling],
[ if test "$enableval" = "yes"; then
CFLAGS="$CFLAGS -g -pg"
fi
])
if $use_asm; then
case "$host_cpu" in
i?86)
arch_x86=:
AC_DEFINE(ARCH_X86)
;;
*)
;;
esac
fi
AC_ARG_WITH(pal-yuv,
[ --with-pal-yuv=(YV12|YUY2) Select YUV format for IEC PAL (YUY2 by default) ],
[
case "$with_pal_yuv" in
YV12)
AC_MSG_RESULT(YV12)
AC_DEFINE(YUV_420_USE_YV12)
;;
*)
AC_MSG_RESULT(YUY2)
;;
esac
]
)
AC_MSG_CHECKING(whether to enable debugging)
AC_ARG_WITH(debug,
[ --with-debug[=level] Enable debugging.
--without-debug Disable debugging (default). ],
[
case "$with_debug" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG)
CFLAGS="$CFLAGS -g"
;;
*)
AC_MSG_RESULT(DEBUG=$with_debug)
AC_DEFINE_UNQUOTED(DEBUG,$with_debug)
CFLAGS="$CFLAGS -g"
;;
esac
],
[ AC_MSG_RESULT(default=yes)
AC_DEFINE(DEBUG)
CFLAGS="$CFLAGS -g"
]
)
AM_CONDITIONAL(HOST_X86, $arch_x86)
dnl Checks for libraries.
if $use_gtk; then
REQUIRES='glib >= 1.2.4 gtk+ >= 1.2.4'
PKG_CHECK_MODULES(GTK,$REQUIRES)
fi
dnl used in Makefile.am
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
dnl CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
dnl LDFLAGS="$LDFLAGS $GTK_LIBS"
if $use_sdl; then
AM_PATH_SDL(1.1.6,
[
AC_DEFINE(HAVE_SDL)
])
fi
if $use_gtk; then
AM_PATH_GTK(1.2.4,
[
AC_DEFINE(HAVE_GTK)
])
fi
if [ $use_gtk && $use_xv ]; then
AC_CHECK_LIB(Xv, XvQueryAdaptors,
[AC_DEFINE(HAVE_LIBXV)
AC_SUBST(XV_LIB)
XV_LIB='-lXv'
],
[AC_MSG_ERROR([Could not find Xv Lib])],
$GTK_LIBS
)
fi
if $use_gtk; then
PLAYDV_SUBDIR='playdv'
else
PLAYDV_SUBDIR=''
fi
AC_SUBST(PLAYDV_SUBDIR)
dnl *********************************************************************
dnl Check for the pthread lib
dnl
AC_SUBST(PTHREAD_LIBS)
AC_CHECK_LIB(pthread, pthread_create, [ PTHREAD_LIBS="-lpthread" ],,)
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
# FreeBSD and OpenBSD have neither -lpthread nor integrated pthreads in libc.
# Instead -pthread is used to the compiler/linker to get pthreads working right.
if test x$OS_ARCH = xFreeBSD -o x$OS_ARCH = xOpenBSD; then
CFLAGS="$CFLAGS -pthread"
CXXFLAGS="$CXXFLAGS -pthread"
fi
AC_CHECK_LIB(m, sqrt)
dnl Don't bother with popt on non-gcc build, because we make heavy use of
dnl gcc struct initialization extension in our popt code. (Could be fixed)
REQUIRES_NOPKGCONFIG=""
if test "$GCC" = "yes"; then
AC_CHECK_LIB(popt, poptGetContext,
[
POPT_LIB="-lpopt"
AC_DEFINE(HAVE_LIBPOPT, 1, [Define if you have the 'popt' library])
],
[
AC_MSG_WARN(playdv needs the popt package for command line parsing.
The source archive for popt is available at:
ftp://ftp.redhat.com/pub/redhat/code/popt)
])
fi
AC_SUBST(POPT_LIB)
AC_SUBST(REQUIRES_NOPKGCONFIG)
dnl Checks for header files.
AC_PATH_X
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h linux/videodev.h sys/soundcard.h \
endian.h machine/endian.h inttypes.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_FUNC_MMAP
AC_CHECK_FUNCS(gettimeofday)
AC_SUBST(ac_aux_dir)
AC_SUBST(RPM_RELEASE)
AC_CONFIG_FILES(Makefile libdv.spec libdv.pc libdv/Makefile playdv/Makefile encodedv/Makefile)
AC_OUTPUT
|