Build dynamic libraries for Mobile

Hi there, I learn there are scripts for building OpenCV for iOS and Android : build_framework.py and build_sdk.py. Is there a way to build dynamic libraries using those?
I managed to build dynamic framework for iOS and .so for Android by tweaking the scripts a bit, but those scripts do not seem to have those options exposed.