catdvi-0.14-kpathsea.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. http://bugs.gentoo.org/342817
  2. --- catdvi-0.14-orig/config.mk.in
  3. +++ catdvi-0.14/config.mk.in
  4. @@ -23,6 +23,7 @@
  5. CFG_HAS_GETOPT_LONG = @CFG_HAS_GETOPT_LONG@
  6. CFG_HAS_KPATHSEA = @CFG_HAS_KPATHSEA@
  7. +CFG_HAS_KPATHSEA_VERSION_H = @CFG_HAS_KPATHSEA_VERSION_H@
  8. CFG_KPATHSEA_HAS_GETOPT_LONG = @CFG_KPATHSEA_HAS_GETOPT_LONG@
  9. CFG_SHOW_PSE2UNIC_WARNINGS = @CFG_SHOW_PSETOUNIC_WARNINGS@
  10. --- catdvi-0.14-orig/configure.in
  11. +++ catdvi-0.14/configure.in
  12. @@ -48,6 +48,9 @@
  13. AC_MSG_ERROR([*** kpathsea library (required) not found; try to use the --with-kpathsea-prefix option ***])
  14. fi
  15. +AC_CHECK_HEADERS([kpathsea/version.h], CFG_HAS_KPATHSEA_VERSION_H=yes, CFG_HAS_KPATHSEA_VERSION_H=no)
  16. +AC_SUBST(CFG_HAS_KPATHSEA_VERSION_H)
  17. +
  18. dnl It seem libkpathsea provides a getopt_long() implementation
  19. dnl if and only if the C library does not.
  20. dnl
  21. --- catdvi-0.14-orig/GNUmakefile
  22. +++ catdvi-0.14/GNUmakefile
  23. @@ -36,6 +36,10 @@
  24. endif
  25. endif
  26. +ifeq ($(CFG_HAS_KPATHSEA_VERSION_H),yes)
  27. +CPPFLAGS += -DCFG_HAS_KPATHSEA_VERSION_H
  28. +endif
  29. +
  30. ifeq ($(CFG_HAS_KPATHSEA),yes)
  31. FINDTFM = kpathsea.o
  32. LDLIBS = -lkpathsea
  33. --- catdvi-0.14-orig/kpathsea.c
  34. +++ catdvi-0.14/kpathsea.c
  35. @@ -21,6 +21,12 @@
  36. #include "findtfm.h"
  37. #include "version.h"
  38. +#ifdef CFG_HAS_KPATHSEA_VERSION_H
  39. +#include <kpathsea/version.h>
  40. +#else
  41. +extern char * kpathsea_version_string;
  42. +#endif
  43. +
  44. void setup_findtfm(char const * progname)
  45. {
  46. kpse_set_program_name(progname, PACKAGE);
  47. @@ -36,7 +42,6 @@
  48. void version_findtfm(void)
  49. {
  50. - extern char * kpathsea_version_string;
  51. puts(kpathsea_version_string);
  52. }