Embedded LevelDB should support VPATH builds #6336

pull kleetus wants to merge 1 commits into bitcoin:master from kleetus:master changing 4 files +13 −10
  1. kleetus commented at 5:29 PM on June 24, 2015: none

    Discussion

    Building Bitcoin from source should support remote builds. Meaning, if I want to create a build directory outside of the Bitcoin source directories and run the configure script from the Bitcoin source repo, it should work. Subsequently, running make inside my build directory should also produce object files and other binaries in my build directory leaving my source directories clean. The way the Autoconf and Makefile configs were written, this works pretty well, except for the embedded LevelDB sources and its custom Makefile and scripts. This PR moves that custom makefile a bit closer to a canonical Autotools build system without resorting to adding a configure.ac to this subdirectory.

    Actions taken

    Added the ability to build Bitcoin sources in a remote build directory (taking advantage of VPATH). The embedded leveldb custom Makefile and build_detect_platform shell script were the sole hold outs in order to make this happen.

    1. Made Autoconf aware of the fact that there is a Makefile.in in the leveldb directory.
    2. Ensured that this file is checked into source control and not ignored.
    3. Removed the reference to the custom Makefile in the leveled directory because the configure script (using config.status) will be writing the actual Makefile in the leveldb directory.
    4. Referenced @srcdir@ in the Makefile.in for the leveldb directory in order to make use of the actual srcdir for remote builds.
    5. Altered the builder script (build_detect_platform) to write the proper paths into its output file.
  2. Added the ability to build Bitcoin sources in a remote build directory (taking advantage of VPATH). The embedded leveldb custom Makefile and build_detect_platform shell script were the sole hold outs in order to make this happen.
    1. Made Autoconf aware of the fact that there is a Makefile.in in the leveldb directory.
    2. Ensured that this file is checked into source control and not ignored.
    3. Removed the reference to the custom Makefile in the leveled directory because the configure script (using config.status) will be writing the actual Makefile in the leveldb directory.
    4. Referenced @srcdir@ in the Makefile.in for the leveldb directory in order to make use of the actual srcdir for remote builds.
    5. Altered the builder script (build_detect_platform) to write the proper paths into its output file.
    9a6b8b9568
  3. sipa commented at 9:29 PM on June 24, 2015: member

    I fully agree with the goal, but we prefer to not make much changes to our LevelDB code. At the least, submit the changes to bitcoin/leveldb, where our branch of the LevelDB code is hosted. Ideally, submit it to google/leveldb and hopefully it will become available for all users :)

  4. kleetus commented at 12:04 AM on June 25, 2015: none

    Great idea, let me close this PR and submit one to google/levelDB.

  5. kleetus closed this on Jun 25, 2015

  6. theuni commented at 3:06 AM on June 25, 2015: member

    @kleetus Thanks. Fwiw, I agree completely with @sipa.

    I doubt you'll get them to make any changes that would require any autotools-like features, but you may be able to split up their files somewhat so that we could include them directly. IIRC from the last time I looked into this, we'd just need their file-list split off to a separate .mk. We could handle the rest ourselves.

  7. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me