File: configure.ac

package info (click to toggle)
dvdauthor 0.7.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,436 kB
  • sloc: ansic: 21,379; sh: 634; yacc: 460; lex: 199; makefile: 83
file content (131 lines) | stat: -rw-r--r-- 4,124 bytes parent folder | download | duplicates (2)
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
AC_INIT(DVDAuthor,0.7.2,dvdauthor-users@lists.sourceforge.net)

AC_CONFIG_HEADERS(src/config.h)
AC_CONFIG_AUX_DIR(autotools)

AM_INIT_AUTOMAKE
LT_INIT

AC_PROG_INSTALL

PKG_PROG_PKG_CONFIG

AC_SYS_LARGEFILE

AC_HEADER_STDBOOL

AC_LANG([C])
AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([], [void nested(void) {}])],
    [echo C compiler allows nested routines; AC_DEFINE([HAVE_NESTED_ROUTINES], [1], [define to 1 if C compiler allows nested routines])],
    [echo WARNING: C compiler does not allow nested routines--some functionality will be disabled]
)

have_dvdread=false
AC_CHECK_LIB(dvdread, DVDOpenFile, have_dvdread=true)

AC_CHECK_LIB(gnugetopt, getopt_long)

dnl AC_CHECK_HEADERS initializes CPP, so must appear outside of any conditionals
AC_CHECK_HEADERS( \
    getopt.h \
    io.h \
)

AC_CHECK_FUNCS( \
    strndup \
    getopt_long \
    setmode \
)

PKG_CHECK_MODULES(LIBPNG, [libpng])
AC_SUBST(LIBPNG_CFLAGS)
AC_SUBST(LIBPNG_LIBS)

config_static=''
if test "$enable_shared" = 'no'; then
    config_static='--static'
fi

usemagick=0

AC_CHECK_PROGS(MAGICKCONFIG, [MagickCore-config])
if test -n "$MAGICKCONFIG"; then
    ac_save_CPPFLAGS="$CPPFLAGS"
    ac_save_LIBS="$LIBS"
    MAGICK_CPPFLAGS="`$MAGICKCONFIG --cppflags`"
    MAGICK_LIBS="`$MAGICKCONFIG --ldflags` `$MAGICKCONFIG --libs`"
    CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
    LIBS="$MAGICK_LIBS $LIBS"
    AC_CHECK_FUNC(ExportImagePixels, usemagick=1, AC_MSG_NOTICE([ImageMagick does not support the function
         ExportImagePixels.  Please upgrade to ImageMagick 5.5.7 or newer]))
    CPPFLAGS="$ac_save_CPPFLAGS"
    LIBS="$ac_save_LIBS"
    if test "$usemagick" = 1; then
        AC_DEFINE(HAVE_MAGICK, 1, [Whether the ImageMagick libraries are available])
    fi
fi

if test "$usemagick" != 1; then
    PKG_CHECK_MODULES([MAGICK], [GraphicsMagick], usemagick=1; [AC_DEFINE(HAVE_GMAGICK, 1, [whether the GraphicsMagick libraries are available])], [:])
fi

if test "$usemagick" != 1; then
    MAGICK_CPPFLAGS="$LIBPNG_CFLAGS"
    MAGICK_LIBS="$LIBPNG_LIBS"
fi

AC_SUBST(MAGICK_CPPFLAGS)
AC_SUBST(MAGICK_LIBS)

PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], [AC_DEFINE(HAVE_FONTCONFIG, 1, [whether Fontconfig is available])], [:])
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)

PKG_CHECK_MODULES([FRIBIDI], [fribidi], [AC_DEFINE(HAVE_FRIBIDI, 1, [whether FriBidi is available])], [:])
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)

PKG_CHECK_MODULES([FREETYPE], [freetype2], [AC_DEFINE(HAVE_FREETYPE, 1, [whether FreeType2 is available])], [:])
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)

PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.6.0])

AC_ARG_ENABLE([default-video-format],
AS_HELP_STRING([--enable-default-video-format=format], [specify a default video format, either NTSC or PAL, to be used if no configuration or input setting is given]),
[
if test "$enable_default_video_format" == "PAL" -o "$enable_default_video_format" == "pal"; then
    AC_DEFINE(DEFAULT_VIDEO_FORMAT, 2, [Default video format, 1 => NTSC, 2 => PAL])
elif test "$enable_default_video_format" == "NTSC" -o "$enable_default_video_format" == "ntsc"; then
    AC_DEFINE(DEFAULT_VIDEO_FORMAT, 1, [Default video format, 1 => NTSC, 2 => PAL])
else
    AC_MSG_ERROR([specify either --enable-default-video-format=pal or --enable-default-video-format=ntsc])
fi
])

AC_ARG_ENABLE([localize-filenames],
AS_HELP_STRING([--enable-localize-filenames], [specifies that filenames are to be interpreted in the locale encoding. If omitted, they are always interpreted as UTF-8]),
[
AC_DEFINE(LOCALIZE_FILENAMES, 1, [Whether to localize filenames])
])

AC_ARG_ENABLE([dvdunauthor],
AS_HELP_STRING([--disable-dvdunauthor], [don't build dvdunauthor (which requires libdvdread). If not specified and libdvdread cannot be found, an error occurs])
)
AS_IF([test "x$enable_dvdunauthor" != xno],
[AS_IF([test "x$have_dvdread" = xfalse],
[AC_MSG_ERROR([missing libdvdread])]
)
],
[have_dvdread=false]
)
AM_CONDITIONAL(HAVE_DVDREAD, $have_dvdread)

dnl AM_LANGINFO_CODESET

AM_ICONV

AC_CHECK_DECLS(O_BINARY, , , [ #include <fcntl.h> ] )

AC_OUTPUT(Makefile doc/Makefile src/Makefile)