Like so?

```ruby
if build.with? "libkml"
  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "libtool" => :build
end
```