Sam Voss | a660d1f | 2017-10-31 12:56:30 -0500 | [diff] [blame] | 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 | |
| 6 | The buildconf script is currently required, because we need to copy a |
| 7 | header around, because it is used both from the library and the examples |
| 8 | sources. |
| 9 | |
| 10 | However, having a custom 'buildconf'-like script is not needed if we can |
| 11 | ensure that the header / exists by the time it is needed. For That, we |
| 12 | can just append the src/ directory to the headers search path for the |
| 13 | examples. |
| 14 | |
| 15 | And then it means we no longer need to generate the same header twice, |
| 16 | so we remove the second one from configure.ac. |
| 17 | |
| 18 | Now, we can just call "autoreconf -fi" to generate the autotools files, |
| 19 | instead of relying on the canned sequence in "buildconf", since |
| 20 | autoreconf has now long known what to do at the correct moment (future |
| 21 | versions of autotools, automake, autopoint, autoheader etc... may |
| 22 | require an other ordering, or other intermediate steps, etc...). |
| 23 | |
| 24 | Eventually, get rid of buildconf now it is no longer needed. In fact, we |
| 25 | really keep it for legacy, but have it just call autoreconf (and print a |
| 26 | nice user-friendly warning). |
| 27 | |
| 28 | Update gitignore accordingly, too. |
| 29 | |
| 30 | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> |
| 31 | Cc: 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 | |
| 40 | diff --git a/.gitignore b/.gitignore |
| 41 | index 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 |
| 53 | diff --git a/buildconf b/buildconf |
| 54 | index 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 "${@}" |
| 85 | diff --git a/configure.ac b/configure.ac |
| 86 | index 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 | |
| 98 | diff --git a/example/.gitignore b/example/.gitignore |
| 99 | index 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 |
| 111 | diff --git a/example/Makefile.am b/example/Makefile.am |
| 112 | index 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 |