Author: mladen.turk(a)jboss.com
Date: 2007-12-13 03:27:59 -0500 (Thu, 13 Dec 2007)
New Revision: 1194
Modified:
trunk/build/unix/build.sh
trunk/srclib/zlib/NMAKEmakefile
Log:
Fix zlib build
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2007-12-13 07:47:12 UTC (rev 1193)
+++ trunk/build/unix/build.sh 2007-12-13 08:27:59 UTC (rev 1194)
@@ -42,7 +42,7 @@
has_posix_tar=true
# parameters
-has_zlib=false
+has_zlib=true
has_openssl=false
has_apr=true
has_apu=true
@@ -652,6 +652,12 @@
echo "Building binaries at `pwd`"
dst_dir=$1
+ if $has_zlib; then
+ buildzlib srclib/zlib-${zlib_version} false
+ if $has_static ; then
+ builzlib srclib/zlib-${zlib_version} true
+ fi
+ fi
# apr-util has a --with-openssl=DIR so we must be build openssl before apu.
ls srclib | grep openssl >/dev/null
if [ $? -eq 0 ]; then
@@ -794,6 +800,9 @@
if $has_apu; then
cp ../../srclib/apr-util/NMAKEmakefile
$package_src_dir/srclib/apr-util-${apu_version}/
fi
+if $has_zlib; then
+ cp ../../srclib/zlib/NMAKEmakefile $package_src_dir/srclib/zlib-${zlib_version}/
+fi
# Build the source tarball
buildtar ${build_working_dir} ${package_src_name} ${build_output_dir}
${package_src_name}
Modified: trunk/srclib/zlib/NMAKEmakefile
===================================================================
--- trunk/srclib/zlib/NMAKEmakefile 2007-12-13 07:47:12 UTC (rev 1193)
+++ trunk/srclib/zlib/NMAKEmakefile 2007-12-13 08:27:59 UTC (rev 1194)
@@ -26,12 +26,14 @@
# ====================================================================
#
-!IFDEF DLL
-TARGET = DLL
-PROJECT = zlib1
+!IF !DEFINED(ZLIB_DECLARE_STATIC) || "$(ZLIB_DECLARE_STATIC)" == ""
+TARGET=DLL
+PROJECT = libzlib1
+CFLAGS = -DZLIB_DECLARE_EXPORT $(CFLAGS)
!ELSE
-TARGET = LIB
+TARGET=LIB
PROJECT = zlib1
+CFLAGS = -DZLIB_DECLARE_STATIC $(CFLAGS)
!ENDIF
CFLAGS = -wd4996 $(CFLAGS)
@@ -40,72 +42,80 @@
SRCDIR = .
!ENDIF
-!include <../../build/NMAKEcommon.inc>
+!include <..\..\NMAKEcommon.inc>
INCLUDES = -I$(SRCDIR)
-PDBFLAGS = -Fo$(BUILDIR)\ -Fd$(BUILDIR)\$(PROJECT)-src
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
OBJECTS = \
- $(BUILDIR)\adler32.obj \
- $(BUILDIR)\compress.obj \
- $(BUILDIR)\crc32.obj \
- $(BUILDIR)\deflate.obj \
- $(BUILDIR)\gzio.obj \
- $(BUILDIR)\infback.obj \
- $(BUILDIR)\inffast.obj \
- $(BUILDIR)\inflate.obj \
- $(BUILDIR)\inftrees.obj \
- $(BUILDIR)\trees.obj \
- $(BUILDIR)\uncompr.obj \
- $(BUILDIR)\zutil.obj
+ $(WORKDIR)\adler32.obj \
+ $(WORKDIR)\compress.obj \
+ $(WORKDIR)\crc32.obj \
+ $(WORKDIR)\deflate.obj \
+ $(WORKDIR)\gzio.obj \
+ $(WORKDIR)\infback.obj \
+ $(WORKDIR)\inffast.obj \
+ $(WORKDIR)\inflate.obj \
+ $(WORKDIR)\inftrees.obj \
+ $(WORKDIR)\trees.obj \
+ $(WORKDIR)\uncompr.obj \
+ $(WORKDIR)\zutil.obj
!IFDEF ASM
CFLAGS = -DASMV -DASMINF $(CFLAGS)
!IF "$(CPU)" == "AMD64"
ASM_OBJECTS = \
- $(BUILDIR)\inffas8664.obj \
- $(BUILDIR)\gvmat64.obj \
- $(BUILDIR)\inffas64.obj
+ $(WORKDIR)\inffas8664.obj \
+ $(WORKDIR)\gvmat64.obj \
+ $(WORKDIR)\inffas64.obj
!ELSE
ASM_OBJECTS = \
- $(BUILDIR)\gvmat32c.obj \
- $(BUILDIR)\gvmat32.obj \
- $(BUILDIR)\inffas32.obj
+ $(WORKDIR)\gvmat32c.obj \
+ $(WORKDIR)\gvmat32.obj \
+ $(WORKDIR)\inffas32.obj
!ENDIF
!ELSE
ASM_OBJECTS =
!ENDIF
-!IFDEF DLL
-BUILDLIB = $(BUILDIR)\$(PROJECT).dll
-BUILDPDB = $(BUILDIR)\$(PROJECT).pdb
-BUILDRES = $(BUILDIR)\$(PROJECT).res
-BUILDMAN = $(BUILDLIB).manifest
+BUILDINC = $(PREFIX)\include\apr-1
+BUILDLIB = $(PREFIX)\lib
+!IF "$(TARGET)" == "DLL"
+BUILDBIN = $(WORKDIR)\$(PROJECT).dll
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMAN = $(BUILDBIN).manifest
!ELSE
-BUILDLIB = $(BUILDIR)\$(PROJECT).lib
+BUILDBIN = $(WORKDIR)\$(PROJECT).lib
!ENDIF
-all : $(BUILDIR) $(BUILDLIB)
+all : $(WORKDIR) $(BUILDBIN)
-$(BUILDIR) :
- @$(MAKETARGET)
+$(BUILDINC) :
+ @if not exist "$(BUILDINC)\arch\win32\$(NULL)" mkdir
"$(BUILDINC)\arch\win32"
-{$(SRCDIR)}.c{$(BUILDIR)}.obj:
+$(BUILDLIB) :
+ @if not exist "$(BUILDLIB)\$(NULL)" mkdir "$(BUILDLIB)"
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+{$(SRCDIR)}.c{$(WORKDIR)}.obj:
$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
!IF "$(CPU)" == "AMD64"
-{$(SRCDIR)/contrib/masmx64}.c{$(BUILDIR)}.obj:
+{$(SRCDIR)/contrib/masmx64}.c{$(WORKDIR)}.obj:
$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-{$(SRCDIR)/contrib/masmx64}.asm{$(BUILDIR)}.obj:
+{$(SRCDIR)/contrib/masmx64}.asm{$(WORKDIR)}.obj:
$(ML) $(AFLAGS) /Fo$@ $<
!ELSE
-{$(SRCDIR)/contrib/masmx86}.c{$(BUILDIR)}.obj:
+{$(SRCDIR)/contrib/masmx86}.c{$(WORKDIR)}.obj:
$(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
-{$(SRCDIR)/contrib/masmx86}.asm{$(BUILDIR)}.obj:
+{$(SRCDIR)/contrib/masmx86}.asm{$(WORKDIR)}.obj:
$(ML) $(AFLAGS) /Fo$@ $<
!ENDIF
@@ -116,14 +126,21 @@
!IFDEF DLL
$(BUILDRES): win32/zlib1.rc
$(RC) $(RCFLAGS) /fo $(BUILDRES) win32/zlib1.rc
-$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(ASM_OBJECTS) $(BUILDRES)
- $(LINK) $(LFLAGS) $(OBJECTS) $(ASM_OBJECTS) $(BUILDRES) $(LIBS) /def:win32/zlib.def
/pdb:$(BUILDPDB) /out:$(BUILDLIB)
+$(BUILDBIN): $(WORKDIR) $(OBJECTS) $(ASM_OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(ASM_OBJECTS) $(BUILDRES) $(LIBS) /def:win32/zlib.def
/pdb:$(BUILDPDB) /out:$(BUILDBIN)
IF EXIST $(BUILDMAN) \
- mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDLIB);2
+ mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDBIN);2
!ELSE
-$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(ASM_OBJECTS)
- $(LINK) $(LFLAGS) $(OBJECTS) $(ASM_OBJECTS) /out:$(BUILDLIB)
+$(BUILDBIN): $(WORKDIR) $(OBJECTS) $(ASM_OBJECTS)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(ASM_OBJECTS) /out:$(BUILDBIN)
!ENDIF
clean:
@$(CLEANTARGET)
+
+install: $(BUILDINC) $(BUILDLIB) $(WORKDIR) $(BUILDBIN)
+ @xcopy "$(SRCDIR)\zlib.h" "$(BUILDINC)" /Y /Q
+ @xcopy "$(SRCDIR)\zconf.h" "$(BUILDINC)" /Y /Q
+ @xcopy "$(SRCDIR)\zutil.h" "$(BUILDINC)" /Y /Q
+ @xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q
+ @xcopy "$(WORKDIR)\*.dll" "$(BUILDLIB)" /Y /Q 2>NUL