Menu

#764 Mac OSX 10.9 / Xcode 5 build instructions

open
nobody
1
2015-01-30
2014-08-12
No

I see an Xcode 5 project has been added in the latest release. I don't see any changes to the build scripts, Makefiles or build documentations.

I have compiled all of pwsafe but linking fails because I was trying to link with wxWidgets built using Xcode4. So before, I start rebuilding my wxWidgets libraries, I thought I'd check in to see what is recommended by the experts. Should I still stick with my old wxWidgets 2.9.4 tree or should I venture into the 3.0.1 release? If you have successfully built for Mac 10.9 with Xcode 5 can you reply with how you did it and what version and configuration of wxWidgets you used?

I'll be happy to compile the information into a set of instructions and issue a pull request.

Thanks!
Mark Clayton

Related

Feature Requests: #764

Discussion

  • Saurav Ghosh

    Saurav Ghosh - 2014-08-15

    If you build wxWidgets 3.x, you will need to merge the wx3-osx branch to master, otherwise pwsafe will crash. For details, please see this:

    http://forums.wxwidgets.org/viewtopic.php?f=1&t=38482

    You should also use Xcode/pwsafe-xcode5.xcodeproj

    Sorry about the delayed reply. I tried to find some time to verify what I’m saying here, but couldn’t. If what I said above doesn’t work, please post back.

     
    • Mark Clayton

      Mark Clayton - 2014-08-16

      I understand not being able answer questions right away. This is a volunteer effort and sometime things take a little while.

      I made an attempt at this before getting your reply. I built the latest release, 3.0.1, of wxWidgets from downloads.
      I configured and built it with a simple: ./configure && make
      This gave me a release build with dynamic libraries. (I’ll probably rebuild later as static libs, but that’s for another day, another post.)

      Then in pwsafe-3.34.1, I generated both pwsafe-release.xconfig & pwsafe.debug.xconfig from the release wxW
      tree (./generate-configs -r ../../../wxWidgets-3.0.1/builds/cocoa/release/wx-config > pwsafe-release.xcconfig
      and ./generate-configs -r ../../../wxWidgets-3.0.1/builds/cocoa/release/wx-config > pwsafe-debug.xcconfig).

      From there I could build (with a few minor code changes, see below) from both Xcode and xcodebuild from the
      command line (xcodebuild -project pwsafe-xcode5.xcodeproj -target pwsafe).

      My build seems to be running fine. After reading the forum post you linked to, I would guess that a crash would be
      obvious. So far so good.

      I made three code changes. Here are the diffs:
      diff -r pwsafe-3.34.1/src/os/mac/debug.cpp pwsafe-3.34.1.jmc/src/os/mac/debug.cpp
      179c179
      < void pws_os::IssueError(const stringT &, bool )


      DWORD pws_os::IssueError(const stringT &, bool )
      diff -r pwsafe-3.34.1/src/os/mac/file.cpp pwsafe-3.34.1.jmc/src/os/mac/file.cpp
      164c164
      < static int filterFunc(struct dirent *de)


      static int filterFunc(const struct dirent *de)
      diff -r pwsafe-3.34.1/src/os/typedefs.h pwsafe-3.34.1.jmc/src/os/typedefs.h
      108c108
      < typedef error_t errno_t;


      //typedef error_t errno_t;
      diff -r pwsafe-3.34.1/src/ui/wxWidgets/pwsafeapp.cpp pwsafe-3.34.1.jmc/src/ui/wxWidgets/pwsafeapp.cpp
      533c533
      < (et == wxEVT_COMMAND_SPINCTRL_UPDATED) ||


      // (et == wxEVT_COMMAND_SPINCTRL_UPDATED) ||

      I would love to get your opinion on my changes and my build methods.

      Thanks!
      Mark

      On Aug 15, 2014, at 1:39, Saurav Ghosh sauravg@users.sf.net wrote:

      If you build wxWidgets 3.x, you will need to merge the wx3-osx branch to master, otherwise pwsafe will crash. For details, please see this:

      http://forums.wxwidgets.org/viewtopic.php?f=1&t=38482

      You should also use Xcode/pwsafe-xcode5.xcodeproj

      Sorry about the delayed reply. I tried to find some time to verify what I’m saying here, but couldn’t. If what I said above doesn’t work, please post back.

      [feature-requests:#764] Mac OSX 10.9 / Xcode 5 build instructions

      Status: open
      Group: Next_Release_(example)
      Labels: OSX Xcode 5 build docs
      Created: Tue Aug 12, 2014 07:52 PM UTC by Mark Clayton
      Last Updated: Tue Aug 12, 2014 07:52 PM UTC
      Owner: nobody

      I see an Xcode 5 project has been added in the latest release. I don't see any changes to the build scripts, Makefiles or build documentations.

      I have compiled all of pwsafe but linking fails because I was trying to link with wxWidgets built using Xcode4. So before, I start rebuilding my wxWidgets libraries, I thought I'd check in to see what is recommended by the experts. Should I still stick with my old wxWidgets 2.9.4 tree or should I venture into the 3.0.1 release? If you have successfully built for Mac 10.9 with Xcode 5 can you reply with how you did it and what version and configuration of wxWidgets you used?

      I'll be happy to compile the information into a set of instructions and issue a pull request.

      Thanks!
      Mark Clayton

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/passwordsafe/feature-requests/764/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #764

      • Saurav Ghosh

        Saurav Ghosh - 2014-08-17

        So whatever broke pwsafe in wxWidgets 3.0.0 has been fixed in 3.0.1. Great! But I have yet to try it myself.

        If you are building pwsafe for use only on the build machine, it shouldn’t matter whether wxWidgets is built for shared libraries or static ones. But if you see any issues with shared libraries that are not present with static ones, please post about those.

        You are right about the crash being obvious. pwsafe would crash right at startup (or immediately after login, not sure right now). You can’t miss it.

        Regarding the diffs:

        1. For mac/debug.cpp, didn’t you make any other changes? How does it compile if you only change the function signature to return DWORD from void, but don’t actually return anything in the function body?

        2. The second change is actually part of the wx3-osx branch. You’d need that with Xcode5 (or the 10.9 SDK).

        3. I’m not sure why you had to comment out that line. Was the wxEVT_COMMAND_SPINCTRL_UPDATED symbol not found by the compiler? If so, you should probably wrap that change in #if wxCHECK_VERSION(3, 0, 1)/#endif. Or may be include <wx spinctrl.h=""> so the symbol is available.

         
        • Saurav Ghosh

          Saurav Ghosh - 2014-08-17

          I just updated my checkout and built with wx3.0.1. I needed to make similar changes as yours (diffs below), and I checked those in. So you might want to “reset" your local changes and update your copy, and things should just build.

          I indeed seems that wx3-osx doesn’t need to be merged anymore for pwsafe to work with wx3. pwsafe ran fine for the few simple things I tried. Let’s hope it stays that way.

          One minor thing: for building wxWidgets in the future, you might want to use the Misc/osx-build-wx script:

          Create a build directory

          wxWidgets-3.0.1$ mkdir static-debug ; cd !$

          Run $WX/configure with appropriate params for OS & wx version. Debug build needs -d

          wxWidgets-3.0.1/static-debug$ $PWSAFE/Misc/osx-build-wx -d ../configure

          osx-build-wx only runs wx’s configure script. Must run make yourself

          wxWidgets-3.0.1/static-debug$ make

          1eb7315 #include spinctrl.h so wxEVT_COMMAND_SPINCTRL_UPDATED is available in wx3.0.1
          diff --git a/src/ui/wxWidgets/pwsafeapp.cpp b/src/ui/wxWidgets/pwsafeapp.cpp
          index 166ffb4..02c3dc0 100644
          --- a/src/ui/wxWidgets/pwsafeapp.cpp
          +++ b/src/ui/wxWidgets/pwsafeapp.cpp
          @@ -50,6 +50,8 @@ using namespace std;
          #include "../../core/PWSLog.h"
          #include "./pwsmenushortcuts.h"

          +#include <wx spinctrl.h="">
          +
          #ifdef WXMSW
          #include <wx msw="" msvcrt.h="">
          #endif
          f047a45 Fixed errot_t typedef
          diff --git a/src/os/typedefs.h b/src/os/typedefs.h
          index 26943ef..6a6e21b 100644
          --- a/src/os/typedefs.h
          +++ b/src/os/typedefs.h
          @@ -105,7 +105,7 @@ typedef uint16_t uint16;
          typedef uint32_t uint32;
          typedef uint64_t uint64;

          -typedef error_t errno_t;
          +typedef errno_t error_t;

          #ifdef UNICODE
          #ifndef _T
          1ff9539 scandir() helpers have different signature in Xcode5 or 10.9 SDK
          diff --git a/src/os/mac/file.cpp b/src/os/mac/file.cpp
          index 43574ab..0b4ff15 100644
          --- a/src/os/mac/file.cpp
          +++ b/src/os/mac/file.cpp
          @@ -161,7 +161,18 @@ bool pws_os::DeleteAFile(const stringT &filename)

          static string filterString;

          +#if defined(x86_64) || defined(x86_64) || defined(amd64) || defined(amd64)
          +#define build_is_64_bit
          +#endif
          +
          +// I don't even know the platform/sdk where scandir() requires this new signature of filterfunc, so I'm trying to
          +// deduce if we are building 64-bit with Xcode 5. May be this is more of a SDK-dependent thing,
          +// but I'm not sure right now. Also note that this has nothing to do with wxWidgets
          +#if defined(PWS_MACINTOSH) && defined(clang) && (clang_major >= 5) && defined(build_is_64_bit)
          +static int filterFunc(const struct dirent de)
          +#else
          static int filterFunc(struct dirent
          de)
          +#endif
          {
          return fnmatch(filterString.c_str(), de->d_name, 0) == 0;
          }

           
          • Mark Clayton

            Mark Clayton - 2014-08-18

            Thanks! This is awesome information! I’ll rebuild with osx-build-wx3. Also I see you found the scandir issue I found. I don’t know why it didn’t show up in my diff though.

            Thanks again, Mark

            On Aug 17, 2014, at 12:59, Saurav Ghosh sauravg@users.sf.net wrote:

            I just updated my checkout and built with wx3.0.1. I needed to make similar changes as yours (diffs below), and I checked those in. So you might want to “reset" your local changes and update your copy, and things should just build.

            I indeed seems that wx3-osx doesn’t need to be merged anymore for pwsafe to work with wx3. pwsafe ran fine for the few simple things I tried. Let’s hope it stays that way.

            One minor thing: for building wxWidgets in the future, you might want to use the Misc/osx-build-wx script:

            Create a build directory

            wxWidgets-3.0.1$ mkdir static-debug ; cd !$

            Run $WX/configure with appropriate params for OS & wx version. Debug build needs -d

            wxWidgets-3.0.1/static-debug$ $PWSAFE/Misc/osx-build-wx -d ../configure

            osx-build-wx only runs wx’s configure script. Must run make yourself

            wxWidgets-3.0.1/static-debug$ make

            1eb7315 #include spinctrl.h so wxEVT_COMMAND_SPINCTRL_UPDATED is available in wx3.0.1
            diff --git a/src/ui/wxWidgets/pwsafeapp.cpp b/src/ui/wxWidgets/pwsafeapp.cpp
            index 166ffb4..02c3dc0 100644
            --- a/src/ui/wxWidgets/pwsafeapp.cpp
            +++ b/src/ui/wxWidgets/pwsafeapp.cpp
            @@ -50,6 +50,8 @@ using namespace std;

            include "../../core/PWSLog.h"

            include "./pwsmenushortcuts.h"

            +#include <wx spinctrl.h="">
            +

            ifdef WXMSW

            include <wx msw="" msvcrt.h="">

            endif

            f047a45 Fixed errot_t typedef
            diff --git a/src/os/typedefs.h b/src/os/typedefs.h
            index 26943ef..6a6e21b 100644
            --- a/src/os/typedefs.h
            +++ b/src/os/typedefs.h
            @@ -105,7 +105,7 @@ typedef uint16_t uint16;
            typedef uint32_t uint32;
            typedef uint64_t uint64;

            -typedef error_t errno_t;
            +typedef errno_t error_t;

            ifdef UNICODE

            ifndef _T

            1ff9539 scandir() helpers have different signature in Xcode5 or 10.9 SDK
            diff --git a/src/os/mac/file.cpp b/src/os/mac/file.cpp
            index 43574ab..0b4ff15 100644
            --- a/src/os/mac/file.cpp
            +++ b/src/os/mac/file.cpp
            @@ -161,7 +161,18 @@ bool pws_os::DeleteAFile(const stringT &filename)

            static string filterString;

            +#if defined(x86_64) || defined(x86_64) || defined(amd64) || defined(amd64)
            +#define build_is_64_bit
            +#endif
            +
            +// I don't even know the platform/sdk where scandir() requires this new signature of filterfunc, so I'm trying to
            +// deduce if we are building 64-bit with Xcode 5. May be this is more of a SDK-dependent thing,
            +// but I'm not sure right now. Also note that this has nothing to do with wxWidgets
            +#if defined(PWS_MACINTOSH) && defined(clang) && (clang_major >= 5) && defined(build_is_64_bit)
            +static int filterFunc(const struct dirent de)
            +#else
            static int filterFunc(struct dirent de)
            +#endif
            {
            return fnmatch(filterString.c_str(), de->d_name, 0) == 0;
            }

            [feature-requests:#764] Mac OSX 10.9 / Xcode 5 build instructions

            Status: open
            Group: Next_Release_(example)
            Labels: OSX Xcode 5 build docs
            Created: Tue Aug 12, 2014 07:52 PM UTC by Mark Clayton
            Last Updated: Sun Aug 17, 2014 01:56 AM UTC
            Owner: nobody

            I see an Xcode 5 project has been added in the latest release. I don't see any changes to the build scripts, Makefiles or build documentations.

            I have compiled all of pwsafe but linking fails because I was trying to link with wxWidgets built using Xcode4. So before, I start rebuilding my wxWidgets libraries, I thought I'd check in to see what is recommended by the experts. Should I still stick with my old wxWidgets 2.9.4 tree or should I venture into the 3.0.1 release? If you have successfully built for Mac 10.9 with Xcode 5 can you reply with how you did it and what version and configuration of wxWidgets you used?

            I'll be happy to compile the information into a set of instructions and issue a pull request.

            Thanks!
            Mark Clayton

            Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/passwordsafe/feature-requests/764/

            To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

             

            Related

            Feature Requests: #764


Log in to post a comment.