Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix libproxy build.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 22, 2011
1 parent 1bf6c58 commit d8a12f5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
22 changes: 14 additions & 8 deletions configure.ac
Expand Up @@ -43,14 +43,20 @@ AC_PROG_LIBTOOL
PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
PKG_CHECK_MODULES(ZLIB, zlib)

libproxy_hdr=no
AC_CHECK_HEADER([libproxy.h],
[libproxy_hdr='"libproxy.h"'],
[AC_CHECK_HEADER([proxy.h],
[libproxy_hdr='"libproxy.h"'])])
if (test "$libproxy_hdr" != "no"); then
AC_DEFINE([LIBPROXY_HDR], $libproxy_hdr)
PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, AC_SUBST(LIBPROXY_PC, libproxy-1.0), dummy=yes)
PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0,
[AC_SUBST(LIBPROXY_PC, libproxy-1.0)
AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
libproxy_pkg=yes],
libproxy_pkg=no)
dnl Libproxy *can* exist without a .pc file, and its header may be called
dnl libproxy.h in that case.
if (test "$libproxy_pkg" = "no"); then
AC_CHECK_HEADER([proxy.h],
[AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
AC_SUBST([LIBPROXY_LIBS], [-lproxy])],
[AC_CHECK_HEADER([libproxy.h],
[AC_DEFINE([LIBPROXY_HDR], ["libproxy.h"])
AC_SUBST([LIBPROXY_LIBS], [-lproxy])])])
fi

AC_CHECK_HEADER([if_tun.h],
Expand Down
6 changes: 3 additions & 3 deletions main.c
Expand Up @@ -40,7 +40,7 @@
#include <sys/utsname.h>
#include <sys/types.h>
#include <openssl/ui.h>
#ifdef OPENCONNECT_LIBPROXY
#ifdef LIBPROXY_HDR
#include LIBPROXY_HDR
#endif

Expand Down Expand Up @@ -167,7 +167,7 @@ static void usage(void)
printf(" -P, --proxy=URL Set proxy server\n");
printf(" --no-proxy Disable proxy\n");
printf(" --libproxy Use libproxy to automatically configure proxy\n");
#ifndef OPENCONNECT_LIBPROXY
#ifndef LIBPROXY_HDR
printf(" (NOTE: libproxy disabled in this build)\n");
#endif
printf(" -q, --quiet Less output\n");
Expand Down Expand Up @@ -476,7 +476,7 @@ int main(int argc, char **argv)
vpninfo->progress = write_progress;

if (autoproxy) {
#ifdef OPENCONNECT_LIBPROXY
#ifdef LIBPROXY_HDR
vpninfo->proxy_factory = px_proxy_factory_new();
#else
fprintf(stderr, "This version of openconnect was built without libproxy support\n");
Expand Down
4 changes: 2 additions & 2 deletions openconnect-internal.h
Expand Up @@ -36,7 +36,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef OPENCONNECT_LIBPROXY
#ifdef LIBPROXY_HDR
#include LIBPROXY_HDR
#endif

Expand Down Expand Up @@ -97,7 +97,7 @@ struct openconnect_info {

char *csd_scriptname;

#ifdef OPENCONNECT_LIBPROXY
#ifdef LIBPROXY_HDR
pxProxyFactory *proxy_factory;
#endif
char *proxy_type;
Expand Down
3 changes: 2 additions & 1 deletion openconnect.html
Expand Up @@ -184,6 +184,7 @@ <H2>Release Notes / Changelog</H2>
<LI><B>OpenConnect HEAD</B><BR>
<UL>
<LI>Fix build on Debian systems where <TT>dtls1_stop_timer()</TT> is not available.</LI>
<LI>Fix libproxy detection.</LI>
<LI>Enable a useful set of compiler warnings by default.</LI>
<LI>Fix various minor compiler warnings.</LI>
</UL><BR>
Expand Down Expand Up @@ -507,6 +508,6 @@ <H3>FreeBSD</H3>
<hr>
<address>David Woodhouse &lt;<A HREF="mailto:dwmw2@infradead.org">dwmw2@infradead.org</A>&gt;</address>
<!-- hhmts start -->
Last modified: Thu Sep 15 23:17:44 BST 2011
Last modified: Thu Sep 22 14:39:12 BST 2011
<!-- hhmts end -->
</body> </html>
2 changes: 1 addition & 1 deletion ssl.c
Expand Up @@ -888,7 +888,7 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
this way than if we pass NULL to getaddrinfo() and
then try to fill in the numeric value into
different types of returned sockaddr_in{6,}. */
#ifdef OPENCONNECT_LIBPROXY
#ifdef LIBPROXY_HDR
if (vpninfo->proxy_factory) {
char *url;
char **proxies;
Expand Down

0 comments on commit d8a12f5

Please sign in to comment.