Index: /main/trunk/greenstone2/build-src/packages/Makefile
===================================================================
--- /main/trunk/greenstone2/build-src/packages/Makefile	(revision 31829)
+++ /main/trunk/greenstone2/build-src/packages/Makefile	(revision 31830)
@@ -43,4 +43,9 @@
 		xlhtml/xlhtml-0.4.9.0 isis-gdl html-tidy/tidy
 OPENSSL_PKG = openssl/openssl-1.0.2l
+# When doing make clean, remove OpenSSL products too
+OPENSSL_PRODUCTS = certs man misc private openssl.cnf
+# The key OpenSSL products bin, include, lib folders no longer live in
+# gs2build/bin/linux, but in the same location as the rest, so add that:
+OPENSSL_PRODUCTS += bin include lib
 
 all:
@@ -67,4 +72,4 @@
           (cd $$subdir && $(MAKE) distclean || exit 0) ; \
         done
-	(cd openssl && rm -rf certs man misc private openssl.cnf || exit 0)
+	(cd openssl && rm -rf $(OPENSSL_PRODUCTS) || exit 0)
 	rm -rf $(OPENSSL_PKG)
Index: /main/trunk/greenstone2/build-src/packages/Makefile.in
===================================================================
--- /main/trunk/greenstone2/build-src/packages/Makefile.in	(revision 31829)
+++ /main/trunk/greenstone2/build-src/packages/Makefile.in	(revision 31830)
@@ -43,4 +43,9 @@
 		xlhtml/xlhtml-0.4.9.0 isis-gdl html-tidy/tidy
 OPENSSL_PKG = openssl/openssl-1.0.2l
+# When doing make clean, remove OpenSSL products too
+OPENSSL_PRODUCTS = certs man misc private openssl.cnf
+# The key OpenSSL products bin, include, lib folders no longer live in
+# gs2build/bin/linux, but in the same location as the rest, so add that:
+OPENSSL_PRODUCTS += bin include lib
 
 all:
@@ -67,4 +72,4 @@
           (cd $$subdir && $(MAKE) distclean || exit 0) ; \
         done
-	(cd openssl && rm -rf certs man misc private openssl.cnf || exit 0)
+	(cd openssl && rm -rf $(OPENSSL_PRODUCTS) || exit 0)
 	rm -rf $(OPENSSL_PKG)
Index: /main/trunk/greenstone2/build-src/packages/configure
===================================================================
--- /main/trunk/greenstone2/build-src/packages/configure	(revision 31829)
+++ /main/trunk/greenstone2/build-src/packages/configure	(revision 31830)
@@ -163,7 +163,8 @@
 # --prefix indicates where the generated lib, include and bin folders will go
 # --openssldir will contain the manuals and other non-essentials
-# we'll put them into $bindir/openssl for wget to use
-echo ./config --prefix=$bindir/openssl --openssldir=$PACKAGES/openssl no-shared
-./config --prefix=$bindir/openssl --openssldir=$PACKAGES/openssl no-shared
+# 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
 # make
 echo make
@@ -280,12 +281,12 @@
 
 # for wget-1.15-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
-echo CPPFLAGS="-I/$bindir/openssl/include" LDFLAGS="-L/$bindir/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/$bindir/openssl/include" LDFLAGS="-L/$bindir/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/$bindir/openssl/include" OPENSSL_LIBS="-L/$bindir/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$bindir/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/$bindir/openssl/include" OPENSSL_LIBS="-L/$bindir/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$bindir/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
 
 ##
