backport_from_git.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. diff --git a/ChangeLog b/ChangeLog
  2. index 596e22d..1cf42b1 100644
  3. --- a/ChangeLog
  4. +++ b/ChangeLog
  5. @@ -1,3 +1,8 @@
  6. +0.7.2+: 2017 July 4
  7. + No longer automatically build with ImageMagick or GraphicsMagick if
  8. + present; now need to explicitly specify --with-imagemagick or
  9. + --with-graphicsmagick to configure
  10. +
  11. 0.7.2: 2016 December 31
  12. Various code-quality and build improvements
  13. Support “jump pgc n” and other interaction code-generation improvements
  14. diff --git a/Makefile.am b/Makefile.am
  15. index de76fc5..7c11310 100644
  16. --- a/Makefile.am
  17. +++ b/Makefile.am
  18. @@ -1,4 +1,6 @@
  19. SUBDIRS = doc src
  20. +ACLOCAL_AMFLAGS = -I m4
  21. +# as per recommendation at <https://www.gnu.org/software/libtool/manual/html_node/Invoking-libtoolize.html>
  22. noinst_DATA = dvdauthor.spec
  23. #diff --git a/bootstrap b/bootstrap
  24. #index 88b61ae..ecf35f0 100755
  25. #--- a/bootstrap
  26. #+++ b/bootstrap
  27. #@@ -14,7 +14,7 @@
  28. # #
  29. # # Created by Lawrence D'Oliveiro <ldo@geek-central.gen.nz>.
  30. # #-
  31. #-mkdir autotools
  32. #+mkdir autotools m4
  33. # cp /usr/share/gettext/config.rpath autotools/
  34. # autoreconf -i
  35. #
  36. diff --git a/configure.ac b/configure.ac
  37. index f4b270f..b843cf4 100644
  38. --- a/configure.ac
  39. +++ b/configure.ac
  40. @@ -1,6 +1,7 @@
  41. -AC_INIT(DVDAuthor,0.7.2,dvdauthor-users@lists.sourceforge.net)
  42. +AC_INIT(DVDAuthor,0.7.2+,dvdauthor-users@lists.sourceforge.net)
  43. AC_CONFIG_HEADERS(src/config.h)
  44. +AC_CONFIG_MACRO_DIRS([m4])
  45. AC_CONFIG_AUX_DIR(autotools)
  46. AM_INIT_AUTOMAKE
  47. @@ -8,6 +9,8 @@ LT_INIT
  48. AC_PROG_INSTALL
  49. +PKG_PROG_PKG_CONFIG
  50. +
  51. AC_SYS_LARGEFILE
  52. AC_HEADER_STDBOOL
  53. @@ -45,35 +48,30 @@ if test "$enable_shared" = 'no'; then
  54. config_static='--static'
  55. fi
  56. -usemagick=0
  57. -
  58. -AC_CHECK_PROGS(MAGICKCONFIG, [MagickCore-config])
  59. -if test -n "$MAGICKCONFIG"; then
  60. - ac_save_CPPFLAGS="$CPPFLAGS"
  61. - ac_save_LIBS="$LIBS"
  62. - MAGICK_CPPFLAGS="`$MAGICKCONFIG --cppflags`"
  63. - MAGICK_LIBS="`$MAGICKCONFIG --ldflags` `$MAGICKCONFIG --libs`"
  64. - CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
  65. - LIBS="$MAGICK_LIBS $LIBS"
  66. - AC_CHECK_FUNC(ExportImagePixels, usemagick=1, AC_MSG_NOTICE([ImageMagick does not support the function
  67. - ExportImagePixels. Please upgrade to ImageMagick 5.5.7 or newer]))
  68. - CPPFLAGS="$ac_save_CPPFLAGS"
  69. - LIBS="$ac_save_LIBS"
  70. - if test "$usemagick" = 1; then
  71. - AC_DEFINE(HAVE_MAGICK, 1, [Whether the ImageMagick libraries are available])
  72. - fi
  73. +use_imagemagick=0
  74. +use_graphicsmagick=0
  75. +AC_ARG_WITH([imagemagick], AS_HELP_STRING([--with-imagemagick], [Use ImageMagick to augment image import formats]), [if test "$withval" != "no"; then use_imagemagick=1; fi])
  76. +AC_ARG_WITH([graphicsmagick], AS_HELP_STRING([--with-graphicsmagick], [Use GraphicsMagick to augment image import formats]), [if test "$withval" != "no"; then use_graphicsmagick=1; fi])
  77. +if test "$use_imagemagick" = 1 && test "$use_graphicsmagick" = 1; then
  78. + AC_MSG_ERROR([cannot specify both --with-imagemagick and --with-graphicsmagick], 1)
  79. fi
  80. -if test "$usemagick" != 1; then
  81. - PKG_CHECK_MODULES([MAGICK], [GraphicsMagick], usemagick=1; [AC_DEFINE(HAVE_GMAGICK, 1, [whether the GraphicsMagick libraries are available])], [:])
  82. +if test "$use_imagemagick" = 1; then
  83. + PKG_CHECK_MODULES([IMAGEMAGICK], [ImageMagick >= 5.5.7], [AC_DEFINE(HAVE_MAGICK, 1, [Whether the ImageMagick libraries are available])], [AC_MSG_ERROR([ImageMagick not available])])
  84. + MAGICK_CFLAGS="$IMAGEMAGICK_CFLAGS"
  85. + MAGICK_LIBS="$IMAGEMAGICK_LIBS"
  86. fi
  87. -
  88. -if test "$usemagick" != 1; then
  89. - MAGICK_CPPFLAGS="$LIBPNG_CFLAGS"
  90. +if test "$use_graphicsmagick" = 1; then
  91. + PKG_CHECK_MODULES([GRAPHICSMAGICK], [GraphicsMagick], [AC_DEFINE(HAVE_GMAGICK, 1, [whether the GraphicsMagick libraries are available])], [AC_MSG_ERROR([GraphicsMagick not available])])
  92. + MAGICK_CFLAGS="$GRAPHICSMAGICK_CFLAGS"
  93. + MAGICK_LIBS="$GRAPHICSMAGICK_LIBS"
  94. +fi
  95. +if test "$use_imagemagick" != 1 && test "$use_graphicsmagick" != 1; then
  96. + MAGICK_CFLAGS="$LIBPNG_CFLAGS"
  97. MAGICK_LIBS="$LIBPNG_LIBS"
  98. fi
  99. -AC_SUBST(MAGICK_CPPFLAGS)
  100. +AC_SUBST(MAGICK_CFLAGS)
  101. AC_SUBST(MAGICK_LIBS)
  102. PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], [AC_DEFINE(HAVE_FONTCONFIG, 1, [whether Fontconfig is available])], [:])
  103. @@ -84,10 +82,8 @@ PKG_CHECK_MODULES([FRIBIDI], [fribidi], [AC_DEFINE(HAVE_FRIBIDI, 1, [whether Fri
  104. AC_SUBST(FRIBIDI_CFLAGS)
  105. AC_SUBST(FRIBIDI_LIBS)
  106. -AC_CHECK_PROGS(FREETYPECONFIG, [freetype-config])
  107. -if test -n "$FREETYPECONFIG"; then
  108. - FREETYPE_CPPFLAGS="`$FREETYPECONFIG --cflags`"
  109. - FREETYPE_LIBS="`$FREETYPECONFIG --libs $config_static`"
  110. +PKG_CHECK_MODULES(FREETYPE, [freetype2],[
  111. + FREETYPE_CPPFLAGS="$FREETYPE_CFLAGS"
  112. AC_DEFINE(HAVE_FREETYPE, 1, [Whether FreeType is available])
  113. ac_save_CPPFLAGS="$CPPFLAGS"
  114. @@ -96,10 +92,11 @@ if test -n "$FREETYPECONFIG"; then
  115. CPPFLAGS="$ac_save_CPPFLAGS"
  116. AC_SUBST(FREETYPE_CPPFLAGS)
  117. AC_SUBST(FREETYPE_LIBS)
  118. -else
  119. + ],
  120. AC_MSG_ERROR([freetype not found])
  121. -fi
  122. +)
  123. +PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.6.0])
  124. AC_ARG_ENABLE([default-video-format],
  125. 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]),
  126. @@ -135,11 +132,7 @@ dnl AM_LANGINFO_CODESET
  127. AM_ICONV
  128. -ifdef([AM_PATH_XML2],
  129. - [AM_PATH_XML2(2.6.0, , AC_MSG_ERROR([You must have libxml2 >= 2.6.0 installed]))],
  130. - [errprint([You must have libxml2 (>= 2.6.0) installed
  131. -])m4_exit(1)AC_MSG_ERROR([You must have libxml2 (>= 2.6.0) installed])])
  132. -
  133. AC_CHECK_DECLS(O_BINARY, , , [ #include <fcntl.h> ] )
  134. -AC_OUTPUT(Makefile doc/Makefile src/Makefile)
  135. +AC_CONFIG_FILES(Makefile doc/Makefile src/Makefile)
  136. +AC_OUTPUT
  137. diff --git a/src/Makefile.am b/src/Makefile.am
  138. index c7f89a9..5504b8e 100644
  139. --- a/src/Makefile.am
  140. +++ b/src/Makefile.am
  141. @@ -8,7 +8,7 @@ endif
  142. nodist_bin_SCRIPTS = dvddirdel
  143. AM_CPPFLAGS = -DSYSCONFDIR="\"$(sysconfdir)\"" \
  144. - @XML_CPPFLAGS@ @MAGICK_CPPFLAGS@ @FREETYPE_CPPFLAGS@ @FRIBIDI_CFLAGS@ @FONTCONFIG_CFLAGS@
  145. + @XML2_CFLAGS@ @MAGICK_CFLAGS@ @FREETYPE_CPPFLAGS@ @FRIBIDI_CFLAGS@ @FONTCONFIG_CFLAGS@
  146. AM_CFLAGS = -Wall
  147. dvdauthor_SOURCES = dvdauthor.c common.h dvdauthor.h da-internal.h \
  148. @@ -16,17 +16,17 @@ dvdauthor_SOURCES = dvdauthor.c common.h dvdauthor.h da-internal.h \
  149. dvdifo.c dvdvob.c dvdpgc.c \
  150. dvdcli.c readxml.c readxml.h \
  151. conffile.c conffile.h compat.c compat.h rgb.h
  152. -dvdauthor_LDADD = $(LIBICONV) $(XML_LIBS)
  153. +dvdauthor_LDADD = $(LIBICONV) $(XML2_LIBS)
  154. dvdunauthor_SOURCES = dvdunauthor.c dvduncompile.c common.h dvduncompile.h compat.c compat.h
  155. -dvdunauthor_LDADD = $(XML_LIBS) $(LIBICONV) -ldvdread
  156. +dvdunauthor_LDADD = $(XML2_LIBS) $(LIBICONV) -ldvdread
  157. spumux_SOURCES = subgen.c subgen.h rgb.h \
  158. subgen-parse-xml.c readxml.c readxml.h \
  159. subgen-encode.c subgen-image.c subglobals.h \
  160. conffile.c conffile.h compat.c compat.h common.h \
  161. subrender.c subrender.h subreader.c subreader.h subfont.c subfont.h
  162. -spumux_LDADD = $(XML_LIBS) $(MAGICK_LIBS) $(FREETYPE_LIBS) \
  163. +spumux_LDADD = $(XML2_LIBS) $(MAGICK_LIBS) $(FREETYPE_LIBS) \
  164. $(FRIBIDI_LIBS) $(FONTCONFIG_LIBS) $(LIBICONV) -lm
  165. spuunmux_SOURCES = spuunmux.c rgb.h compat.c compat.h common.h conffile.h conffile.c