Small code reduction in oc_vlc_mv_comp_unpack().
[xiph/unicode.git] / theora-tools / configure.ac
blobe20b78dc2adf6ebe040303e59d610a5eb90eed0c
1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
7 AC_INIT(theora-tools,[unreleased-snapshot])
8 AC_CONFIG_HEADERS([config.h])
9 AM_INIT_AUTOMAKE
11 dnl --------------------------------------------------  
12 dnl Check for programs
13 dnl --------------------------------------------------  
15 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
16 dnl if $CFLAGS is blank
17 cflags_save="$CFLAGS"
18 AC_PROG_CC
19 AC_PROG_CPP
20 CFLAGS="$cflags_save"
22 dnl no shared linking for us
23 AM_DISABLE_SHARED
24 AM_ENABLE_STATIC
25 AM_PROG_LIBTOOL
27 dnl --------------------------------------------------
28 dnl Set build flags based on environment
29 dnl --------------------------------------------------
31 AC_CANONICAL_HOST
33 dnl Set some target options
35 cflags_save="$CFLAGS"
36 ldflags_save="$LDFLAGS"
37 if test -z "$GCC"; then
38         case $host in 
39         *)
40                 DEBUG="-g"
41                 CFLAGS="-O"
42                 PROFILE="-g -p" ;;
43         esac
44 else
46         case $host in 
47         *)
48                 DEBUG="-g -W -D__NO_MATH_INLINES"
49                 CFLAGS="-O2 -Wall"
50                 PROFILE="-W -pg -g -O2 -fno-inline-functions";;
51         esac
53 CFLAGS="$CFLAGS $cflags_save"
54 LDFLAGS="$LDFLAGS $ldflags_save"
56 dnl --------------------------------------------------
57 dnl Check for headers
58 dnl --------------------------------------------------
60 dnl none here
62 dnl --------------------------------------------------
63 dnl Check for typedefs, structures, etc
64 dnl --------------------------------------------------
66 dnl none
68 dnl --------------------------------------------------
69 dnl Check for library functions
70 dnl --------------------------------------------------
72 dnl substitute the included getopt if the system doesn't support long options
73 AC_CHECK_FUNC(getopt_long,
74               [GETOPT_OBJS=''],
75               [GETOPT_OBJS='getopt.$(OBJEXT) getopt1.$(OBJEXT)'])
76 AC_SUBST(GETOPT_OBJS)
78 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
79 PKG_CHECK_MODULES(XIPH,ogg >= 1.1 vorbis theora)
80 CFLAGS="$CFLGS $XIPH_CFLAGS"
81 LIBS="$LIBS $XIPH_LIBS"
83 PKG_CHECK_MODULES(VORBISENC, vorbisenc)
84 AC_SUBST(VORBISENC_CFLAGS)
85 AC_SUBST(VORBISENC_LIBS)
87 dnl check for libpng
88 HAVE_PNG=no
89 if test "x$HAVE_PKG_CONFIG" = "xyes"
90 then
91   PKG_CHECK_MODULES(PNG, libpng, HAVE_PNG=yes, HAVE_PNG=no)
93 AC_SUBST(PNG_CFLAGS)
94 AC_SUBST(PNG_LIBS)
96 if test x$HAVE_PNG = xyes; then
97   PNG2THEORA="png2theora"
98   AC_SUBST(PNG2THEORA)
101 dnl --------------------------------------------------
102 dnl Do substitutions
103 dnl --------------------------------------------------
105 LIBS="$LIBS"
107 AC_SUBST(LIBS)
108 AC_SUBST(DEBUG)
109 AC_SUBST(PROFILE)
111 AC_CONFIG_FILES([
112   Makefile
113   theoraenc/Makefile
114   theoracomment/Makefile
115   png2theora/Makefile
116   vp32theora/Makefile
118 AC_OUTPUT