Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-2005, 11:19 AM
New Member
 
Posts: 4
Question Building native libraries on MacOS X

I just downloaded the source (zcs-3.0.M1_21) on my MacOS X 10.4. At this point I have compiled all the java source and attempted to build the C/C++ code in the ZimbraNative directory, but failed with errors.

Just to document what I did, from the source base directory:

ant -f Ajax/build.xml
ant -f ZimbraCharset/build.xml
ant -f ZimbraServer/build.xml
ant -f ZimbraWebClient/build.xml
cd ZimbraBuild
make
cd ../ZimbraNative
make

The last few lines of the 'make' output of ZimbraBuild follows:
Code:
echo "%attr(-, zimbra, zimbra) /opt/zimbra/db" >> \
        /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/zimbracore.spec
echo "%attr(-, zimbra, zimbra) /opt/zimbra/jdk1.5.0_04" >> \
        /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/zimbracore.spec
echo "%attr(-, zimbra, zimbra) /opt/zimbra/lib" >> \
        /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/zimbracore.spec
echo "%attr(-, zimbra, zimbra) /opt/zimbra/zimbramon" >> \
        /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/zimbracore.spec
(cd /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/corebuild;\
        rpmbuild  --target i386 --quiet --define '_rpmdir /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild' \
        --buildroot=/Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/corebuild -bb /Users/ajmas/Desktop/zcs-3.0.M1_21-src/ZimbraBuild/zimbracore.spec )
