Skip to content

Fix build on Debian #1060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:]]' )
Expand Down
2 changes: 1 addition & 1 deletion build-tools/libzip/libzip.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LinuxBuildLibZip Condition=" '$(_LinuxBuildLibZip)' == '' AND '$(HostOS)' == 'Linux' AND '$(HostOsName)' != 'Ubuntu' ">true</_LinuxBuildLibZip>
<_LinuxBuildLibZip Condition=" '$(_LinuxBuildLibZip)' == '' AND '$(HostOS)' == 'Linux' AND '$(HostOsFlavor)' != 'Debian' ">true</_LinuxBuildLibZip>
</PropertyGroup>
</Project>
47 changes: 47 additions & 0 deletions build-tools/scripts/dependencies/debian-common.sh
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 7 additions & 0 deletions build-tools/scripts/dependencies/linux-prepare-Debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
. "`dirname $0`"/debian-common.sh

DISTRO_DEPS="$DEBIAN_COMMON_DEPS \
zlib1g-dev
"

debian_install
49 changes: 8 additions & 41 deletions build-tools/scripts/dependencies/linux-prepare-Ubuntu.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions build-tools/scripts/generate-os-info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -108,6 +114,7 @@ cat <<EOF > "$1"
<PropertyGroup>
<HostOS Condition=" '\$(HostOS)' == '' ">$OS_TYPE</HostOS>
<HostOsName Condition=" '\$(HostOsName)' == '' ">$OS_NAME</HostOsName>
<HostOsFlavor Condition=" '\$(HostOsFlavor)' == '' ">$HOST_OS_FLAVOR</HostOsFlavor>
<HostOsRelease Condition=" '\$(HostOsRelease)' == '' ">$OS_RELEASE</HostOsRelease>
<HostTriplet Condition=" '\$(HostTriplet)' == '' ">$HOST_TRIPLET</HostTriplet>
<HostTriplet32 Condition=" '\$(HostTriplet32)' == '' ">$HOST_TRIPLET32</HostTriplet32>
Expand Down