support -d for generate dynamic library.