Skip to content
This repository was archived by the owner on Jun 17, 2019. It is now read-only.

Conversation

@kleetus
Copy link

@kleetus kleetus commented Feb 5, 2016

closes #10

Discussion

LevelDB currently has a hand-rolled Makefile and it seems to work well, especially for build systems that do not have a shell (Windows). What the build system for LevelDB does not have is support for Autotools, specifically leveraging autconf, autoreconf, and the macros that come along with that.

LevelDB is, fundamentally, a project that should be a dependency to another project with its own build system. Many of these projects are also open-source and use Autotools. As such, those projects can easily integrate this project if, and only if, this project has at least a configure.ac file. Otherwise those projects need to hack in running "make -c" in their own Makefile.am's.

This code adds

  • a basic configure.ac and autogen.sh script
  • a basic configure script
  • a Makefile input file that mirrors the original Makefile, so that non-shell systems can still continue to use the Makefile

Chris Kleeschulte added 2 commits February 4, 2016 15:45
- added macro in main configure.ac for running configure script for leveldb
- added autogen script to launch autoreconf in leveldb
- added the most basic configure.ac for leveldb
- added references to srcdir instead of hardcoded path
@laanwj
Copy link
Member

laanwj commented Feb 8, 2016

Concept ACK

@da2ce7
Copy link

da2ce7 commented Feb 10, 2016

I don't think that the generated configure script should be included in the pull request.

Maybe update the .gitignore?

.gitignore Outdated
autom4te.cache/
config.log
config.status
!configure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that a generated script like configure shouldn't be in the repo. A typo, I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request lists it as a feature, so I assume it's intentional.

@kleetus
Copy link
Author

kleetus commented Feb 10, 2016

The addition of the configure script is intentional. The rationale is consistency with secp256k1 library which includes a configure shell script. Without the configure script, parent projects would need to run autoconf or autoreconf on leveldb.

@laanwj
Copy link
Member

laanwj commented Feb 10, 2016

Without the configure script, parent projects would need to run autoconf or autoreconf on leveldb.

The problem with committing build-generated scripts is that when developers do run autoconf, a repository file will have changes, which is easy to inadvertently commit, resulting in merge conflicts with other developers (as well as a lot of commit noise).

(as a convenience, ./configure script is part of the tarball created with make dist, but not the repository)

Also I suppose the only intended parent project here is bitcoin, which will handle calling the autoconf.

@laanwj
Copy link
Member

laanwj commented Feb 10, 2016

Tested ACK apart from the configure nit - see bitcoin/bitcoin#7466 (comment)

@sipa
Copy link
Contributor

sipa commented Feb 10, 2016

@kleetus
Copy link
Author

kleetus commented Feb 10, 2016

The problem with committing build-generated scripts is that when developers do run autoconf, a repository file will have changes, which is easy to inadvertently commit, resulting in merge conflicts with other developers (as well as a lot of commit noise).

Agreed! Let me fix this so that there is no configure script and that gitignore is properly aligned to ignore the output of autoreconf.

Chris Kleeschulte added 2 commits February 10, 2016 11:28
2. Added a slash in Makefile input so as to not modify the main Makefile when configure is run. The result is a double slash when referring to paths in the build, but this is harmless.
@laanwj
Copy link
Member

laanwj commented Feb 11, 2016

@theuni can you take a look here please?

@theuni
Copy link

theuni commented Feb 17, 2016

Hmm, I wonder if it would be simpler to just add our own simple Makefile.am here, rather than trying to pile on their stuff. I'll whip something up for comparison.

@laanwj
Copy link
Member

laanwj commented Feb 17, 2016

Well this is already done, and checked it works.

@theuni
Copy link

theuni commented Feb 17, 2016

Pushed an alternative to theuni/bitcoin@3b71469

The benefit is that it's directly integrated into our build without the need for another configure run. I'm not married to it, but I'm not a fan of adding more complexity to what should be a pretty straightforward build.

@laanwj
Copy link
Member

laanwj commented Feb 18, 2016

I agree, it's a worthwhile alternative - however, please read the discussion in bitcoin/bitcoin#7466 on how we got to this solution.

I think the advantage of your solution is that it can be maintained entirely outside of leveldb's tree (given that the .include is moved). Effectively it absorbs leveldb into bitcoin's build system.
On the other hand this solution would be better if leveldb upstream could be convinced to switch. It's more of a modular approach.

Not wedded to either though, I just want out of tree builds to work.

@laanwj
Copy link
Member

laanwj commented Mar 30, 2016

@theuni I've tested your patch, but it fails on test_bitcoin and the bench.

Seems every executable now needs both $(INT_LIBLEVELDB) $(INT_LIBMEMENV) as well as $(LIBLEVELDB) $(LIBMEMENV) in its LDADD?

@theuni
Copy link

theuni commented Apr 15, 2016

@laanwj I've pushed a cleaned up version here: https://github.com/theuni/bitcoin/tree/leveldb-integration. Having done that cleanly now, I do prefer it over the wrapper approach. That's not to diminish @kleetus's work, of course.

If you're ok with the approach, I'll PR it here.

@laanwj
Copy link
Member

laanwj commented Apr 19, 2016

@theuni Looks good to me! You probably want to pr it at bitcoin/bitcoin though, not here.

@theuni
Copy link

theuni commented Apr 19, 2016

Right, I forgot the file was moved up. PRing over there.

@laanwj
Copy link
Member

laanwj commented Sep 28, 2016

Closing this in favor of the build system changes in Bitcoin Core.

It may still make sense to try to do this upstream.

@laanwj laanwj closed this Sep 28, 2016
droark pushed a commit to droark/leveldb-1 that referenced this pull request Oct 6, 2018
…bitcoin-core#5.

8b1cd37 fixup define checks. Cleans up some oopses from bitcoin-core#5. (Cory Fields)

Pull request description:

  - use "#if defined(foo)" rather than "#if foo"
  - Use the same guard for the cpuid header and the function

Tree-SHA512: fe83895055faf9f5491b9af44262a4dc15d9f56ec8f818e7d66c1002bb6568a90345662828abc7baab0772baa646f9cf13f8ba586ebad5fc3678731b27585885
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add autotools build system

5 participants