Browse Source

make-release: Only try to include libmicrohttpd if bfgminer.exe depends on it

Luke Dashjr 12 years ago
parent
commit
0c22a43037
1 changed files with 19 additions and 11 deletions
  1. 19 11
      make-release

+ 19 - 11
make-release

@@ -57,11 +57,13 @@ dlls='
 	libcurl-4.dll
 	libcurl-4.dll
 	pthreadGC2.dll
 	pthreadGC2.dll
 	libjansson-4.dll
 	libjansson-4.dll
-	libmicrohttpd-10.dll
-	libplibc-1.dll
 	libusb-1.0.dll
 	libusb-1.0.dll
 	zlib1.dll
 	zlib1.dll
 '
 '
+libmicrohttpd_dlls='
+	libmicrohttpd-10.dll
+	libplibc-1.dll
+'
 docs='
 docs='
 	AUTHORS
 	AUTHORS
 	COPYING
 	COPYING
@@ -84,15 +86,6 @@ for build in "${builds[@]}"; do
 	if test "x$DEBUG_RELEASE" = "x1"; then
 	if test "x$DEBUG_RELEASE" = "x1"; then
 		CFLAGS="${CFLAGS} -g"
 		CFLAGS="${CFLAGS} -g"
 	fi
 	fi
-	for dll in $dlls; do
-		libdir="/usr/$machine/usr/lib"
-		[ -e "$libdir/$dll" ] ||
-			libdir="/usr/$machine/usr/bin"
-		[ -e "$libdir/$dll" ] ||
-			continue
-		cp -v -L "$libdir/$dll" "$PKGDIR"
-		"$machine"-strip "$PKGDIR/$dll"
-	done
 	for doc in $docs; do
 	for doc in $docs; do
 		sed 's/$/\r/' <"$doc" >"$PKGDIR/${doc}.txt"
 		sed 's/$/\r/' <"$doc" >"$PKGDIR/${doc}.txt"
 	done
 	done
@@ -125,6 +118,21 @@ for build in "${builds[@]}"; do
 		windows-build.txt \
 		windows-build.txt \
 		miner.php \
 		miner.php \
 		"$PKGDIR/"
 		"$PKGDIR/"
+	
+	mydlls="$dlls"
+	if "${machine}-objdump" -p bfgminer.exe | grep -q "DLL Name: libmicrohttpd"; then
+		mydlls="$mydlls $libmicrohttpd_dlls"
+	fi
+	for dll in $mydlls; do
+		libdir="/usr/$machine/usr/lib"
+		[ -e "$libdir/$dll" ] ||
+			libdir="/usr/$machine/usr/bin"
+		[ -e "$libdir/$dll" ] ||
+			continue
+		cp -v -L "$libdir/$dll" "$PKGDIR"
+		"$machine"-strip "$PKGDIR/$dll"
+	done
+	
 	make clean
 	make clean
 	cd "$PKGDIR/.."
 	cd "$PKGDIR/.."
 	zip -r "$OUTDIR/$PKGNAME.zip" "$PKGNAME"
 	zip -r "$OUTDIR/$PKGNAME.zip" "$PKGNAME"