From 7cef2af917cf9ca83209470a48d8a38b14fd1206 Mon Sep 17 00:00:00 2001 From: bulk88 Date: Mon, 3 Aug 2020 14:16:27 -0400 Subject: C89/Visual C compatibility, no code before decl Cherry-picked with conflict resolution by hvn from PR 188 commit 4ecea059353d0681fac0242c95c22cd8a973501f --- SSLeay.xs | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/SSLeay.xs b/SSLeay.xs index d2dcffc..fca0c2f 100644 --- a/SSLeay.xs +++ b/SSLeay.xs @@ -3209,9 +3209,10 @@ SSL_verify_client_post_handshake(SSL *ssl) void i2d_SSL_SESSION(sess) SSL_SESSION * sess - PPCODE: + PREINIT: STRLEN len; unsigned char *pc,*pi; + PPCODE: if (!(len = i2d_SSL_SESSION(sess,NULL))) croak("invalid SSL_SESSION"); Newx(pc,len,unsigned char); if (!pc) croak("out of memory"); @@ -4479,12 +4480,13 @@ X509_get_fingerprint(cert,type) void X509_get_subjectAltNames(cert) X509 * cert - PPCODE: + PREINIT: int i, j, count = 0; X509_EXTENSION *subjAltNameExt = NULL; STACK_OF(GENERAL_NAME) *subjAltNameDNs = NULL; GENERAL_NAME *subjAltNameDN = NULL; int num_gnames; + PPCODE: if ( (i = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1)) >= 0 && (subjAltNameExt = X509_get_ext(cert, i)) && (subjAltNameDNs = (STACK_OF(GENERAL_NAME) *)X509V3_EXT_d2i(subjAltNameExt))) @@ -4615,9 +4617,10 @@ P_X509_get_crl_distribution_points(cert) void P_X509_get_ocsp_uri(cert) X509 * cert - PPCODE: + PREINIT: AUTHORITY_INFO_ACCESS *info; int i; + PPCODE: info = (AUTHORITY_INFO_ACCESS *)X509_get_ext_d2i(cert, NID_info_access, NULL, NULL); if (!info) XSRETURN_UNDEF; @@ -6620,11 +6623,11 @@ EVP_PKEY_assign_EC_KEY(pkey,key) EC_KEY * EC_KEY_generate_key(curve) SV *curve; - CODE: + PREINIT: EC_GROUP *group = NULL; EC_KEY *eckey = NULL; int nid; - + CODE: RETVAL = 0; if (SvIOK(curve)) { nid = SvIV(curve); @@ -7237,13 +7240,16 @@ SSL_get_server_random(s) int SSL_get_keyblock_size(s) SSL * s - CODE: + PREINIT: #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) || (LIBRESSL_VERSION_NUMBER >= 0x2070000fL) const SSL_CIPHER *ssl_cipher; int cipher = NID_undef, digest = NID_undef, mac_secret_size = 0; const EVP_CIPHER *c = NULL; const EVP_MD *h = NULL; +#endif + CODE: +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) || (LIBRESSL_VERSION_NUMBER >= 0x2070000fL) ssl_cipher = SSL_get_current_cipher(s); if (ssl_cipher) cipher = SSL_CIPHER_get_cipher_nid(ssl_cipher); @@ -7984,10 +7990,11 @@ P_X509_get_pubkey_alg(x) void X509_get_X509_PUBKEY(x) const X509 *x - PPCODE: + PREINIT: X509_PUBKEY *pkey; STRLEN len; unsigned char *pc, *pi; + PPCODE: if (!(pkey = X509_get_X509_PUBKEY(x))) croak("invalid certificate"); if (!(len = i2d_X509_PUBKEY(pkey, NULL))) croak("invalid certificate public key"); Newx(pc,len,unsigned char); @@ -8187,9 +8194,10 @@ d2i_OCSP_RESPONSE(pv) void i2d_OCSP_RESPONSE(r) OCSP_RESPONSE * r - PPCODE: + PREINIT: STRLEN len; unsigned char *pc,*pi; + PPCODE: if (!(len = i2d_OCSP_RESPONSE(r,NULL))) croak("invalid OCSP response"); Newx(pc,len,unsigned char); if (!pc) croak("out of memory"); @@ -8220,9 +8228,10 @@ d2i_OCSP_REQUEST(pv) void i2d_OCSP_REQUEST(r) OCSP_REQUEST * r - PPCODE: + PREINIT: STRLEN len; unsigned char *pc,*pi; + PPCODE: if (!(len = i2d_OCSP_REQUEST(r,NULL))) croak("invalid OCSP request"); Newx(pc,len,unsigned char); if (!pc) croak("out of memory"); @@ -8246,7 +8255,7 @@ OCSP_response_status(OCSP_RESPONSE *r) void SSL_OCSP_cert2ids(ssl,...) SSL *ssl - PPCODE: +PREINIT: SSL_CTX *ctx; X509_STORE *store; STACK_OF(X509) *chain; @@ -8255,6 +8264,7 @@ SSL_OCSP_cert2ids(ssl,...) int i; STRLEN len; unsigned char *pi; + PPCODE: if (!ssl) croak("not a SSL object"); ctx = SSL_get_SSL_CTX(ssl); @@ -8285,10 +8295,11 @@ SSL_OCSP_cert2ids(ssl,...) OCSP_REQUEST * OCSP_ids2req(...) - CODE: + PREINIT: OCSP_REQUEST *req; OCSP_CERTID *id; int i; + CODE: req = OCSP_REQUEST_new(); if (!req) croak("out of memory"); @@ -8380,12 +8391,13 @@ SSL_OCSP_response_verify(ssl,rsp,svreq=NULL,flags=0) void OCSP_response_results(rsp,...) OCSP_RESPONSE *rsp - PPCODE: + PREINIT: OCSP_BASICRESP *bsr; int i,want_array; time_t nextupd = 0; time_t gmtoff = -1; int getall,sksn; + PPCODE: bsr = OCSP_response_get1_basic(rsp); if (!bsr) croak("invalid OCSP response"); -- cgit v1.2.3 From 001aa0a8871b5d9c0e05eeed9494861407fc27d3 Mon Sep 17 00:00:00 2001 From: Heikki Vatiainen Date: Fri, 29 Dec 2023 13:46:07 +0200 Subject: GH-454 More fixes to address 'no code before declaration' warnings. Fix additional cases with code before variable declarations. These were added before the longer commit by bulk88 which fixed a lot of previously existing cases. Note that Perl 5.35.5 and later relax this requirement because 5.35.5 and later versions use some of C99 (C standard ISO/IEC 9899:1999) features. Gcc and Clang flag -Werror=declaration-after-statement is especially mentioned as something that should only be used with Perl versions earlier than 5.35.5. https://perldoc.perl.org/5.35.5/perldelta#Configuration-and-Compilation SSLeay.xs currently avoids code before declarations. --- Changes | 7 +++++++ SSLeay.xs | 23 +++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index dab1fd3..d1baa0c 100644 --- a/Changes +++ b/Changes @@ -134,6 +134,13 @@ Revision history for Perl extension Net::SSLeay. related functions. - Support finding OpenSSL libraries using ExtUtils::PkgConfig. Thanks to Paul Howarth for the patch. + - Fix a number of cases where variables were declared after + code triggering Gcc and Clang warning + -Wdeclaration-after-statement. This is supported by C + language version C99 and used by Perl 5.35.5 and + later. SSLeay.xs is likely compiled with compilers that do + not support this, therefore such constructs are avoided in + SSLeay.xs. Thanks to GitHub user bulk88 for the patch. 1.93_02 2023-02-22 - Update ppport.h to version 3.68. This eliminates thousands of diff --git a/SSLeay.xs b/SSLeay.xs index fca0c2f..787892d 100644 --- a/SSLeay.xs +++ b/SSLeay.xs @@ -2997,8 +2997,9 @@ SSL_has_pending(s) #ifdef NET_SSLEAY_32BIT_INT_PERL int OPENSSL_init_ssl(double opts, SV *sv_settings = &PL_sv_undef) - CODE: + PREINIT: const OPENSSL_INIT_SETTINGS *settings = NULL; + CODE: if (sv_settings != &PL_sv_undef) settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings)); RETVAL = OPENSSL_init_ssl(opts, settings); @@ -3007,8 +3008,9 @@ OPENSSL_init_ssl(double opts, SV *sv_settings = &PL_sv_undef) int OPENSSL_init_crypto(double opts, SV *sv_settings = &PL_sv_undef) - CODE: + PREINIT: const OPENSSL_INIT_SETTINGS *settings = NULL; + CODE: if (sv_settings != &PL_sv_undef) settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings)); RETVAL = OPENSSL_init_crypto(opts, settings); @@ -3018,8 +3020,9 @@ OPENSSL_init_crypto(double opts, SV *sv_settings = &PL_sv_undef) #else int OPENSSL_init_ssl(uint64_t opts, SV *sv_settings = &PL_sv_undef) - CODE: + PREINIT: const OPENSSL_INIT_SETTINGS *settings = NULL; + CODE: if (sv_settings != &PL_sv_undef) settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings)); RETVAL = OPENSSL_init_ssl(opts, settings); @@ -3028,8 +3031,9 @@ OPENSSL_init_ssl(uint64_t opts, SV *sv_settings = &PL_sv_undef) int OPENSSL_init_crypto(uint64_t opts, SV *sv_settings = &PL_sv_undef) - CODE: + PREINIT: const OPENSSL_INIT_SETTINGS *settings = NULL; + CODE: if (sv_settings != &PL_sv_undef) settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings)); RETVAL = OPENSSL_init_crypto(opts, settings); @@ -8656,8 +8660,9 @@ OSSL_LIB_CTX_get0_global_default() OSSL_PROVIDER * OSSL_PROVIDER_load(SV *libctx, const char *name) - CODE: + PREINIT: OSSL_LIB_CTX *ctx = NULL; + CODE: if (libctx != &PL_sv_undef) ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx)); RETVAL = OSSL_PROVIDER_load(ctx, name); @@ -8668,8 +8673,9 @@ OSSL_PROVIDER_load(SV *libctx, const char *name) OSSL_PROVIDER * OSSL_PROVIDER_try_load(SV *libctx, const char *name, int retain_fallbacks) - CODE: + PREINIT: OSSL_LIB_CTX *ctx = NULL; + CODE: if (libctx != &PL_sv_undef) ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx)); RETVAL = OSSL_PROVIDER_try_load(ctx, name, retain_fallbacks); @@ -8683,8 +8689,9 @@ OSSL_PROVIDER_unload(OSSL_PROVIDER *prov) int OSSL_PROVIDER_available(SV *libctx, const char *name) - CODE: + PREINIT: OSSL_LIB_CTX *ctx = NULL; + CODE: if (libctx != &PL_sv_undef) ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx)); RETVAL = OSSL_PROVIDER_available(ctx, name); @@ -8695,8 +8702,8 @@ int OSSL_PROVIDER_do_all(SV *libctx, SV *perl_cb, SV *perl_cbdata = &PL_sv_undef) PREINIT: simple_cb_data_t* cbdata = NULL; - CODE: OSSL_LIB_CTX *ctx = NULL; + CODE: if (libctx != &PL_sv_undef) ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx)); -- cgit v1.2.3 From 8b952b306aad4feda9c8688210390c3ca73ac7b6 Mon Sep 17 00:00:00 2001 From: bulk88 Date: Mon, 3 Aug 2020 19:24:13 -0400 Subject: fix Win32 .lib/.a search loop fails to stop path search once file found -dates to day 1 commit cb98af3caf3b63d7125352aa13d18748ab20ee3a Fixed some compiler warnings. Courtesy kmx. Fixed a problem with Win32 detection. Courtesy kmx. git-svn-id: r334 Committer: Mike McCauley 2012-04-02 04:38:39 ----------------- this caused ----------------- C:\sources\p5-net-ssleay>perl Makefile.PL Do you want to run external tests? These tests *will* *fail* if you do not have network connectivity. [n] y *** Found OpenSSL-1.1.1g installed in C:\Program Files\OpenSSL-Win32 *** Be sure to use the same compiler and options to compile your OpenSSL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. Warning (mostly harmless): No library found for -llibeay32 Warning (mostly harmless): No library found for -lssleay32 Generating a gmake-style Makefile Writing Makefile for Net::SSLeay ------------------- With Shining Light precompiled OpenSSL and eventual there is a link failure since the lib file paths dont exist that are given to EUMM and EUMM eventually puts in MKF then fed to link.exe cmd line, since the $dir loop kept spinning and push new paths into %opts even though in an earlier iteration the .lib file was found on disk -fix a CC warning too about redefinition, perl core provides this flag automatic nowadays if the VC version is new enough to need this --- Makefile.PL | 4 ++-- SSLeay.xs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index ece548d..f6be63b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -274,14 +274,14 @@ EOM # Library names depend on the compiler @pairs = (['eay32','ssl32'],['crypto.dll','ssl.dll'],['crypto','ssl']) if $Config{cc} =~ /gcc/; @pairs = (['libeay32','ssleay32'],['libeay32MD','ssleay32MD'],['libeay32MT','ssleay32MT'],['libcrypto','libssl'],['crypto','ssl']) if $Config{cc} =~ /cl/; - for my $dir (@{$opts->{lib_paths}}) { + FOUND: for my $dir (@{$opts->{lib_paths}}) { for my $p (@pairs) { $found = 1 if ($Config{cc} =~ /gcc/ && -f "$dir/lib$p->[0].a" && -f "$dir/lib$p->[1].a"); $found = 1 if ($Config{cc} =~ /cl/ && -f "$dir/$p->[0].lib" && -f "$dir/$p->[1].lib"); if ($found) { $opts->{lib_links} = [$p->[0], $p->[1], 'crypt32']; # Some systems need this system lib crypt32 too $opts->{lib_paths} = [$dir]; - last; + last FOUND; } } } diff --git a/SSLeay.xs b/SSLeay.xs index 787892d..7646415 100644 --- a/SSLeay.xs +++ b/SSLeay.xs @@ -132,7 +132,10 @@ */ /* Prevent warnings about strncpy from Windows compilers */ -#define _CRT_SECURE_NO_DEPRECATE + +#ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +#endif /* Silence compound-token-split-by-macro warnings from perl.h when building for * Perl < 5.35.2 with Clang >= 12 - see GH-383 -- cgit v1.2.3 From 08f9fcd6fdfe24a1af130529fdf040ecc6d22d21 Mon Sep 17 00:00:00 2001 From: Heikki Vatiainen Date: Sat, 30 Dec 2023 15:51:56 +0200 Subject: GH-454 Add paths for current Shining Light OpenSSL in Makefile.PL. The current versions of Shining Light OpenSSL MSI installer use installation paths that are not in the list of prefixes tested by Makefile.PL. At the time of writing, the MSI installers are Win64OpenSSL-1_1_1w.msi, Win64OpenSSL-3_0_12.msi, Win64OpenSSL-3_1_4.msi and Win64OpenSSL-3_2_0.msi. The 32bit versions are named as Win32OpenSSL-1_1_1w.msi, etc. The exe installers seem to use the same locations as the msi installers. Caveats: static linking seems to require linking against libcrypto_static and libssl_static. The existing static compilation flag in Makefile.PL currently searches for libraries with a different path, instead of setting up linking to against specially named libraries. In other words, static linking seems to have changed and may change in the future. If you need static linking, you likely need to modify Makefile.PL to suit your needs. When both 32bit and 64bit Shining Light OpenSSL versions are installed, Makefile.PL prefix guessing can choose wrong prefix. In this case it's currently easiser to set OPENSSL_PREFIX environment variable. --- Changes | 9 +++++++++ Makefile.PL | 6 ++++++ README.Win32 | 28 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/Changes b/Changes index d1baa0c..0499175 100644 --- a/Changes +++ b/Changes @@ -141,6 +141,15 @@ Revision history for Perl extension Net::SSLeay. later. SSLeay.xs is likely compiled with compilers that do not support this, therefore such constructs are avoided in SSLeay.xs. Thanks to GitHub user bulk88 for the patch. + - Fix _CRT_SECURE_NO_DEPRECATE warning on Windows. Fix OpenSSL + library file path detection loop in Makefile.PL. Both thanks + to bulk88. + - Update Shining Light OpenSSL detection to work with OpenSSL + 1.1.1w, 3.0.12, 3.1.4 and 3.2.0 installers. Caveats: when + both 32bit and 64bit versions are installed, OpenSSL library + path detection may pick the wrong version. Static + compilation needs seems not to work with the these + versions. Thanks to bulk88 for the initial updates. 1.93_02 2023-02-22 - Update ppport.h to version 3.68. This eliminates thousands of diff --git a/Makefile.PL b/Makefile.PL index f6be63b..4cd41bc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -264,9 +264,13 @@ EOM if ($win_link_statically) { # Link to static libs push @{ $opts->{lib_paths} }, "$prefix/lib/VC/static" if -d "$prefix/lib/VC/static"; + push @{ $opts->{lib_paths} }, "$prefix/lib/VC/x86/MT" if -d "$prefix/lib/VC/x86/MT"; # Shining Light 32bit OpenSSL 3.2.0 + push @{ $opts->{lib_paths} }, "$prefix/lib/VC/x64/MT" if -d "$prefix/lib/VC/x64/MT"; # Shining Light 64bit OpenSSL 3.2.0 } else { push @{ $opts->{lib_paths} }, "$prefix/lib/VC" if -d "$prefix/lib/VC"; + push @{ $opts->{lib_paths} }, "$prefix/lib/VC/x86/MD" if -d "$prefix/lib/VC/x86/MD"; # Shining Light 32bit OpenSSL 3.2.0 + push @{ $opts->{lib_paths} }, "$prefix/lib/VC/x64/MD" if -d "$prefix/lib/VC/x64/MD"; # Shining Light 64bit OpenSSL 3.2.0 } my $found = 0; @@ -371,6 +375,8 @@ sub find_openssl_prefix { '/usr/sfw/bin/openssl' => '/usr/sfw', # Open Solaris 'C:\OpenSSL\bin\openssl.exe' => 'C:\OpenSSL', 'C:\OpenSSL-Win32\bin\openssl.exe' => 'C:\OpenSSL-Win32', + 'C:\Program Files (x86)\OpenSSL-Win32\bin\openssl.exe' => 'C:\Program Files (x86)\OpenSSL-Win32', # Shining Light 32bit OpenSSL 1.1.1w, 3.0.12, 3.1.4 and 3.2.0 + 'C:\Program Files\OpenSSL-Win64\bin\openssl.exe' => 'C:\Program Files\OpenSSL-Win64', # Shining Light 64bit OpenSSL 1.1.1w, 3.0.12, 3.1.4 and 3.2.0 $Config{prefix} . '\bin\openssl.exe' => $Config{prefix}, # strawberry perl $Config{prefix} . '\..\c\bin\openssl.exe' => $Config{prefix} . '\..\c', # strawberry perl '/sslexe/openssl.exe' => '/sslroot', # VMS, openssl.org diff --git a/README.Win32 b/README.Win32 index 02c42b3..d44f72a 100644 --- a/README.Win32 +++ b/README.Win32 @@ -40,6 +40,34 @@ perl Makefile.PL make ..... +0. Windows 11 version 23H2 + Visual Studio Community 2022 + 64bit and 32bit Perl 5.38.2 compiled with Visual Studio Community 2022 + Shining Light 64bit and 32bit OpenSSL 1.1.1w, 3.0.12, 3.1.4 and 3.2.0 + +Compile 64bit or 32bit Perl. +Install 64bit or 32bit Shining LightOpenSSL package. +Change to Net-SSLeay directory and do the following: + perl Makefile.PL + nmake + nmake test + nmake install + +Caution: Static linking seem to require updating library names to use +_static suffix with the aforementioned Shining Light OpenSSL +versions. Run the following command after nmake to see which +libraries and symbols are required to be dynamically loaded: + dumpbin /imports blib\arch\auto\Net\SSLeay\SSLeay.dll + +Library names and locations for static linking seem to vary between +installation methods (local compilation, Shinging Light, other OpenSSL +installers). Therefore Makefile.PL may not be able to keep up with all +the possibilities. + +Caution: When both 32bit and 64bit Shining Light (and possibly other) +OpenSSL package versions are installed, Makefile.PL may pick a wrong +location. Use OPENSSL_PREFIX environment variable in case of problems. + 1. Windows Server 2003 ActivePerl 5.8.8.820 VC++ 6.0 -- cgit v1.2.3 From e8b2f0864c20be0de7adbb9af87043fb3b257147 Mon Sep 17 00:00:00 2001 From: Heikki Vatiainen Date: Mon, 1 Jan 2024 22:43:53 +0200 Subject: GH-454 Tone down warning against mixing compilers and compiler flags. With Linux and macOS, for example, compiling OpenSSL and Net::SSLeay with gcc and clang appears to work these days. It's even possible to compile Net::SSLeay with a C++ compiler and link it against OpenSSL compiled with a C compiler. On some other platforms it may still be required to use matching compiler and flags, but it seems not to be universally required anymore. --- Changes | 5 +++++ Makefile.PL | 5 +++-- README | 11 +++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 0499175..b4887bd 100644 --- a/Changes +++ b/Changes @@ -150,6 +150,11 @@ Revision history for Perl extension Net::SSLeay. path detection may pick the wrong version. Static compilation needs seems not to work with the these versions. Thanks to bulk88 for the initial updates. + - Tone down Makefile.PL and README warning against mixing + compilers and flags when compiling OpenSSL, Perl and + Net::SSLeay. This may still be a requirement on some + platforms, but, for example, with Linux and macOS mixing + clang and gcc appears to work. 1.93_02 2023-02-22 - Update ppport.h to version 3.68. This eliminates thousands of diff --git a/Makefile.PL b/Makefile.PL index 4cd41bc..3112fdd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -256,8 +256,9 @@ sub ssleay_get_build_opts { } print < Date: Sun, 8 Oct 2023 05:48:28 -0400 Subject: Propose update to README for general case of needing to point to openssl header files in a non-standard location. --- README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README b/README index 618d6fa..a5380fd 100644 --- a/README +++ b/README @@ -60,6 +60,16 @@ it may be easier to use the same compiler and compiler options. Installing ---------- +General: +If your OpenSSL is installed in an unusual place, you can tell + Net-SSLeay where to find it with by setting the OPENSSL_PREFIX environment + variable. Example: + + export OPENSSL_PREFIX=/my/non-standard/path/usr + +The logic in Makefile.PL appends include/openssl to the environment +variable OPENSSL_PREFIX. + Unix: # build or install OpenSSL as per instructions in that package -- cgit v1.2.3 From 83b8cbdecfea714044fa5ecba766951847e96dfa Mon Sep 17 00:00:00 2001 From: Heikki Vatiainen Date: Mon, 1 Jan 2024 23:42:19 +0200 Subject: GH-454 Updates to README and README.OSX installation instructions. --- Changes | 2 ++ README | 47 ++++++++++++++++++++++++++--------------------- README.OSX | 15 ++++++++++++--- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/Changes b/Changes index b4887bd..de30d8e 100644 --- a/Changes +++ b/Changes @@ -155,6 +155,8 @@ Revision history for Perl extension Net::SSLeay. Net::SSLeay. This may still be a requirement on some platforms, but, for example, with Linux and macOS mixing clang and gcc appears to work. + - Add general installation instructions in README. Thanks to + GitHub user viviparous. Update README and README.OSX. 1.93_02 2023-02-22 - Update ppport.h to version 3.68. This eliminates thousands of diff --git a/README b/README index a5380fd..0a392fb 100644 --- a/README +++ b/README @@ -10,7 +10,6 @@ for the released versions: https://metacpan.org/release/Net-SSLeay for the latest and possibly unstable version from git: - https://github.com/radiator-software/p5-net-ssleay @@ -61,30 +60,36 @@ Installing ---------- General: -If your OpenSSL is installed in an unusual place, you can tell - Net-SSLeay where to find it with by setting the OPENSSL_PREFIX environment - variable. Example: + Makefile.PL tries to find OpenSSL installation location from a + number of pre-defined paths. It will print the version and + location of OpenSSL or LibreSSL it finds, or warn if it doesn't + find anything usable. + + If your OpenSSL is installed in an unusual place, you can tell + Makefile.PL from where to find it with by setting the + OPENSSL_PREFIX environment variable. + + On Linux, macOS and other Unix type systems: + OPENSSL_PREFIX=/home/mikem/playpen/openssl-1.0.2c perl Makefile.PL - export OPENSSL_PREFIX=/my/non-standard/path/usr + On Windows: + set OPENSSL_PREFIX=C:\playpen\openssl-1.0.2.c + perl Makefile.PL -The logic in Makefile.PL appends include/openssl to the environment -variable OPENSSL_PREFIX. + The logic in Makefile.PL tries to resolve the required + libraries and include directories based on the environment + variable OPENSSL_PREFIX. Unix: - # build or install OpenSSL as per instructions in that package + Build or install OpenSSL as per instructions in that + package. Review section 'General:' above before continuing. gunzip