Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding library to Firefox build

25 views
Skip to first unread message

bigp...@linuxmail.org

unread,
May 9, 2013, 11:19:09 AM5/9/13
to
I'm trying to add a Visual C++ library into the Firefox build since I'm planning to call some of the functions in the library.

Where do I make the change to add the .lib file to the build?

I'm currently only testing this on Windows, not any other platform.

xunxun

unread,
May 9, 2013, 11:48:18 AM5/9/13
to bigp...@linuxmail.org, dev-b...@lists.mozilla.org
> _______________________________________________
> dev-builds mailing list
> dev-b...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-builds
If you build OPTIMIZE edition, then add it in .mozconfig:

export MOZ_OPTIMIZE_LDFLAGS="test.lib"
mk_add_options MOZ_OPTIMIZE_LDFLAGS="test.lib"

--
Best Regards,
xunxun

bigp...@linuxmail.org

unread,
May 10, 2013, 2:41:00 AM5/10/13
to

> > I'm trying to add a Visual C++ library into the Firefox build since I'm planning to call some of the functions in the library.
>
> >
>
> > Where do I make the change to add the .lib file to the build?
>
> >
>
> > I'm currently only testing this on Windows, not any other platform.
>
> > _______________________________________________
>
> > dev-builds mailing list
>
> > https://lists.mozilla.org/listinfo/dev-builds
>
> If you build OPTIMIZE edition, then add it in .mozconfig:
>
>
>
> export MOZ_OPTIMIZE_LDFLAGS="test.lib"
>
> mk_add_options MOZ_OPTIMIZE_LDFLAGS="test.lib"

Sorry, but what you're saying makes no sense to me. I don't know what an OPTIMIZE build is and I can't find any reference to OPTIMIZE in the mozconfig files.

In the 'build' directory I see several mozconfig files, mozconfig.common and mozconfig.vs2010-common. Should I alter these?

xunxun

unread,
May 10, 2013, 3:09:04 AM5/10/13
to bigp...@linuxmail.org, dev-b...@lists.mozilla.org
> _______________________________________________
>
No, you only change root directory's .mozconfig

The content is similar:

export MOZ_OPTIMIZE_LDFLAGS="test.lib"

mk_add_options MOZ_OPTIMIZE_LDFLAGS="test.lib"

ac_add_options --enable-optimize="-O2"



This will build OPTIMIZE build, and MOZ_OPTIMIZE_LDFLAGS options will tranlate to linker option except nspr dll, nspr dll will accepet LDFLAGS.


If you also want to translate MOZ_OPTIMIZE_LDFLAGS to nspr dll, you can refer to the similar patch below:

# pcxfirefox patch
# User xunxun
# Date 2013022302:00
# Make nspr4 accept MOZ_OPTIMIZE_LDFLAGS

diff -ruNa mozilla-release-origin/configure.in mozilla-release-new/configure.in
--- mozilla-release-origin/configure.in Sat Feb 16 05:14:46 2013
+++ mozilla-release-new/configure.in Sat Feb 23 01:45:42 2013
@@ -9179,7 +9179,7 @@
export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
fi
_SAVE_LDFLAGS="$LDFLAGS"
- export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
+ export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS $MOZ_OPTIMIZE_LDFLAGS"
AC_OUTPUT_SUBDIRS(nsprpub)
LDFLAGS="$_SAVE_LDFLAGS"
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
diff -ruNa mozilla-release-origin/nsprpub/config/autoconf.mk.in mozilla-release-new/nsprpub/config/autoconf.mk.in
--- mozilla-release-origin/nsprpub/config/autoconf.mk.in Sat Feb 16 05:15:08 2013
+++ mozilla-release-new/nsprpub/config/autoconf.mk.in Sat Feb 23 01:46:48 2013
@@ -85,7 +85,7 @@
OS_LIBS = @OS_LIBS@
OS_LDFLAGS = @LDFLAGS@
OS_DLLFLAGS = @OS_DLLFLAGS@
-DLLFLAGS = @DLLFLAGS@
+DLLFLAGS = @DLLFLAGS@ @LDFLAGS@
EXEFLAGS = @EXEFLAGS@
OPTIMIZER = @OPTIMIZER@


--
Best Regards,
xunxun

0 new messages