Skip to content
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

Can't compile on OS X/Missing documentation? #3

Open
kc9jud opened this issue Nov 25, 2013 · 3 comments
Open

Can't compile on OS X/Missing documentation? #3

kc9jud opened this issue Nov 25, 2013 · 3 comments
Milestone

Comments

@kc9jud
Copy link

kc9jud commented Nov 25, 2013

Hello,

I can't seem to get OpenCT to compile on OS X Mavericks. It's giving an error at the linking stage. I'm pretty sure this is a matter of getting the correct configure options, but there doesn't seem to be much documentation about compiling.

Here's the errors:

...
Making all in pcsc
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..   -DOPENCT_CONF_PATH="\"/usr/local/etc/openct.conf\""  -DOPENCT_SOCKET_PATH="\"/usr/local/var/run/openct\""    -DOPENCT_MODULES_PATH="\"/usr/local/lib/ifd\""  -DOPENCT_IFDHANDLER_PATH="\"/usr/local/sbin/ifdhandler\""  -I../../src/include -I../../src/include -I../../src/ctapi -I/usr/local/include/PCSC -I/opt/local/include -no-cpp-precomp -MT openct_ifd_la-pcsc.lo -MD -MP -MF .deps/openct_ifd_la-pcsc.Tpo -c -o openct_ifd_la-pcsc.lo `test -f 'pcsc.c' || echo './'`pcsc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -DOPENCT_CONF_PATH=\"/usr/local/etc/openct.conf\" -DOPENCT_SOCKET_PATH=\"/usr/local/var/run/openct\" -DOPENCT_MODULES_PATH=\"/usr/local/lib/ifd\" -DOPENCT_IFDHANDLER_PATH=\"/usr/local/sbin/ifdhandler\" -I../../src/include -I../../src/include -I../../src/ctapi -I/usr/local/include/PCSC -I/opt/local/include -no-cpp-precomp -MT openct_ifd_la-pcsc.lo -MD -MP -MF .deps/openct_ifd_la-pcsc.Tpo -c pcsc.c  -fno-common -DPIC -o .libs/openct_ifd_la-pcsc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -DOPENCT_CONF_PATH=\"/usr/local/etc/openct.conf\" -DOPENCT_SOCKET_PATH=\"/usr/local/var/run/openct\" -DOPENCT_MODULES_PATH=\"/usr/local/lib/ifd\" -DOPENCT_IFDHANDLER_PATH=\"/usr/local/sbin/ifdhandler\" -I../../src/include -I../../src/include -I../../src/ctapi -I/usr/local/include/PCSC -I/opt/local/include -no-cpp-precomp -MT openct_ifd_la-pcsc.lo -MD -MP -MF .deps/openct_ifd_la-pcsc.Tpo -c pcsc.c -o openct_ifd_la-pcsc.o >/dev/null 2>&1
mv -f .deps/openct_ifd_la-pcsc.Tpo .deps/openct_ifd_la-pcsc.Plo
/bin/sh ../../libtool  --tag=CC   --mode=link gcc  -I../../src/include -I../../src/include -I../../src/ctapi -I/usr/local/include/PCSC -I/opt/local/include -no-cpp-precomp -module -shared -avoid-version -no-undefined -L/opt/local/lib -o openct-ifd.la -rpath /usr/local/lib openct_ifd_la-pcsc.lo -L/usr/local/lib ../../src/ctapi/libopenctapi.la -Wl,-framework,CoreFoundation -lpoll

*** Warning: Linking the shared library openct-ifd.la against the loadable module
*** libopenctapi.so is not portable!
*** Warning: lib libopenctapi.so is a module, not a shared library

*** And there doesn't seem to be a static archive available
*** The link will probably fail, sorry
libtool: link: gcc  -o .libs/openct-ifd.so -bundle  .libs/openct_ifd_la-pcsc.o   -L/opt/local/lib -L/usr/local/lib ../../src/ctapi/.libs/libopenctapi.so /Users/pjfasano/Projects/smartcard/openct/src/ct/.libs/libopenct.dylib -lpoll  -Wl,-framework -Wl,CoreFoundation -Wl,-dylib_file -Wl,/usr/local/lib/libopenct.1.dylib:/Users/pjfasano/Projects/smartcard/openct/src/ct/.libs/libopenct.dylib  
ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file '../../src/ctapi/.libs/libopenctapi.so' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [openct-ifd.la] Error 1
...

Here's my configure command:

$ LDFLAGS="-L/opt/local/lib" CFLAGS=-I/opt/local/include LIBUSB_CFLAGS=-I/opt/local/include/libusb-1.0 LIBUSB_LIBS=-L/opt/local/lib PCSC_CFLAGS=-I/usr/local/include/PCSC PCSC_LIBS=-L/usr/local/lib ./configure --enable-usb --enable-pcsc --with-bundle=/usr/local/lib/pcsc/drivers
@kc9jud
Copy link
Author

kc9jud commented Nov 25, 2013

I managed to build by reverting commit f329c26.

@martinpaljak
Copy link
Member

The best answer would be NOT to use OpenCT on OSX (which has pcsc-lite, old
but "usable"). Is there a specific reason, like some old token?

Martin
+372 515 6495

On Mon, Nov 25, 2013 at 7:45 PM, Patrick Fasano notifications@github.comwrote:

I managed to build by reverting commit f329c26f329c26
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-29223561
.

@kc9jud
Copy link
Author

kc9jud commented Nov 26, 2013

Yes, the Aladdin eToken NG-OTP is unsupported with the version of PC/SC which is included in OS X. I've managed to recompile OpenSC and pcsc-lite -- however, even with after reverting f329c26, I still cannot get pcscd to load the OpenCT bundle. It fails with this error:

00000000 pcscdaemon.c:240:main() pcscd set to foreground with debug send to stdout
00000205 configfile.l:254:DBGetReaderListDir() Parsing conf directory: /usr/local/etc/reader.conf.d
00000044 configfile.l:266:DBGetReaderListDir() Skipping non regular file: .
00000008 configfile.l:266:DBGetReaderListDir() Skipping non regular file: ..
00000009 configfile.l:307:DBGetReaderList() Parsing conf file: /usr/local/etc/reader.conf.d/reader.conf
00000094 pcscdaemon.c:545:main() pcsc-lite 1.8.10 daemon ready.
00139582 hotplug_libusb.c:515:HPAddHotPluggable() Adding USB device: 250:6:0
00000026 readerfactory.c:989:RFInitializeReader() Attempting startup of Aladdin eToken PRO NG OTP 00 00 using /usr/local/lib/pcsc/drivers/openct-ifd.bundle/Contents/MacOS/openct-ifd.so
00000071 dyn_macosx.c:60:DYN_LoadLibrary() CFBundleCreate
00000007 readerfactory.c:996:RFInitializeReader() RFLoadReader failed: 0x80100014
00000004 readerfactory.c:312:RFAddReader() Aladdin eToken PRO NG OTP init failed.
00000052 hotplug_libusb.c:422:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead.
00000006 hotplug_libusb.c:431:HPEstablishUSBNotifications() Polling forced every 1 second(s)
04002049 hotplug_libusb.c:605:HPRemoveHotPluggable() Removing USB device[0]: 250:6:0

@saper saper added this to the 0.6.21 milestone Dec 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants