Index: /main/trunk/greenstone2/build-src/packages/Makefile
===================================================================
--- /main/trunk/greenstone2/build-src/packages/Makefile	(revision 31832)
+++ /main/trunk/greenstone2/build-src/packages/Makefile	(revision 31833)
@@ -42,5 +42,7 @@
 		wget/wget-1.17.1-gs cpan/XML-Parser-2.41 \
 		xlhtml/xlhtml-0.4.9.0 isis-gdl html-tidy/tidy
+
 OPENSSL_PKG = openssl/openssl-1.0.2l
+#OPENSSL_PKG = openssl/openssl-1.1.0f
 # When doing make clean, remove OpenSSL products too
 OPENSSL_PRODUCTS = certs man misc private openssl.cnf
Index: /main/trunk/greenstone2/build-src/packages/Makefile.in
===================================================================
--- /main/trunk/greenstone2/build-src/packages/Makefile.in	(revision 31832)
+++ /main/trunk/greenstone2/build-src/packages/Makefile.in	(revision 31833)
@@ -42,5 +42,7 @@
 		wget/wget-1.17.1-gs cpan/XML-Parser-2.41 \
 		xlhtml/xlhtml-0.4.9.0 isis-gdl html-tidy/tidy
+
 OPENSSL_PKG = openssl/openssl-1.0.2l
+#OPENSSL_PKG = openssl/openssl-1.1.0f
 # When doing make clean, remove OpenSSL products too
 OPENSSL_PRODUCTS = certs man misc private openssl.cnf
Index: /main/trunk/greenstone2/build-src/packages/configure
===================================================================
--- /main/trunk/greenstone2/build-src/packages/configure	(revision 31832)
+++ /main/trunk/greenstone2/build-src/packages/configure	(revision 31833)
@@ -155,16 +155,24 @@
   gzip -dc $openssl_pkgname.tar.gz | tar -xf -
 fi
-cd openssl-1.0.2l
+cd $openssl_pkgname
 
 # configure
 # see the INSTALL file for OpenSSL to see config options for openssl
-# If you ever want to have the .a libraries that building openssl generates,
-# then use the --prefix and point it to the $bindir.
 # --prefix indicates where the generated lib, include and bin folders will go
 # --openssldir will contain the manuals and other non-essentials
-# We don't need to put them into $bindir/openssl for wget to use, since wget is built
-# against openssl's static libraries and therefore wget doesn't need these when running
-echo ./config --openssldir=$PACKAGES/openssl no-shared
-./config --openssldir=$PACKAGES/openssl no-shared
+# BEWARE: The defaults for --prefix and meaning of --openssldir differ between
+# versions of openssl. In the earlier version (1.0.* like 1.0.2l), if
+# --prefix is not supplied then the generated lib, include and bin folders
+# will also go into --openssldir.
+# In the newer version 1.1.* 1.1.0f, if --prefix is not supplied, it will
+# try to install the generated lib, include and bin folders into a system place.
+# So better to provide both --opennssldir and --prefix, for both openssl versions
+# to compile succesfully.
+# If you ever want to have the .a libraries that building openssl generates,
+# then point the --prefix to the $bindir. We currently don't need to put them
+# into $bindir/openssl for wget to use, since wget is built against openssl's
+# static libraries and therefore wget doesn't need these when running.
+echo ./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
+./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
 # make
 echo make
@@ -281,12 +289,12 @@
 
 # for wget-1.15-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
-##echo CPPFLAGS="-I/$PACKAGES/openssl/include" LDFLAGS="-L/$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraarg
+##echo CPPFLAGS="-I$PACKAGES/openssl/include" LDFLAGS="-L$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraarg
 ##cd "$PACKAGES/wget/$wget_pkgname" && \
-##CPPFLAGS="-I/$PACKAGES/openssl/include" LDFLAGS="-L/$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
+##CPPFLAGS="-I$PACKAGES/openssl/include" LDFLAGS="-L$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
 
 # for wget-1.17.1-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
-echo OPENSSL_CFLAGS="-I/$PACKAGES/openssl/include" OPENSSL_LIBS="-L/$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
+echo OPENSSL_CFLAGS="-I$PACKAGES/openssl/include" OPENSSL_LIBS="-L$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
 cd "$PACKAGES/wget/$wget_pkgname" && \
-OPENSSL_CFLAGS="-I/$PACKAGES/openssl/include" OPENSSL_LIBS="-L/$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir"  -disable-nls $HOSTTARGETFLAGS $wget_extraargs
+OPENSSL_CFLAGS="-I$PACKAGES/openssl/include" OPENSSL_LIBS="-L$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir"  -disable-nls $HOSTTARGETFLAGS $wget_extraargs
 
 
