# Compiling nginx with zlib-1.2.6 error

**URL:** <https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973>\
**Category:** NGINX\
**Created:** [April 17, 2012, 5:57pm UTC](https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973 "2012-04-17T17:57:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 17, 2012, 5:57pm UTC](https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973/1 "2012-04-17T17:57:38Z")

</div>

Hello,  
I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11  
platform and received the following error.

gmake  
.  
.  
.  
cd …/zlib-1.2.6   
&& gmake distclean   
&& CFLAGS="-O2 -fomit-frame-pointer -pipe " CC=“gcc”   
./configure   
&& gmake libz.a  
gmake[2]: Entering directory `/home/produser/Downloads/zlib-1.2.6' make -f Makefile.in distclean make: Fatal error in reader: Makefile.in, line 57: Unexpected end of line seen Current working directory /home/produser/Downloads/zlib-1.2.6 gmake[2]: *** [distclean] Error 1 gmake[2]: Leaving directory`/home/produser/Downloads/zlib-1.2.6’  
gmake[1]: \*\*\* […/zlib-1.2.6/libz.a] Error 2  
gmake[1]: Leaving directory `/home/produser/Downloads/nginx-1.0.15’  
gmake: \*\*\* [build] Error 2

Pleae advise what I should do. There were many many bug fixes and  
enhancements to zlib 1.2.6 over the 1.2.5 and would like to know if its  
going to work or not.

Tank you,  
Allan

---

<div class="post-metadata">

**Author:** ![Allan\_Davy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3e96dc/32.png) [@Allan\_Davy](https://www.ruby-forum.com/u/Allan_Davy)\
**Post date:** [April 17, 2012, 6:21pm UTC](https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973/2 "2012-04-17T18:21:48Z")

</div>

On 17.04.2012, at 19:56, Allan Davy wrote:

> Hello,  
> I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform and  
> received the following error.

I doubt you will be able to build static library on solaris 10 or 11.  
Try to build or install new dynamic zlib 1.2.6 and run nginx with  
LD\_PRELOAD hack:  
LD\_PRELOAD=/path/to/new/libz.so nginx

---

<div class="post-metadata">

**Author:** ![Allan\_Davy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3e96dc/32.png) [@Allan\_Davy](https://www.ruby-forum.com/u/Allan_Davy)\
**Post date:** [April 17, 2012, 6:57pm UTC](https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973/3 "2012-04-17T18:57:11Z")

</div>

Hello!

On Tue, Apr 17, 2012 at 08:21:15PM +0400, Sergey B. wrote:

> On 17.04.2012, at 19:56, Allan Davy wrote:
> 
> > Hello,  
> > I attempted to compile nginx-1.0.15 with zlib-1.2.6 on a Solaris 11 platform  
> > and received the following error.
> 
> I doubt you will be able to build static library on solaris 10 or 11.  
> Try to build or install new dynamic zlib 1.2.6 and run nginx with LD\_PRELOAD  
> hack:  
> LD\_PRELOAD=/path/to/new/libz.so nginx

It builds fine with zlib 1.2.5. The problem is in zlib 1.2.6  
Makefile / Makefile.in, see my reply.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Allan\_Davy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3e96dc/32.png) [@Allan\_Davy](https://www.ruby-forum.com/u/Allan_Davy)\
**Post date:** [April 17, 2012, 6:49pm UTC](https://www.ruby-forum.com/t/compiling-nginx-with-zlib-1-2-6-error/218973/4 "2012-04-17T18:49:05Z")

</div>

Hello!

On Tue, Apr 17, 2012 at 10:56:54AM -0500, Allan Davy wrote:

> ```
> ./configure \
> 
> ```
> 
> Pleae advise what I should do. There were many many bug fixes  
> and enhancements to zlib 1.2.6 over the 1.2.5 and would like to  
> know if its going to work or not.

As usual, “many bug fixes” means “old bugs fixed, new bugs added”.  
The zlib-1.2.6’s Makefile.in now can’t be parsed by Solaris’s make,  
but shipped Makefile calls “make” as a hardcoded command for  
distclean target. You may try the following patch (against  
zlib-1.2.6) to see if it helps (and report the problem to zlib  
folks):

— Makefile.orig Tue Apr 17 20:39:34 2012  
+++ Makefile Tue Apr 17 20:39:48 2012  
@@ -2,4 +2,4 @@  
-@echo “Please use ./configure first. Thank you.”

distclean:

- 

```
  make -f Makefile.in distclean

```

- 

```
  ${MAKE} -f Makefile.in distclean

```

If you want to just compile nginx, the fix should be as trivial as  
running ./configure in zlib’s directory once.

Maxim D.
