Pass --with-opt-dir=/opt/local for macports.
Use a case statement.