Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-16663

options requested in top-level SConstruct to support non-default libraries and includes

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0-rc6
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Fully Compatible
    • BUILD 1

      I have a small diff but I am waiting for legal to let me know whether I can share that so I will describe the change. I am building MongoDB with a compiler and library toolchain that works "in production" so I don't want to use the default locations for libraries and include files. I ended up needing two options in the top-level SConstruct to make this work:

      1) --dont-add-local-paths - this changes MongoDB to not add local paths. For example, I want to keep this from being added for 64-bit linux:
      env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] )

      2) --linkflags - values here get appended to LINKFLAGS. I used this to add extra flags and libraries to link with jemalloc. I ended up using ":" as the option separator because options already use "," and the following is an example of a value I used:
      --linkflags="-Wl,--whole-archive /path/to/libjemalloc.a:-Wl,--no-whole-archive"

      I can also use this to set rpath options, although I don't need to do that yet we do that for other binaries like mysqld...

      --linkflags="--enable-new-dtags:-Wl,-rpath=/path/to/production/lib"

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            mdcallag Mark Callaghan
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: