From 04b5e12f729138f5ed5265d79c07ecd010747312 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 14 Mar 2013 00:06:41 -0500 Subject: [PATCH] Network Kit: Fix parallel build * HttpAuthentication.cpp wasn't in ssl grist resulting in unmet dependencies. #9523 * md5.c only being used when ssl wasn't available was kind of spaghetti logic. These changes make this more obvious. --- src/kits/network/libnetapi/HttpAuthentication.cpp | 10 +++++----- src/kits/network/libnetapi/Jamfile | 8 ++++++-- src/kits/network/libnetapi/md5.c | 6 ++---- src/kits/network/libnetapi/md5.h | 7 +++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/kits/network/libnetapi/HttpAuthentication.cpp b/src/kits/network/libnetapi/HttpAuthentication.cpp index 606e859d09..5a6f5a4e6c 100644 --- a/src/kits/network/libnetapi/HttpAuthentication.cpp +++ b/src/kits/network/libnetapi/HttpAuthentication.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2010 Haiku Inc. All rights reserved. + * Copyright 2010-2013 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -14,12 +14,12 @@ #include #define PRINT(x) printf x -#ifdef OPENSSL_ENABLED -#define HAVE_OPENSSL // Instruct md5.h to include the openssl version -#endif - extern "C" { +#ifdef OPENSSL_ENABLED +#include +#else #include "md5.h" +#endif }; #ifndef MD5_DIGEST_LENGTH diff --git a/src/kits/network/libnetapi/Jamfile b/src/kits/network/libnetapi/Jamfile index 427de08bb2..5d09f54b75 100644 --- a/src/kits/network/libnetapi/Jamfile +++ b/src/kits/network/libnetapi/Jamfile @@ -7,16 +7,20 @@ UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_wlan ] : true ; local sslSources ; +local md5Sources ; if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) { SubDirC++Flags -DOPENSSL_ENABLED ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; sslSources = SSL.cpp ; - Includes [ FGristFiles $(sslSources) SecureSocket.cpp ] + md5Sources = ; + Includes [ FGristFiles $(sslSources) SecureSocket.cpp HttpAuthentication.cpp ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; # Dependency needed to trigger downloading/unzipping the package before # compiling the files. SetupFeatureObjectsDir ssl ; } else { + # As we don't have md5 from ssl, use our own + md5Sources = md5.c ; SetupFeatureObjectsDir no-ssl ; } @@ -53,7 +57,7 @@ SharedLibrary libbnetapi.so : HttpForm.cpp HttpTime.cpp - md5.c + $(md5Sources) Url.cpp UrlContext.cpp diff --git a/src/kits/network/libnetapi/md5.c b/src/kits/network/libnetapi/md5.c index 7d43a603ad..efdf4cd2a3 100644 --- a/src/kits/network/libnetapi/md5.c +++ b/src/kits/network/libnetapi/md5.c @@ -35,11 +35,11 @@ * compile-time configuration. */ -#ifndef HAVE_OPENSSL + +#include "md5.h" #include -#include "md5.h" /* * The basic MD5 functions. @@ -291,5 +291,3 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx) memset(ctx, 0, sizeof(*ctx)); } - -#endif diff --git a/src/kits/network/libnetapi/md5.h b/src/kits/network/libnetapi/md5.h index f1a6857640..f56a48a2a6 100644 --- a/src/kits/network/libnetapi/md5.h +++ b/src/kits/network/libnetapi/md5.h @@ -22,12 +22,10 @@ * * See md5.c for more information. */ - -#ifdef HAVE_OPENSSL -#include -#elif !defined(_MD5_H) +#ifndef _MD5_H #define _MD5_H + /* Any 32-bit or wider unsigned integer data type will do */ typedef unsigned int MD5_u32plus; @@ -42,4 +40,5 @@ extern void MD5_Init(MD5_CTX *ctx); extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size); extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); + #endif