CentOS build fixes to build in Cent7.

This commit is contained in:
Adam Ierymenko 2020-11-24 14:01:46 -08:00
parent 891815054c
commit bad1e0d529
2 changed files with 15 additions and 11 deletions

View file

@ -2068,7 +2068,7 @@ int __cdecl _tmain(int argc, _TCHAR* argv[])
int main(int argc,char **argv) int main(int argc,char **argv)
#endif #endif
{ {
#ifdef __LINUX__ #if defined(__LINUX__) && ( (!defined(__GLIBC__)) || ((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 18)) )
// This corrects for systems with abnormally small defaults (musl) and also // This corrects for systems with abnormally small defaults (musl) and also
// shrinks the stack on systems with large defaults to save a bit of memory. // shrinks the stack on systems with large defaults to save a bit of memory.
pthread_attr_t tattr; pthread_attr_t tattr;

View file

@ -43,18 +43,21 @@ like conventional VPNs or VLANs. It can run on native systems, VMs, or
containers (Docker, OpenVZ, etc.). containers (Docker, OpenVZ, etc.).
%prep %prep
#rm -rf * %if 0%{?rhel} >= 7
#ln -s %{getenv:PWD} %{name}-%{version} rm -rf *
#tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/* ln -s %{getenv:PWD} %{name}-%{version}
#rm -f %{name}-%{version} tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
#cp -a %{getenv:PWD}/* . rm -f %{name}-%{version}
cp -a %{getenv:PWD}/* .
%endif
%build %build
#%if 0%{?rhel} <= 7 #%if 0%{?rhel} <= 7
#make CFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" CXXFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest #make CFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" CXXFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
#%else #%else
#make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest %if 0%{?rhel} >= 7
#%endif make ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one
%endif
%pre %pre
%if 0%{?rhel} >= 7 %if 0%{?rhel} >= 7
@ -66,9 +69,13 @@ containers (Docker, OpenVZ, etc.).
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%if 0%{?rhel} < 7
pushd %{getenv:PWD} pushd %{getenv:PWD}
%endif
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
%if 0%{?rhel} < 7
popd popd
%endif
%if 0%{?rhel} >= 7 %if 0%{?rhel} >= 7
mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT%{_unitdir}
cp %{getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service cp %{getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
@ -157,9 +164,6 @@ esac
* Fri Aug 23 2019 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.4.4-0.1 * Fri Aug 23 2019 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.4.4-0.1
- see https://github.com/zerotier/ZeroTierOne for release notes - see https://github.com/zerotier/ZeroTierOne for release notes
* Mon Aug 04 2019 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.4.2-0.1
- see https://github.com/zerotier/ZeroTierOne for release notes
* Mon Jul 29 2019 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.4.0-0.1 * Mon Jul 29 2019 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.4.0-0.1
- see https://github.com/zerotier/ZeroTierOne for release notes - see https://github.com/zerotier/ZeroTierOne for release notes