Hi,

Here is the posting of partial Makefile:

# Change this to point at Thunderbird source's directory.
THUNDERBIRD_SOURCE ?= $(HOME)/comm-beta18.0-hg/src

PYTHON_PATH    ?= $(THUNDERBIRD_SOURCE)/mozilla/config/pythonpath.py
XPIDL_HEADER   ?= $(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/sdk/bin/header.py
XPIDL_TYPELIB  ?= $(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/sdk/bin/typelib.py

PROJECTDIR      = $(HOME)/libABCCrypt-gcc3

PROJECTDIR_DEPS = $(HOME)/libABCCrypt-gcc3/.deps

IPC_PROJECTDIR  = $(HOME)/libipc-gcc3
ABCMIME_PROJECTDIR  = $(HOME)/libABCMime-gcc3

CXX            ?= c++

XPIDLSRCS       = \
                nsIABCCrypt.idl     \
                nsIABCKeyDB.idl     \
                $(NULL)

XPIDL_HEADERS   = \
                nsIABCCrypt.h       \
                nsIABCKeyDB.h       \
                $(NULL)

XPIDL_TYPELIBS  = \
                nsIABCCrypt.xpt     \
                nsIABCKeyDB.xpt     \
                $(NULL)

CPPSRCS         = \
                cryptoMain.cpp              \
                nsABCCrypt.cpp      \
                nsABCCryptModule.cpp    \
                $(NULL)

CPPFLAGS +=     -fno-rtti               \
                -fno-exceptions         \
                -fshort-wchar           \
                -fPIC                   \
                $(NULL)

THUNDERBIRD_DEFINES += -DMOZ_THUNDERBIRD=1              \
                       -DMOZILLA_MAJOR_VERSION=18       \
                       -DMOZILLA_MINOR_VERSION=0        \
                       -DMOZ_GLUE_IN_PROGRAM            \
                       -DMOZILLA_CLIENT                 \
                       $(NULL)

PYTHON_INCLUDES = -I$(THUNDERBIRD_SOURCE)/mozilla/other-licenses/ply        \
                  -I$(THUNDERBIRD_SOURCE)/mozilla/xpcom/idl-parser          \
                  -I$(THUNDERBIRD_SOURCE)/mozilla/xpcom/typelib/xpt/tools

IDL_INCLUDES = -I.                                              \
               -I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/idl    \
               -I$(IPC_PROJECTDIR)                              \
               -I$(ABCMIME_PROJECTDIR)

THUNDERBIRD_INCLUDES = -I$(THUNDERBIRD_OBJDIR_PATH)                             
        \
                       -I$(THUNDERBIRD_SOURCE)/mozilla/config/gcc_hidden.h      
        \
                       -I$(IPC_PROJECTDIR)                                      
        \
                       -I$(ABCMIME_PROJECTDIR)                                  
        \
                       -I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/include        
        \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/stl_wrappers          \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/system_wrappers       \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/include/nsprpub       \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/embedstring/include   \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/sdk/bin/nspr-config    \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/include/nspr          \

-I$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/include/nss

THUNDERBIRD_LDFLAGS =  -L$(THUNDERBIRD_OBJDIR_PATH)/mozilla/dist/lib \
                       -lxpcomglue_s    \
                       -lxpcom          \
                       -lmozalloc       \
                       -lnss            \
                       -lnssb           \
                       -lnssutil        \
                       -lnspr4          \
                       -lplds4          \
                       -lplc4           \
                       -shared          \
                       $(NULL)

%.h: %.idl
python -u $(PYTHON_PATH) $(PYTHON_INCLUDES) $(XPIDL_HEADER) --cachedir=$(PROJECTDIR) $(IDL_INCLUDES) $< -d $(PROJECTDIR_DEPS)/$@.pp -o $@

%.xpt: %.idl
python -u $(PYTHON_PATH) $(PYTHON_INCLUDES) $(XPIDL_TYPELIB) --cachedir=$(PROJECTDIR) $(IDL_INCLUDES) $< -d $(PROJECTDIR_DEPS)/$@.pp -o $@

%.o: %.cpp Makefile
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(THUNDERBIRD_DEFINES) $(THUNDERBIRD_INCLUDES) $<

$(MODULE).so: $(XPIDLSRCS:%.idl=%.h) $(XPIDLSRCS:%.idl=%.xpt) $(CPPSRCS:%.cpp=%.o) $(CXX) $(CPPSRCS:%.cpp=%.o) $(THUNDERBIRD_LDFLAGS) -Xlinker --export-dynamic -Xlinker -zmuldefs -o $@ #Error here during linking
        rm *.o
        chmod +x $@

build: $(MODULE).so

clean:
        rm $(PROJECTDIR_DEPS)/*.pp
        rm $(XPIDL_HEADERS)
        rm $(XPIDL_TYPELIBS)
        rm $(MODULE).so

The line which indicated where the error started is marked as "#Error here during linking". This project is created in NetBeans as Dynamic Library.

The error was "undefined reference to (function)". All the functions which could not be located are defined in pk11pub.h.

This problem only occurred when i was using comm-beta version 18, together with c++ 4.6.3. Previous versions of Thunderbird, including current version 17, did not have this error. All the CPP and IDL files can be compiled without any errors.

Linking by specifying the library files (libnss.a, libnssb.a and libnssutil.a) also did not help.

Appreciate if you can kindly reply to my email as soon as possible. Thank you.

Regards,
Brian Teh, Singapore
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to