-nfs-server-compile: portmap-compile
-portmap-compile: tcp_wrappers-compile
-lcd4linux-compile: ncurses-compile
-libnet-compile: libpcap-compile
-mysql-compile: ncurses-compile zlib-compile
-postgresql-compile: zlib-compile
-nmap-compile: uclibc++-compile pcre-compile libpcap-compile
-kismet-compile: uclibc++-compile libpcap-compile
-tinc-compile: zlib-compile openssl-compile lzo-compile
-fprobe-compile: libpcap-compile
+ifeq ($(BR2_PACKAGE_OPENVPN_LZO),y)
+openvpn-compile: lzo-compile
+endif
+
+php4-compile: openssl-compile zlib-compile
+ifneq ($(BR2_PACKAGE_PHP4_MOD_CURL),)
+php4-compile: curl-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_GD),)
+php4-compile: libgd-compile libpng-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_GMP),)
+php4-compile: gmp-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_LDAP),)
+php4-compile: openldap-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_MYSQL),)
+php4-compile: mysql-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_PCRE),)
+php4-compile: pcre-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_PGSQL),)
+php4-compile: postgresql-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_SQLITE),)
+php4-compile: sqlite2-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP4_MOD_XML),)
+php4-compile: expat-compile
+endif
+
+php5-compile: openssl-compile zlib-compile
+ifneq ($(BR2_PACKAGE_PHP5_MOD_CURL),)
+php5-compile: curl-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_GD),)
+php5-compile: libgd-compile libpng-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_GMP),)
+php5-compile: gmp-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_LDAP),)
+php5-compile: openldap-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_MYSQL),)
+php5-compile: mysql-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_PCRE),)
+php5-compile: pcre-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_PGSQL),)
+php5-compile: postgresql-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_SQLITE),)
+php5-compile: sqlite2-compile
+endif
+ifneq ($(BR2_PACKAGE_PHP5_MOD_XML),)
+php5-compile: expat-compile
+endif
+
+pmacct-compile: libpcap-compile
+ifneq ($(BR2_PACKAGE_PMACCT_MYSQL),)
+pmacct-compile: mysql-compile
+endif
+ifneq ($(BR2_PACKAGE_PMACCT_PGSQL),)
+pmacct-compile: postgresql-compile
+endif