-
Notifications
You must be signed in to change notification settings - Fork 37.8k
[Docs] Create NetBSD build instructions and fix compilation. #12125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added "db4_cxx" as this is the name used in NetBSD for the Berkeley DB library. Without this additional base filename alternative, the "configure" script will fail to find this library and compilation will not succeed.
Added a test for the "__NetBSD__" definition (because testing for "OS_NETBSD" fails in NetBSD 7).
This reverts commit 3f5002f.
Fixed formatting, and added -DOS_NETBSD to ./configure's CPPFLAGS so ensure gmake's success.
Minor improvement to some of the instructions, and added "autogen.sh" to the steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theuni may want to take a look.
With wallet: | ||
``` | ||
./autogen.sh | ||
./configure CPPFLAGS="-I/usr/pkg/include -DOS_NETBSD" LDFLAGS="-L/usr/pkg/lib" BOOST_CPPFLAGS="-I/usr/pkg/include" BOOST_LDFLAGS="-L/usr/pkg/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we should be able to auto-detect /usr/pkg/*, then, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a way to include this in the Makefile (or whatever's most appropriate), then I certainly welcome such a change, especially if it simplifies the usage of "./configure" to something like this: ./configure CPPFLAGS="-DOS_NETBSD"
The "/usr/pkg/" path is the default where pkgsrc and pkgin place package sources, binaries, libraries, configuration files, etc., and most (if not all) NetBSD installations have this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adding those flags seems unnecessary. Further, DOS_NETBSD can and should be set by configure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic. Eliminating the need for any flags with "./configure" is something I agree with, and placing it in the "configure.ac" file after the "openbsd" entry seems reasonable to me (if, in the future, this list becomes longer, then at that point there may be a need to organize it in alphabetical order for easier maintenance, but for now it's short so I'm not suggesting this).
P.S.: I added this change in on my test system, and it seemed to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheBlueMatt This is from the irc.freenode.net#netbsd channel regarding your question about auto-detecting the "/usr/pkg/" directory...
-----BEGIN-----
[22:07:50] Randolf: Hmm... Re your bitcoin pull request: software should not look in /usr/pkg by default. Anything built by pkgsrc will automatically add -I/usr/pkg/include -- or -I${PREFIX}/include, when PREFIX may not actually be /usr/pkg.
[22:08:39] Part of the point of /usr/pkg is that nothing else uses it by default, unlike /usr/local which has all sorts of variegated cultural associations and random behaviour.
-----END-----
So, perhaps it would be better to not attempt to automatically detect NetBSD's pkgsrc/pkgin systems, but instead either leave the the ./configure parameters as documented with CPPFLAGS, etc., or provide an alternative such as a special parameter called PKG_PATH="/usr/pkg" that helps to make it all work automatically behind-the-scenes (assuming this is even possible).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to not hardcode /usr/pkg, as this prefix is configurable and people use diverse ones, like /opt, ~/pkg/ etc.
This should take care of the define for leveldb: diff --git a/configure.ac b/configure.ac
index f7de4c9..2690477 100644
--- a/configure.ac
+++ b/configure.ac
@@ -449,6 +449,8 @@ case $host in
*openbsd*)
LEVELDB_TARGET_FLAGS="-DOS_OPENBSD"
;;
+ *netbsd*)
+ LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
*)
OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.]) I'm confused about /usr/pkg, though. Is the system compiler not configured to check there by default? |
NetBSD/pkgsrc developer here. If you simply allow standard CPPFLAGS and LDFLAGS in ./configure, then when this is built by pkgsrc to be linked against the library packages it depends on, pkgsrc will furnish the necessary -I and -L and -R flags for /usr/pkg, or for wherever pkgsrc is built to install into. The system compiler intentionally doesn't automatically add /usr/pkg to the paths because /usr/pkg is the domain of packages, not of the compiler; pkgsrc can be built for any other location, e.g. /usr/pkg-20xxQy for a quarterly release or /home/alice/pkg for unprivileged installations; and what's in it may change as you install or remove packages, but pkgsrc has no record of things outside /usr/pkg that might be broken by that. The best way to link against libraries installed in /usr/pkg or elsewhere by pkgsrc is just to package up bitcoin in pkgsrc (currently there's an old version in pkgsrc-wip -- patches welcome!); otherwise, software built outside pkgsrc is expected to pass the necessary -I/-L/-R flags as if for any custom library installation prefix. |
@fanquake Thanks; I'm new to GitHub.com and so I appreciate any assistance from you and anyone else. I did originally name this because I prefer this over default names, and at present I'm trying to figure out how to make changes to this Pull Request. I would love to move this forward, but I think I'm just stuck with a GitHub learning curve at present, so I certainly welcome all pointers and suggestions. (None of the instructions for Squashing that I've tried seem to work because the various options instructed simply don't appear for me anywhere on the GitHub web site or within the GitHub Desktop software. If there are some reliable instructions to follow to Squash this, I'll gladly try it.) |
It is not possible to squash on GitHub web. I am not familiar with GitHub desktop, but there are some notes in https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
@MarcoFalke I can "clone" on Unix but "checkout" always fails to find the .git file. "Allow edits from maintainers" is enabled, in case that's helpful. I want to get Squash working (I'm assuming that I must be missing something), but if there's a time-constraint then I also don't want to cause any delays for the Bitcoin project overall. |
No, there is no pressure and squashing makes the review easier, I presume.
It probably said something like "cloning into |
Thanks @MarcoFalke. I couldn't find the "Squash" feature 14 days ago (see my first comment on this Pull Request where I indicated that I'd like to do this), and I'm not finding it now. I looked into this for a while but didn't make any progress. If there's a guide you (or anyone) can point me to that will help me to get this Pull Request "squashed," I'd be happy to give it a try. |
I don't know of a guide offhand, but if you google git rebase squash you can find some tutorials. Basic idea is to run a command like |
@randolf I wrote these instructions for how to rebase and squash for a different cryptocurrency which might be of help https://gist.github.com/jcvernaleo/aa3f6c216f3df1f9c6b62d7f59a2a469#rebasing-one-of-your-existing-pull-requests |
Thank you @ryanofsky -- I will look into that. |
@jcvernaleo Okay, your instructions seem to be helpful, and I think I've made some progress on this now despite the fun with using "vi" to change "noop" to "s" (hopefully I can configure git to use a different editor, but I'll leave this for later). I was also prompted by the "git push" command for username and password, and then it all finished with "Everything is up-to-date." I don't see any indication of changes on the GitHub.com web site though, but perhaps my upload is queued somewhere and I just have to wait? I'll check back later. Thanks for your help! |
You should replace |
@randolf git uses whatever default editor you have set as
or whatever editor you prefer. |
@jcvernaleo That worked very well, thank you. |
@MarcoFalke So I saw 6 items in the list, each with "pick" as the first word. The "git push" command (which I had to login for, as expected), then reported the following:
On the GitHub.com web site, the "Compare" function still shows 6 changes, so if it's not Squashed yet I'm probably looking in the wrong place. There's so much to learn about using git (it seems to be a pretty extensive system), and I appreciate all the help from you and everyone else thus far. |
@randolf you need to mark the commits as |
@fanquake Thanks for taking care of the Squashing for me. I'm still new to GitHub and so this is helpful to get things moving along. I appreciate it. |
…tion 11c5827 [build] Add NETBSD leveldb target to configure.ac (fanquake) 1944fa3 [doc] Create build-netbsd.md (Randolf Richardson) 336685e [build] Add db4_cxx to bitcoin_find_bdb48.m4 (Randolf Richardson) Pull request description: Replaces #12125. Tree-SHA512: 411d082ffff7198bcc1b2b6fcdf86c378baf228d8f4fee0e6c9f0688efe9c6b6dcfd5c1ab9c1dfd0c4637723b8584dbbb614634ace0e1a417b59e88a6c736dc0
…compilation 11c5827 [build] Add NETBSD leveldb target to configure.ac (fanquake) 1944fa3 [doc] Create build-netbsd.md (Randolf Richardson) 336685e [build] Add db4_cxx to bitcoin_find_bdb48.m4 (Randolf Richardson) Pull request description: Replaces bitcoin#12125. Tree-SHA512: 411d082ffff7198bcc1b2b6fcdf86c378baf228d8f4fee0e6c9f0688efe9c6b6dcfd5c1ab9c1dfd0c4637723b8584dbbb614634ace0e1a417b59e88a6c736dc0
This change makes it possible to build/compile Bitcoin on NetBSD (specifically, NetBSD 7.0, and very likely other recent versions too). One .m4 file has one minor change so that ./configure can find Berkeley DB 4.8, and one .md file was created that provides instructions for NetBSD users.
Thank you to the many helpful people in the #netbsd and #bitcoin-core-dev channels on irc.freenode.net for your help with this.