From e3d8c1cfed5e352af7b694dfc210022ab51d3396 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 13 Jan 2010 13:46:56 +0100 Subject: [PATCH] generate a libssh2_config.h in the example dir buildconf copies the template to example/ and configure makes sure to generate a proper file from it and the direct_tcpip.c example is the first one to use it - to make sure it builds fine on more paltforms --- buildconf | 2 +- configure.ac | 2 +- example/direct_tcpip.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/buildconf b/buildconf index ef1fe56e..9eee2bad 100755 --- a/buildconf +++ b/buildconf @@ -22,6 +22,6 @@ ${AUTOHEADER:-autoheader} # copy the private libssh2_config.h.in to the examples dir so that # it can be included without pointing the include path to the private # source dir -cp src/libssh2_config.h.in example/config.h.in +cp src/libssh2_config.h.in example/libssh2_config.h.in ${AUTOCONF:-autoconf} ${AUTOMAKE:-automake} --add-missing --copy diff --git a/configure.ac b/configure.ac index a7a7cbda..fc6410ad 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT(libssh2, [-], libssh2-devel@lists.sourceforge.net) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADER([src/libssh2_config.h]) +AM_CONFIG_HEADER([src/libssh2_config.h example/libssh2_config.h]) AM_MAINTAINER_MODE dnl SED is needed by some of the tools diff --git a/example/direct_tcpip.c b/example/direct_tcpip.c index bbc22724..0fc6d45d 100644 --- a/example/direct_tcpip.c +++ b/example/direct_tcpip.c @@ -1,5 +1,9 @@ #include +#ifdef HAVE_CONFIG_H +#include "libssh2_config.h" +#endif + #include #ifdef HAVE_WINSOCK2_H