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