-$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
- (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
+ifneq ($(BR2_COMPILE_OPENVPN_WITH_OPENSSL),y)
+DISABLE_OPENSSL:=--disable-ssl --disable-crypto
+else
+PKG_DEPEND+=", libopenssl"
+endif
+
+ifneq ($(BR2_COMPILE_OPENVPN_WITH_LZO),y)
+DISABLE_LZO:=--disable-lzo
+else
+PKG_DEPEND+=", liblzo"
+endif
+
+ifneq ($(BR2_COMPILE_OPENVPN_WITH_SERVER),y)
+DISABLE_SERVER:=--disable-server
+endif
+ifneq ($(BR2_COMPILE_OPENVPN_WITH_HTTP),y)
+DISABLE_HTTP:=--disable-http
+endif
+
+$(PKG_BUILD_DIR)/.configured:
+ (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \