diff --git a/Makefile b/Makefile
index c8cd86257..78e9f5aa8 100644
--- a/Makefile
+++ b/Makefile
@@ -72,11 +72,11 @@ linux-prepare::
if [ "x$$BINFMT_WARN" = "xyes" ]; then \
cat Documentation/binfmt_misc-warning-Linux.txt ; \
fi; \
- if [ -f build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO).sh ]; then \
- sh build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO).sh; \
- elif [ -f build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO)-$(LINUX_DISTRO_RELEASE).sh ]; then \
+ if [ -f build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO)-$(LINUX_DISTRO_RELEASE).sh ]; then \
sh build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO)-$(LINUX_DISTRO_RELEASE).sh; \
- fi; \
+ elif [ -f build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO).sh ]; then \
+ sh build-tools/scripts/dependencies/linux-prepare-$(LINUX_DISTRO).sh; \
+ fi
# $(call GetPath,path)
GetPath = $(shell $(MSBUILD) $(MSBUILD_FLAGS) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:Get$(1)FullPath build-tools/scripts/Paths.targets | tr -d '[[:space:]]' )
diff --git a/build-tools/libzip/libzip.props b/build-tools/libzip/libzip.props
index c6664ceb2..8d25ac6c0 100644
--- a/build-tools/libzip/libzip.props
+++ b/build-tools/libzip/libzip.props
@@ -1,6 +1,6 @@
- <_LinuxBuildLibZip Condition=" '$(_LinuxBuildLibZip)' == '' AND '$(HostOS)' == 'Linux' AND '$(HostOsName)' != 'Ubuntu' ">true
+ <_LinuxBuildLibZip Condition=" '$(_LinuxBuildLibZip)' == '' AND '$(HostOS)' == 'Linux' AND '$(HostOsFlavor)' != 'Debian' ">true
diff --git a/build-tools/scripts/dependencies/debian-common.sh b/build-tools/scripts/dependencies/debian-common.sh
new file mode 100644
index 000000000..c2a0e56cd
--- /dev/null
+++ b/build-tools/scripts/dependencies/debian-common.sh
@@ -0,0 +1,47 @@
+DEBIAN_COMMON_DEPS="autoconf
+ autotools-dev
+ automake
+ clang
+ curl
+ g++-mingw-w64
+ gcc-mingw-w64
+ git
+ libtool
+ libz-mingw-w64-dev
+ libzip4
+ linux-libc-dev
+ make
+ openjdk-8-jdk
+ unzip
+ vim-common
+ "
+
+if [ "$OS_ARCH" = "x86_64" ]; then
+UBUNTU_DEPS="$UBUNTU_DEPS
+ lib32stdc++6
+ lib32z1
+ gcc-multilib
+ g++-multilib
+ "
+fi
+
+debian_install()
+{
+ if [ "$NO_SUDO" = "true" ]; then
+ for p in $DISTRO_DEPS; do
+ if dpkg -l $p > /dev/null 2>&1 ; then
+ echo "[INSTALLED] $p"
+ else
+ echo "[ MISSING ] $p"
+ PACKAGES_MISSING=yes
+ fi
+ done
+ if [ "x$PACKAGES_MISSING" = "xyes" ]; then
+ echo Some packages are missing, cannot continue
+ echo
+ exit 1
+ fi
+ else
+ sudo apt-get -f -u install $DISTRO_DEPS
+ fi
+}
diff --git a/build-tools/scripts/dependencies/linux-prepare-Debian.sh b/build-tools/scripts/dependencies/linux-prepare-Debian.sh
new file mode 100644
index 000000000..dbe008f67
--- /dev/null
+++ b/build-tools/scripts/dependencies/linux-prepare-Debian.sh
@@ -0,0 +1,7 @@
+. "`dirname $0`"/debian-common.sh
+
+DISTRO_DEPS="$DEBIAN_COMMON_DEPS \
+ zlib1g-dev
+"
+
+debian_install
diff --git a/build-tools/scripts/dependencies/linux-prepare-Ubuntu.sh b/build-tools/scripts/dependencies/linux-prepare-Ubuntu.sh
index 1d2911ae0..2b2dd8ffa 100644
--- a/build-tools/scripts/dependencies/linux-prepare-Ubuntu.sh
+++ b/build-tools/scripts/dependencies/linux-prepare-Ubuntu.sh
@@ -1,46 +1,13 @@
-UBUNTU_DEPS="autoconf
- autotools-dev
- automake
- clang
- curl
- g++-mingw-w64
- gcc-mingw-w64
- git
- libtool
- libz-mingw-w64-dev
- libzip4
- linux-libc-dev
- make
- openjdk-8-jdk
- unzip
- vim-common
- "
+. "`dirname $0`"/debian-common.sh
+
+DISTRO_DEPS="$DEBIAN_COMMON_DEPS"
if [ "$OS_ARCH" = "x86_64" ]; then
-UBUNTU_DEPS="$UBUNTU_DEPS
- lib32stdc++6
- lib32z1
- gcc-multilib
- g++-multilib
- libx32tinfo-dev
- linux-libc-dev:i386
+DISTRO_DEPS="$DISTRO_DEPS
+ libx32tinfo-dev
+ linux-libc-dev:i386
zlib1g-dev:i386
"
-fi
-if [ "$NO_SUDO" = "true" ]; then
- for p in $UBUNTU_DEPS; do
- if dpkg -l $p > /dev/null 2>&1 ; then
- echo "[INSTALLED] $p"
- else
- echo "[ MISSING ] $p"
- PACKAGES_MISSING=yes
- fi
- done
- if [ "x$PACKAGES_MISSING" = "xyes" ]; then
- echo Some packages are missing, cannot continue
- echo
- exit 1
- fi
-else
- sudo apt-get -f -u install $UBUNTU_DEPS
fi
+
+debian_install
diff --git a/build-tools/scripts/generate-os-info b/build-tools/scripts/generate-os-info
index c471a67ab..3bfb67eab 100755
--- a/build-tools/scripts/generate-os-info
+++ b/build-tools/scripts/generate-os-info
@@ -37,6 +37,11 @@ function getInfo_Linux()
OS_RELEASE="`lsb_release -rs`"
fi
+ case "$OS_NAME" in
+ Ubuntu|Debian) HOST_OS_FLAVOR=Debian ;;
+ *) OS_FLAVOR=Generic ;;
+ esac
+
HOST_CPUS="`nproc`"
if echo $compiler_version | grep -i "Free Software Foundation" > /dev/null 2>&1; then
@@ -89,6 +94,7 @@ function getInfo_Darwin()
HOST_CXX32="clang++ -m32"
HOST_CC64=clang
HOST_CXX64=clang++
+ HOST_OS_FLAVOR=macOS
}
if [ -z "$1" ]; then
@@ -108,6 +114,7 @@ cat < "$1"
$OS_TYPE
$OS_NAME
+ $HOST_OS_FLAVOR
$OS_RELEASE
$HOST_TRIPLET
$HOST_TRIPLET32