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.
This commit is contained in:
Alexander von Gluck IV 2013-03-14 00:06:41 -05:00
parent 187d12c437
commit 04b5e12f72
4 changed files with 16 additions and 15 deletions

View File

@ -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 <cstdio>
#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 <openssl/md5.h>
#else
#include "md5.h"
#endif
};
#ifndef MD5_DIGEST_LENGTH

View File

@ -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

View File

@ -35,11 +35,11 @@
* compile-time configuration.
*/
#ifndef HAVE_OPENSSL
#include "md5.h"
#include <string.h>
#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

View File

@ -22,12 +22,10 @@
*
* See md5.c for more information.
*/
#ifdef HAVE_OPENSSL
#include <openssl/md5.h>
#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