Source
86
86
[
87
87
if test "$withval" = "no"; then
88
88
want_openssl="no"
89
89
_libopenssl_dir="no"
90
90
elif test "$withval" = "yes"; then
91
91
want_openssl="yes"
92
92
_libopenssl_dir="no"
93
93
else
94
94
want_openssl="yes"
95
95
_libopenssl_dir=$withval
96
-
_libopenssl_dir_lib="$withval/lib"
96
+
if test -d $withval/lib64; then
97
+
_libopenssl_dir_lib=$withval/lib64
98
+
elif test -d $withval/lib/64; then
99
+
_libopenssl_dir_lib=$withval/lib/64
100
+
else
101
+
_libopenssl_dir_lib=$withval/lib
102
+
fi
97
103
fi
98
104
accept_openssl_version="no"
99
105
mt_required=$2
100
106
],[want_openssl=ifelse([$1],,[no],[$1])]
101
107
)
102
108
103
109
if test "x$want_openssl" = "xyes"; then
104
110
105
111
if test "x$enable_static_libs" = "xyes"; then
106
112
test "x$static_linking_support" = "xno" -a -z "$_libopenssl_dir_lib" && AC_MSG_ERROR(["OpenSSL: Compiler not support statically linked libs from default folders"])
107
113
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
108
114
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG()], [:])
109
115
test -z "$PKG_CONFIG" -a -z "$_libopenssl_dir_lib" && AC_MSG_ERROR([Not found pkg-config library])
110
-
_libopenssl_dir_lib_64="$_libopenssl_dir_lib/64"
111
-
test -d "$_libopenssl_dir_lib_64" && _libopenssl_dir_lib="$_libopenssl_dir_lib_64"
112
116
m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
113
117
fi
114
118
115
119
AC_MSG_CHECKING(for OpenSSL support)
116
120
if test "x$_libopenssl_dir" = "xno"; then # if OpenSSL directory is not specified
117
121
if test -f /usr/local/include/openssl/ssl.h -a -f /usr/local/include/openssl/crypto.h; then
118
122
OPENSSL_CFLAGS=-I/usr/local/include
119
123
OPENSSL_LDFLAGS=-L/usr/local/lib
120
124
OPENSSL_LIBS="-lssl -lcrypto"
121
125
found_openssl="yes"
126
130
OPENSSL_LIBS="-lssl -lcrypto"
127
131
found_openssl="yes"
128
132
LIBOPENSSL_ACCEPT_VERSION([/usr/include/openssl/opensslv.h], [$mt_required])
129
133
else # libraries are not found in default directories
130
134
found_openssl="no"
131
135
AC_MSG_RESULT(no)
132
136
fi
133
137
else # search in the specified OpenSSL directory
134
138
if test -f $_libopenssl_dir/include/openssl/ssl.h -a -f $_libopenssl_dir/include/openssl/crypto.h; then
135
139
OPENSSL_CFLAGS=-I$_libopenssl_dir/include
136
-
137
-
if test -d $_libopenssl_dir/lib64; then
138
-
OPENSSL_LDFLAGS=-L$_libopenssl_dir/lib64
139
-
elif test -d $_libopenssl_dir/lib/64; then
140
-
OPENSSL_LDFLAGS=-L$_libopenssl_dir/lib/64
141
-
else
142
-
OPENSSL_LDFLAGS=-L$_libopenssl_dir/lib
143
-
fi
144
-
140
+
OPENSSL_LDFLAGS=-L$_libopenssl_dir_lib
145
141
OPENSSL_LIBS="-lssl -lcrypto"
146
142
found_openssl="yes"
147
143
LIBOPENSSL_ACCEPT_VERSION([$_libopenssl_dir/include/openssl/opensslv.h], [$mt_required])
148
144
else # libraries are not found in specified directories
149
145
found_openssl="no"
150
146
AC_MSG_RESULT(no)
151
147
fi
152
148
fi
153
149
fi
154
150