Optimize header dependencies; improve Makefile dependency graph #226

pull jordanlewis wants to merge 8 commits into bitcoin:master from jordanlewis:betterheaders changing 11 files +49 −30
  1. jordanlewis commented at 4:10 AM on May 16, 2011: contributor

    This patch set includes the following changes:

    • Remove unused #includes
    • Factor out #includes that are only needed in some source files from headers.h
    • Add dependency tracking to unix, mac, and mingw makefiles via gcc's -MMD flag

    These changes improve bitcoin's development environment. Previously changing any header file caused a global recompile. With these changes, only those files that directly depend on a changed header file will require recompilation.

  2. Only include irc.h when needed f23f9a03c8
  3. Only include db.h when we have to. 1512d5ce64
  4. Only included rpc.h when necessary ed0c143242
  5. Only include net.h when we have to 40c2614ef4
  6. Only include init.h when we have to edd309e537
  7. Only include strlcpy.h when we have to fdd7d04744
  8. sipa commented at 8:17 AM on May 16, 2011: member

    rpc.cpp: In function ‘void ThreadRPCServer2(void*)’: rpc.cpp:1832: error: ‘filesystem’ has not been declared rpc.cpp:1832: error: expected ‘;’ before ‘certfile’ rpc.cpp:1833: error: ‘certfile’ was not declared in this scope rpc.cpp:1833: error: ‘filesystem’ has not been declared rpc.cpp:1834: error: ‘filesystem’ has not been declared rpc.cpp:1834: error: ‘certfile’ was not declared in this scope rpc.cpp:1836: error: ‘filesystem’ has not been declared rpc.cpp:1836: error: expected ‘;’ before ‘pkfile’ rpc.cpp:1837: error: ‘pkfile’ was not declared in this scope rpc.cpp:1837: error: ‘filesystem’ has not been declared rpc.cpp:1838: error: ‘filesystem’ has not been declared rpc.cpp:1838: error: ‘pkfile’ was not declared in this scope

  9. jordanlewis commented at 2:56 PM on May 16, 2011: contributor

    Thanks - I didn't see that with g++4.3/amd64 - could you please tell me what platform and compiler you're using?

  10. jordanlewis commented at 3:39 PM on May 16, 2011: contributor

    OK, I fixed the issue.

  11. TheBlueMatt commented at 5:51 PM on May 16, 2011: member

    ui.cpp: In member function ‘virtual void CMainFrame::OnClose(wxCloseEvent&)’: ui.cpp:382:22: error: ‘Shutdown’ was not declared in this scope ui.cpp: In member function ‘virtual void CMainFrame::OnIconize(wxIconizeEvent&)’: ui.cpp:393:25: warning: ‘bool wxIconizeEvent::Iconized() const’ is deprecated (declared at /usr/local/include/wx-2.9/wx/event.h:2072) ui.cpp:401:43: warning: ‘bool wxIconizeEvent::Iconized() const’ is deprecated (declared at /usr/local/include/wx-2.9/wx/event.h:2072) ui.cpp: At global scope: ui.cpp:1541:1: error: ‘filesystem’ in namespace ‘boost’ does not name a type ui.cpp:1552:1: error: ‘filesystem’ in namespace ‘boost’ does not name a type ui.cpp: In function ‘bool GetStartOnSystemStartup()’: ui.cpp:1559:12: error: ‘boost::filesystem’ has not been declared ui.cpp:1559:33: error: expected ‘;’ before ‘optionFile’ ui.cpp:1560:10: error: ‘optionFile’ was not declared in this scope ui.cpp:1564:13: error: ‘optionFile’ was not declared in this scope ui.cpp:1571:5: error: ‘optionFile’ was not declared in this scope ui.cpp: In function ‘void SetStartOnSystemStartup(bool)’: ui.cpp:1580:37: error: ‘GetAutostartFilePath’ was not declared in this scope ui.cpp:1589:16: error: ‘boost::filesystem’ has not been declared ui.cpp:1589:63: error: ‘GetAutostartDir’ was not declared in this scope ui.cpp:1591:16: error: ‘boost::filesystem’ has not been declared ui.cpp:1591:37: error: expected ‘;’ before ‘optionFile’ ui.cpp:1592:14: error: ‘optionFile’ was not declared in this scope ui.cpp:1598:9: error: ‘optionFile’ was not declared in this scope ui.cpp: In member function ‘bool CSendingDialog::Status(const std::string&)’: ui.cpp:2119:54: error: ‘strlcpy’ was not declared in this scope ui.cpp: In member function ‘void CMyTaskBarIcon::Show(bool)’: ui.cpp:2609:71: error: ‘strlcpy’ was not declared in this scope ui.cpp:2621:51: error: ‘strlcpy’ was not declared in this scope ui.cpp: In member function ‘virtual bool CMyApp::OnInit()’: ui.cpp:2847:30: error: ‘AppInit’ was not declared in this scope ui.cpp: In member function ‘virtual int CMyApp::OnExit()’: ui.cpp:2852:18: error: ‘Shutdown’ was not declared in this scope

  12. jordanlewis commented at 7:03 PM on May 16, 2011: contributor

    OK, issue should be fixed for DGUI now as well.

  13. TheBlueMatt commented at 7:24 PM on May 16, 2011: member

    ui.cpp: In function ‘void SetStartOnSystemStartup(bool)’: ui.cpp:1590:9: error: ‘create_directories’ is not a member of ‘boost::filesystem’ ui.cpp: In member function ‘bool CSendingDialog::Status(const std::string&)’: ui.cpp:2120:54: error: ‘strlcpy’ was not declared in this scope ui.cpp: In member function ‘void CMyTaskBarIcon::Show(bool)’: ui.cpp:2610:71: error: ‘strlcpy’ was not declared in this scope ui.cpp:2622:51: error: ‘strlcpy’ was not declared in this scope ui.cpp: In member function ‘virtual bool CMyApp::OnInit()’: ui.cpp:2848:30: error: ‘AppInit’ was not declared in this scope ui.cpp: In member function ‘virtual int CMyApp::OnExit()’: ui.cpp:2853:18: error: ‘Shutdown’ was not declared in this scope

  14. jordanlewis commented at 10:38 PM on May 16, 2011: contributor

    I've rebased the above fixes for further review.

  15. jgarzik commented at 5:28 AM on May 17, 2011: contributor

    All patches look OK. I would elide the *.d commit, because we'll be doing that via GNU autotools as soon as jaromil's branch is pulled (post 0.3.22 release).

  16. Remove some globally unused headers from headers.h 6b783965c4
  17. Only include certain boost headers if necessary. 31f2931281
  18. jordanlewis commented at 12:00 AM on May 18, 2011: contributor

    .d commit elided.

  19. gavinandresen commented at 7:38 PM on June 11, 2011: contributor

    ACK- should be pulled for the release-after-0.3.23

  20. jgarzik referenced this in commit 19ea44208f on Jun 14, 2011
  21. jgarzik merged this on Jun 14, 2011
  22. jgarzik closed this on Jun 14, 2011

  23. zathras-crypto referenced this in commit 31836d75ec on Dec 8, 2014
  24. dexX7 referenced this in commit 67ccdfe5eb on Jan 4, 2016
  25. destenson referenced this in commit c77a6f7bcc on Jun 26, 2016
  26. ptschip referenced this in commit 393ccaa482 on Jan 14, 2017
  27. deadalnix referenced this in commit 02bce6e22e on May 10, 2017
  28. attilaaf referenced this in commit 7c9d417794 on Jan 13, 2020
  29. Losangelosgenetics referenced this in commit 17421aa4a1 on Mar 12, 2020
  30. cryptapus referenced this in commit 75e1546036 on May 3, 2021
  31. rajarshimaitra referenced this in commit 971855289b on Aug 5, 2021
  32. DrahtBot locked this on Sep 8, 2021

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 21:16 UTC

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