/bin/sh: line 1: rpmbuild: command not found
make: *** [core] Error 127
The 'make' output of ZimbraNative follows:
Code:
mkdir -p build/classes
javac -source 1.4 -target 1.4 -d build/classes src/java/com/zimbra/znative/IO.java src/java/com/zimbra/znative/tests/HardLinkTest.java src/java/com/zimbra/znative/tests/LinkCountTest.java
rm -f build/zimbra-native.jar
jar c0vf build/zimbra-native.jar -C build/classes com
added manifest
adding: com/(in = 0) (out= 0)(stored 0%)
adding: com/zimbra/(in = 0) (out= 0)(stored 0%)
adding: com/zimbra/znative/(in = 0) (out= 0)(stored 0%)
adding: com/zimbra/znative/IO.class(in = 1300) (out= 1300)(stored 0%)
adding: com/zimbra/znative/tests/(in = 0) (out= 0)(stored 0%)
adding: com/zimbra/znative/tests/HardLinkTest.class(in = 1779) (out= 1779)(stored 0%)
adding: com/zimbra/znative/tests/LinkCountTest.class(in = 952) (out= 952)(stored 0%)
mkdir -p build
rm -f build/IO.h
javah -o build/IO.h -classpath build/classes com.zimbra.znative.IO
gcc -Ibuild -Wall -Wmissing-prototypes -c -o build/IO.o src/native/IO.c
src/native/IO.c:26:17: error: jni.h: No such file or directory
In file included from src/native/IO.c:35:
build/IO.h:16: error: syntax error before "void"
build/IO.h:17: error: parse error before '*' token
build/IO.h:17: warning: type defaults to 'int' in declaration of 'Java_com_zimbra_znative_IO_link0'
build/IO.h:17: warning: data definition has no type or storage class
build/IO.h:24: error: parse error before "jint"
build/IO.h:25: error: parse error before '*' token
build/IO.h:25: warning: type defaults to 'int' in declaration of 'Java_com_zimbra_znative_IO_linkCount0'
build/IO.h:25: warning: data definition has no type or storage class
src/native/IO.c:38: error: parse error before '*' token
src/native/IO.c: In function 'ThrowNPE':
src/native/IO.c:40: error: 'jclass' undeclared (first use in this function)
src/native/IO.c:40: error: (Each undeclared identifier is reported only once
src/native/IO.c:40: error: for each function it appears in.)
src/native/IO.c:40: error: parse error before "cls"
src/native/IO.c:42: error: 'cls' undeclared (first use in this function)
src/native/IO.c:43: error: 'env' undeclared (first use in this function)
src/native/IO.c:43: error: 'msg' undeclared (first use in this function)
src/native/IO.c: At top level:
src/native/IO.c:47: error: parse error before '*' token
src/native/IO.c: In function 'ThrowIAE':
src/native/IO.c:49: error: 'jclass' undeclared (first use in this function)
src/native/IO.c:49: error: parse error before "cls"
src/native/IO.c:51: error: 'cls' undeclared (first use in this function)
src/native/IO.c:52: error: 'env' undeclared (first use in this function)
src/native/IO.c:52: error: 'msg' undeclared (first use in this function)
src/native/IO.c: At top level:
src/native/IO.c:56: error: parse error before '*' token
src/native/IO.c: In function 'ThrowIOE':
src/native/IO.c:58: error: 'jclass' undeclared (first use in this function)
src/native/IO.c:58: error: parse error before "cls"
src/native/IO.c:59: error: 'cls' undeclared (first use in this function)
src/native/IO.c:60: error: 'env' undeclared (first use in this function)
src/native/IO.c:60: error: 'msg' undeclared (first use in this function)
src/native/IO.c: At top level:
src/native/IO.c:63: error: syntax error before "void"
src/native/IO.c:64: error: parse error before '*' token
src/native/IO.c:69: warning: return type defaults to 'int'
src/native/IO.c:69: warning: no previous prototype for 'Java_com_zimbra_znative_IO_link0'
src/native/IO.c: In function 'Java_com_zimbra_znative_IO_link0':
src/native/IO.c:75: error: 'joldpath' undeclared (first use in this function)
src/native/IO.c:76: error: 'env' undeclared (first use in this function)
src/native/IO.c:77: warning: 'return' with no value, in function returning non-void
src/native/IO.c:80: error: 'jnewpath' undeclared (first use in this function)
src/native/IO.c:82: warning: 'return' with no value, in function returning non-void
src/native/IO.c:88: warning: 'return' with no value, in function returning non-void
src/native/IO.c:94: warning: 'return' with no value, in function returning non-void
src/native/IO.c:106: warning: 'return' with no value, in function returning non-void
src/native/IO.c:109: warning: implicit declaration of function 'snprintf'
src/native/IO.c:109: warning: incompatible implicit declaration of built-in function 'snprintf'
src/native/IO.c:113: warning: control reaches end of non-void function
src/native/IO.c: At top level:
src/native/IO.c:115: error: parse error before "jint"
src/native/IO.c:116: error: parse error before '*' token
src/native/IO.c:117: warning: return type defaults to 'int'
src/native/IO.c:117: warning: no previous prototype for 'Java_com_zimbra_znative_IO_linkCount0'
src/native/IO.c: In function 'Java_com_zimbra_znative_IO_linkCount0':
src/native/IO.c:122: error: 'jpath' undeclared (first use in this function)
src/native/IO.c:123: error: 'env' undeclared (first use in this function)
src/native/IO.c:138: error: 'jint' undeclared (first use in this function)
src/native/IO.c:138: error: parse error before "sb"
src/native/IO.c:141: warning: incompatible implicit declaration of built-in function 'snprintf'
src/native/IO.c:145: warning: control reaches end of non-void function
make: *** [build/IO.o] Error 1
'gcc -v' gives:
Code:
Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
Reply With Quote
  #2 (permalink)  
Old 10-13-2005, 11:21 AM
New Member
 
Posts: 4
Default

I modified the make file so that the gcc command for '$(BUILD)/IO.o' now reads:
Code:
gcc -I$(BUILD) -I$(JAVA_HOME)/include -Wall -Wmissing-prototypes -c -o $@ $<
This removes all of the dependency related errors, leaves a few warnings and then fails since gcc on Darwin/MacOS X does not suport the '-shared' option. I think think it should be '-dynamiclib', so I changed that in the make file and that resolves the build issues there.

As to ZimbraBuild, the blocking point at the moment seems to be RPM creation. Maybe we need to create a generic version that will create a tarball distribution. That should allow most platforms to have a working solution, even if it is not the ideal one.
Reply With Quote
  #3 (permalink)  
Old 10-13-2005, 02:19 PM
Zimbra Employee
 
Posts: 4,792
Default

As of now the source has been setup to compile on Red Hat and Fedora. We are working on more ports so you can build an installable pkg for other OS's. MacOS X is on that list.
Reply With Quote
  #4 (permalink)  
Old 10-15-2005, 12:00 AM
Senior Member
 
Posts: 51
Default

i actually just started getting it up and running on solaris 10 sparc. give me a week and i will have some more details.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.