Actually, after fixing the paths in the install_name_tool commands I'm still having problems. I'm not sure how to debug this. I'm using this method to get fgdb support in gdal:http://blog.burhum.com/post/34851795066/installing-gdal-ogr-with-filegdb-support-on-osx-withI copy the api lib and include files to /usr/local/lib /usr/local/include and install gdal no problem, the FileGDB format is recognized by ogrinfo. And it looks like the install_name_tool commands successfully change the gcc reference:
$ install_name_tool -change /usr/lib/libstdc++.6.dylib /usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib /usr/local/lib/libFileGDBAPI.dylib
$ install_name_tool -change /usr/lib/libstdc++.6.dylib /usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib /usr/local/lib/libfgdbunixrtl.dylib
$ otool -L libFileGDBAPI.dylib
libFileGDBAPI.dylib:
@rpath/libFileGDBAPI.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libfgdbunixrtl.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
$ otool -L libfgdbunixrtl.dylib
libfgdbunixrtl.dylib:
@rpath/libfgdbunixrtl.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/usr/local/Cellar/gcc49/4.9-20131103/lib/gcc/x86_64-apple-darwin13.0.0/4.9.0/libstdc++.dylib (compatibility version 7.0.0, current version 52.0.0)
but still no luck using the api:$ ogrinfo Misc.gdb
ogrinfo(81745,0x7fff797e2310) malloc: *** error for object 0x10d219de0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6