Closed Bug 467862 Opened 11 years ago Closed 11 years ago

Build system should support building both a static and a shared library from the same Makefile

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: jimb, Assigned: ted)

References

Details

Attachments

(2 files)

Some interesting questions arise: does this mean compiling two .o files for each source file, one PIC and one not?  GLIBC does this, using .o for static and .os for PIC, or something like that.
I think not: I think we should compile both the shared and static library with PIC, using the same object files.
Blocks: 462004
Assignee: nobody → ted.mielczarek
OS: Linux → All
Hardware: PC → All
This allows you to set both FORCE_STATIC_LIB and FORCE_SHARED_LIB in the same Makefile. It also adds optional STATIC_LIBRARY_NAME and SHARED_LIBRARY_NAME variables, to rename one or the other. (They'll both default to LIBRARY_NAME.)

I don't think this patch 100% complete, because there were a few instances of $(LIBRARY_NAME) in rules.mk that I wasn't quite sure what to do with, notably:
The build-list.pl stuff, I have no idea what that does:
http://mxr.mozilla.org/mozilla-central/source/config/rules.mk#730
and this OS/2 block:
http://mxr.mozilla.org/mozilla-central/source/config/rules.mk#1076
Attachment #352575 - Flags: review?(benjamin)
Attachment #352575 - Flags: review?(benjamin) → review+
Comment on attachment 352575 [details] [diff] [review]
allow both FORCE_STATIC_LIB and FORCE_SHARED_LIB in the same makefile

build-list.pl should be fed the static library name: that scripts is how the static build knows what libraries to link up at the end, and presumably we want it to link with the static libs, not the shared libs

The OS/2 block appears to be creating a .def file, which only applies to dynamic libraries, so I think you want the shared library name there. r=me with those changes
Pushed:
http://hg.mozilla.org/mozilla-central/rev/73be1c836d7f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 471097
This got backed out for win32 build bustage.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I'm going to re-land this, I made one change to update a change I made in bug 467271. (And one comment change.)
Relanded in m-c:
http://hg.mozilla.org/mozilla-central/rev/a940f7f8b4b8
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
It appears that this caused bug 473760

With changeset ae21c96c4355 the default browser check as well as the following works

Components.classes["@mozilla.org/browser/shell-service;1"].getService(Components.interfaces.nsIShellService);

With changeset 19e319a0647b neither works.

This only affects builds after they have been packages and not when they are run from dist/bin
Depends on: 473760
btw: I'm taking tomorrow off and won't be back until Tuesday so I won't be able to help fix bug 473760 anytime soon
All symptoms of the same bug.
No longer depends on: 473814, 473929
Flags: in-testsuite-
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.