OSX pecularities

Zbigniew Diaczyszyn edited this page Apr 2, 2014 · 5 revisions

1. Compiling a C extension for OSX

Testing environment:

  • OSX Tcl version 8.5.7
  • gcc version 4.2.1 (Apple Inc. build 5646)
  • PWGorilla 8.5.7

How to create the stretchkey extension:

gcc -dynamiclib -fno-common -O3 -fomit-frame-pointer -DUSE_TCL_STUBS -fPIC -DRUNTIME_ENDIAN -Wall \
-I /Library/Frameworks/Tcl.framework/Headers/ \
-I /Library/Frameworks/Tcl.framework/PrivateHeaders/ \
stretch.c sha256.c \
-L/Library/Frameworks/Tcl.framework/Versions/8.5/ -ltclstub8.5  \
-o stretchkey.dylib

How to create the twofish extension:

gcc -dynamiclib -fno-common -O3 -fomit-frame-pointer -DUSE_TCL_STUBS -fPIC -Wall \
-I /Library/Frameworks/Tcl.framework/Headers/ \
-I /Library/Frameworks/Tcl.framework/PrivateHeaders/ \
twofish2tcl.c \
-L/Library/Frameworks/Tcl.framework/Versions/8.5/ -ltclstub8.5  \
-o twofish.dylib

To control the 32/64bit versions add the option -m32 or -m64

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.