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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. ---
  26. .gitignore | 2 ++
  27. buildconf | 24 +++++-------------------
  28. configure.ac | 2 +-
  29. example/.gitignore | 2 --
  30. example/Makefile.am | 2 +-
  31. 5 files changed, 9 insertions(+), 23 deletions(-)
  32. diff --git a/.gitignore b/.gitignore
  33. index 997e51e1..b6d6b5cb 100644
  34. --- a/.gitignore
  35. +++ b/.gitignore
  36. @@ -13,6 +13,8 @@ Makefile
  37. Makefile.in
  38. aclocal.m4
  39. autom4te.cache
  40. +compile
  41. +test-driver
  42. config.guess
  43. config.log
  44. config.status
  45. diff --git a/buildconf b/buildconf
  46. index 558dcb66..728b3397 100755
  47. --- a/buildconf
  48. +++ b/buildconf
  49. @@ -1,22 +1,8 @@
  50. #!/bin/sh
  51. -LIBTOOLIZE="libtoolize"
  52. +echo "***" >&2
  53. +echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
  54. +echo "*** Doing it for you now, but buildconf may disapear in the future." >&2
  55. +echo "***" >&2
  56. -if [ "x`which $LIBTOOLIZE`" = "x" ]; then
  57. - LIBTOOLIZE="glibtoolize"
  58. -fi
  59. -
  60. -if [ "x`which $LIBTOOLIZE`" = "x" ]; then
  61. - echo "Neither libtoolize nor glibtoolize could be found!"
  62. - exit 1
  63. -fi
  64. -
  65. -${LIBTOOLIZE} --copy --automake --force
  66. -${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
  67. -${AUTOHEADER:-autoheader}
  68. -# copy the private libssh2_config.h.in to the examples dir so that
  69. -# it can be included without pointing the include path to the private
  70. -# source dir
  71. -cp src/libssh2_config.h.in example/libssh2_config.h.in
  72. -${AUTOCONF:-autoconf}
  73. -${AUTOMAKE:-automake} --add-missing --copy
  74. +${AUTORECONF:-autoreconf} -fi "${@}"
  75. diff --git a/configure.ac b/configure.ac
  76. index c6ff7535..6939d0d6 100644
  77. --- a/configure.ac
  78. +++ b/configure.ac
  79. @@ -2,7 +2,7 @@
  80. AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se)
  81. AC_CONFIG_MACRO_DIR([m4])
  82. AC_CONFIG_SRCDIR([src])
  83. -AC_CONFIG_HEADERS([src/libssh2_config.h example/libssh2_config.h])
  84. +AC_CONFIG_HEADERS([src/libssh2_config.h])
  85. AM_MAINTAINER_MODE
  86. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  87. diff --git a/example/.gitignore b/example/.gitignore
  88. index 13448191..cac152b8 100644
  89. --- a/example/.gitignore
  90. +++ b/example/.gitignore
  91. @@ -20,8 +20,6 @@ sftp_write_nonblock
  92. config.h.in
  93. ssh2_exec
  94. ssh2_agent
  95. -libssh2_config.h
  96. -libssh2_config.h.in
  97. stamp-h2
  98. sftp_append
  99. sftp_write_sliding
  100. diff --git a/example/Makefile.am b/example/Makefile.am
  101. index 5cf5f071..41f65b12 100644
  102. --- a/example/Makefile.am
  103. +++ b/example/Makefile.am
  104. @@ -13,5 +13,5 @@ if HAVE_SYS_UN_H
  105. noinst_PROGRAMS += x11
  106. endif
  107. -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example
  108. +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example -I../src
  109. LDADD = $(top_builddir)/src/libssh2.la