Skip to content

Commit

Permalink
Add openssl_prefix to Configure and friends
Browse files Browse the repository at this point in the history
In order to add TLS to the core, we need a library, and OpenSSL is
as ubiquitous as it gets.  So detect where it is with logic
borrowed from Net::SSLeay.
  • Loading branch information
craigberry committed Dec 10, 2024
1 parent 9e152df commit c2dc47d
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ uvoformat=''
uvuformat=''
uvxformat=''
pidtype=''
openssl_prefix=''
prefix=''
prefixexp=''
installprivlib=''
Expand Down Expand Up @@ -5356,6 +5357,15 @@ none) libs=' ';;
*) libs="$ans";;
esac

: see if OpenSSL is available
for thisdir in $libpth; do
p=$(dirname $thisdir) # parent of lib/ directory
if test -x "$p/bin/openssl$exe_ext" || test -x "$p/sbin/openssl$exe_ext"; then
openssl_prefix=$p
break
fi
done

: determine optimization, if desired, or use for debug flag also
case "$optimize" in
' '|$undef) dflt='none';;
Expand Down Expand Up @@ -25795,6 +25805,7 @@ nvtype='$nvtype'
o_nonblock='$o_nonblock'
obj_ext='$obj_ext'
old_pthread_create_joinable='$old_pthread_create_joinable'
openssl_prefix='$openssl_prefix'
optimize='$optimize'
orderlib='$orderlib'
osname='$osname'
Expand Down
1 change: 1 addition & 0 deletions Cross/config.sh-arm-linux
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
openssl_prefix=''
optimize='-O2'
orderlib='false'
osname='linux'
Expand Down
1 change: 1 addition & 0 deletions Cross/config.sh-arm-linux-n770
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.armo'
old_pthread_create_joinable=''
openssl_prefix=''
optimize='-O2'
orderlib='false'
osname='linux'
Expand Down
1 change: 1 addition & 0 deletions Porting/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ nvtype='__float128'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
openssl_prefix=''
optimize='-O2'
orderlib='false'
osname='linux'
Expand Down
9 changes: 9 additions & 0 deletions configure.com
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,14 @@ $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
$ IF ans.eqs."decc" THEN Has_Dec_C_Sockets = "T"
$ ENDIF
$!
$! If openssl is a concealed device name, that "device" is the root
$! of our OpenSSL installation.
$ IF F$TRNLNM(F$PARSE("openssl",,,"DEVICE") - ":",,,,,"CONCEALED")
$ THEN
$ openssl_prefix = "/" + F$PARSE("openssl",,,"DEVICE") - ":"
$ ELSE
$ openssl_prefix = ""
$ ENDIF
$!
$! Ask if they want to build with VMS_DEBUG perl
$ echo ""
Expand Down Expand Up @@ -6675,6 +6683,7 @@ $ WC "obj_ext='" + obj_ext + "'"
$ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
$ WC "oldarchlib='" + oldarchlib + "'"
$ WC "oldarchlibexp='" + oldarchlibexp + "'"
$ WC "openssl_prefix='" + openssl_prefix + "'"
$ WC "optimize='" + optimize + "'"
$ WC "osname='" + osname + "'"
$ WC "osvers='" + osvers + "'"
Expand Down
10 changes: 10 additions & 0 deletions win32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ EXTRALIBDIRS =
#
#EMAIL =

# Try to locate OpenSSL installation, if any.
!IF EXISTS($(PROGRAMFILES)\OpenSSL-Win64\bin\openssl.exe) && "$(WIN64)" == "define"
OPENSSL_PREFIX = $(PROGRAMFILES)\OpenSSL-Win64
!ELSEIF EXISTS($(PROGRAMFILES)\OpenSSL-Win32\bin\openssl.exe)
OPENSSL_PREFIX = $(PROGRAMFILES)\OpenSSL-Win32
!ELSE
OPENSSL_PREFIX =
!ENDIF

##
## Build configuration ends.
##
Expand Down Expand Up @@ -822,6 +831,7 @@ CFG_VARS = \
"libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")" \
"libc=$(LIBC)" \
"make=$(MAKE_BARE)" \
"openssl_prefix=$(OPENSSL_PREFIX)" \
"static_ext=$(STATIC_EXT)" \
"usethreads=$(USE_ITHREADS)" \
"useithreads=$(USE_ITHREADS)" \
Expand Down
1 change: 1 addition & 0 deletions win32/config.gc
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
openssl_prefix=''
optimize='-O2'
orderlib='false'
osname='MSWin32'
Expand Down
1 change: 1 addition & 0 deletions win32/config.vc
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
old_pthread_create_joinable=''
openssl_prefix=''
optimize='-O'
orderlib='false'
osname='MSWin32'
Expand Down

0 comments on commit c2dc47d

Please sign in to comment.