[SmartcardServices-Dev] Building using darwinbuild

Ludovic Rousseau ludovic.rousseau at gmail.com
Thu Jul 16 02:14:58 PDT 2009


2009/7/10 William Siegrist <wsiegrist at apple.com>:
> I wanted to report on recent work done to make SmartCardServices buildable
> outside of Apple. You can now build the Tokend and SmartCardServices
> projects that shipped with 10.5.6 and 10.5.7 using darwinbuild. We had to
> add a patch that adds includes that were needed to build with CFLite, but
> otherwise the source is unmodified. Darwinbuild helps by automatically
> putting roots in a chroot that have the private headers you need.
>
> First, install darwinbuild ( http://darwinbuild.macosforge.org/ ), then:
>
> # create a build environment
> $ mkdir ~/9J61 && cd ~/9J61
> $ sudo darwinbuild -init 9J61
>
> # build stuff
> $ sudo darwinbuild SmartCardServices

It worked fine until the C++ compiler is used.
I have X Code 3.0 installed in my Leopard 10.5.7 system and g++-3.3 is
not available. Only g++-4.0 is provided.
In the BuildRoot only g++-4.0 and g++-4.2 are provided.

[...]
Mkdir /private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/i386
    /bin/mkdir  -p
/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/i386

CompileCplusplus
/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/i386/readerstate.o
src/PCSC/readerstate.cpp
    /usr/bin/g++-3.3  -c
-Wp,-header-mapfile,/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/PCSC.hmap
  -F/private/var/tmp/SmartCardServices/SmartCardServices-34733.sym/BuiltProducts
-F/usr/local/SecurityPieces/Frameworks
-I/private/var/tmp/SmartCardServices/SmartCardServices-34733.sym/BuiltProducts/include
-I/private/var/tmp/SmartCardServices/SmartCardServices-34733.root//System/Library/Frameworks/include
-I/private/var/tmp/SmartCardServices/SmartCardServices-34733.sym/BuiltProducts/include
-Isrc/PCSC  -arch i386 -fno-common -fpascal-strings -Os -Wmost
-Wno-four-char-constants -Wno-unknown-pragmas -pipe
"-fmessage-length=0" -g  -pipe -no-cpp-precomp
-I/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/DerivedSources
-I/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/DerivedSources
  "-DNDEBUG" "-Os" "-finline-functions" "-DPCSC_DEBUG=1"
"-DUSE_SYSLOG=1" "-DUSE_DAEMON=1"   src/PCSC/readerstate.cpp  -o
/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/i386/readerstate.o

BuildPhase <CopyResources>PCSC.framework
/bin/sh: line 1: /usr/bin/g++-3.3: No such file or directory

BuildPhase "<CopyResources>PCSC.framework" "<PCSC>PCSC.framework"
    echo  Completed phase "<CopyResources>"  for
"<CopyResources>PCSC.framework"
...failed CompileCplusplus
/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/i386/readerstate.o
...
** BUILD FAILED **
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


I then tried to symlink g++-3.3 to g++-4.2 but compilation fails:

CompileCplusplus
/private/var/tmp/SmartCardServices/SmartCardServices-34733.obj/SmartCardServices.build/PCSC.build/Objects-normal/ppc/readerstate.o
i686-apple-darwin9-g++-4.2.1: unrecognized option '-no-cpp-precomp'
cc1plus: error: unrecognized command line option "-header-mapfile"
** BUILD FAILED **
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


How am I supposed to solve this problem? Port the code/Makefiles to
g++ 4.x or write a g++-3.3 wrapper that removes unsupported options?

Regards,

-- 
 Dr. Ludovic Rousseau


More information about the SmartcardServices-Dev mailing list