0001-drop-custom-buildconf-script.patch 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. From 39a2a444a32896bd2dab37c9b247ccfd11ff4693 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Mon, 30 Oct 2017 19:29:12 +0100
  4. Subject: [PATCH] buildsystem: drop custom buildconf script, rely on autoreconf
  5. The buildconf script is currently required, because we need to copy a
  6. header around, because it is used both from the library and the examples
  7. sources.
  8. However, having a custom 'buildconf'-like script is not needed if we can
  9. ensure that the header / exists by the time it is needed. For That, we
  10. can just append the src/ directory to the headers search path for the
  11. examples.
  12. And then it means we no longer need to generate the same header twice,
  13. so we remove the second one from configure.ac.
  14. Now, we can just call "autoreconf -fi" to generate the autotools files,
  15. instead of relying on the canned sequence in "buildconf", since
  16. autoreconf has now long known what to do at the correct moment (future
  17. versions of autotools, automake, autopoint, autoheader etc... may
  18. require an other ordering, or other intermediate steps, etc...).
  19. Eventually, get rid of buildconf now it is no longer needed. In fact, we
  20. really keep it for legacy, but have it just call autoreconf (and print a
  21. nice user-friendly warning).
  22. Update gitignore accordingly, too.
  23. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  24. Cc: Sam Voss <sam.voss@rockwellcollins.com>
  25. [Fabrice: Remove .gitignore so patch applies on 1.9.0]
  26. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  27. ---
  28. .gitignore | 2 ++
  29. buildconf | 24 +++++-------------------
  30. configure.ac | 2 +-
  31. example/.gitignore | 2 --
  32. example/Makefile.am | 2 +-
  33. 5 files changed, 9 insertions(+), 23 deletions(-)
  34. diff --git a/buildconf b/buildconf
  35. index 558dcb66..728b3397 100755
  36. --- a/buildconf
  37. +++ b/buildconf
  38. @@ -1,22 +1,8 @@
  39. #!/bin/sh
  40. -LIBTOOLIZE="libtoolize"
  41. +echo "***" >&2
  42. +echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
  43. +echo "*** Doing it for you now, but buildconf may disapear in the future." >&2
  44. +echo "***" >&2
  45. -if [ "x`which $LIBTOOLIZE`" = "x" ]; then
  46. - LIBTOOLIZE="glibtoolize"
  47. -fi
  48. -
  49. -if [ "x`which $LIBTOOLIZE`" = "x" ]; then
  50. - echo "Neither libtoolize nor glibtoolize could be found!"
  51. - exit 1
  52. -fi
  53. -
  54. -${LIBTOOLIZE} --copy --automake --force
  55. -${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
  56. -${AUTOHEADER:-autoheader}
  57. -# copy the private libssh2_config.h.in to the examples dir so that
  58. -# it can be included without pointing the include path to the private
  59. -# source dir
  60. -cp src/libssh2_config.h.in example/libssh2_config.h.in
  61. -${AUTOCONF:-autoconf}
  62. -${AUTOMAKE:-automake} --add-missing --copy
  63. +${AUTORECONF:-autoreconf} -fi "${@}"
  64. diff --git a/configure.ac b/configure.ac
  65. index c6ff7535..6939d0d6 100644
  66. --- a/configure.ac
  67. +++ b/configure.ac
  68. @@ -2,7 +2,7 @@
  69. AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se)
  70. AC_CONFIG_MACRO_DIR([m4])
  71. AC_CONFIG_SRCDIR([src])
  72. -AC_CONFIG_HEADERS([src/libssh2_config.h example/libssh2_config.h])
  73. +AC_CONFIG_HEADERS([src/libssh2_config.h])
  74. AM_MAINTAINER_MODE
  75. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  76. diff --git a/example/Makefile.am b/example/Makefile.am
  77. index 5cf5f071..41f65b12 100644
  78. --- a/example/Makefile.am
  79. +++ b/example/Makefile.am
  80. @@ -13,5 +13,5 @@ if HAVE_SYS_UN_H
  81. noinst_PROGRAMS += x11
  82. endif
  83. -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example
  84. +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example -I../src
  85. LDADD = $(top_builddir)/src/libssh2.la