More compilaton optimisation

Do not compile most of service_table.c and client_table.c if
--disable-gena is used.
Do not compile urlconfig.c if --disable-webserver is used.
Adding new UPNP_HAVE_xxx variables in upnpconfig.h and upnpconfig.h.in.

(forward port of commit bb140000c0)
This commit is contained in:
Fabrice Fontaine 2012-03-09 23:58:01 +01:00 committed by Marcelo Roberto Jimenez
parent a12d5a6f7d
commit 77d42c2db1
6 changed files with 56 additions and 0 deletions

View File

@ -318,6 +318,15 @@ Version 1.8.0
Version 1.6.16
*******************************************************************************
2012-03-09 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
More compilaton optimisation
Do not compile most of service_table.c and client_table.c if
--disable-gena is used.
Do not compile urlconfig.c if --disable-webserver is used.
Adding new UPNP_HAVE_xxx variables in upnpconfig.h and upnpconfig.h.in.
2012-03-09 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Optimisation of --disable-webserver

View File

@ -100,6 +100,21 @@
#define UPNP_HAVE_WEBSERVER 1
/** Defined to 1 if the library has been compiled with the SSDP part enabled
* (i.e. configure --enable-ssdp) */
#define UPNP_HAVE_SSDP 1
/** Defined to 1 if the library has been compiled with the SOAP part enabled
* (i.e. configure --enable-soap) */
#define UPNP_HAVE_SOAP 1
/** Defined to 1 if the library has been compiled with the GENA part enabled
* (i.e. configure --enable-gena) */
#define UPNP_HAVE_GENA 1
/** Defined to 1 if the library has been compiled with helper API
* (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */
#define UPNP_HAVE_TOOLS 1

View File

@ -99,6 +99,21 @@
#undef UPNP_HAVE_WEBSERVER
/** Defined to 1 if the library has been compiled with the SSDP part enabled
* (i.e. configure --enable-ssdp) */
#undef UPNP_HAVE_SSDP
/** Defined to 1 if the library has been compiled with the SOAP part enabled
* (i.e. configure --enable-soap) */
#undef UPNP_HAVE_SOAP
/** Defined to 1 if the library has been compiled with the GENA part enabled
* (i.e. configure --enable-gena) */
#undef UPNP_HAVE_GENA
/** Defined to 1 if the library has been compiled with helper API
* (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */
#undef UPNP_HAVE_TOOLS

View File

@ -883,6 +883,7 @@ int UpnpRegisterRootDevice(
"UpnpRegisterRootDevice: No services found for RootDevice\n");
}
#if EXCLUDE_GENA == 0
/*
* GENA SET UP
*/
@ -902,6 +903,7 @@ int UpnpRegisterRootDevice(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice: Empty service table\n");
}
#endif /* EXCLUDE_GENA */
UpnpSdkDeviceRegisteredV4 = 1;
@ -1042,6 +1044,7 @@ int UpnpRegisterRootDevice2(
"UpnpRegisterRootDevice2: No services found for RootDevice\n");
}
#if EXCLUDE_GENA == 0
/*
* GENA SET UP
*/
@ -1061,6 +1064,7 @@ int UpnpRegisterRootDevice2(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice2: Empty service table\n");
}
#endif /* EXCLUDE_GENA */
UpnpSdkDeviceRegisteredV4 = 1;
@ -1211,6 +1215,7 @@ int UpnpRegisterRootDevice4(
"UpnpRegisterRootDevice4: No services found for RootDevice\n");
}
#if EXCLUDE_GENA == 0
/*
* GENA SET UP
*/
@ -1230,6 +1235,7 @@ int UpnpRegisterRootDevice4(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice4: Empty service table\n");
}
#endif /* EXCLUDE_GENA */
if (AddressFamily == AF_INET) {
UpnpSdkDeviceRegisteredV4 = 1;

View File

@ -43,6 +43,7 @@
#ifdef INCLUDE_DEVICE_APIS
#if EXCLUDE_GENA == 0
/************************************************************************
* Function : copy_subscription
*
@ -322,6 +323,7 @@ FindServiceEventURLPath( service_table * table,
return NULL;
}
#endif /* EXCLUDE_GENA */
/************************************************************************
* Function : FindServiceControlURLPath
@ -339,6 +341,7 @@ FindServiceEventURLPath( service_table * table,
*
* Note :
************************************************************************/
#if EXCLUDE_SOAP == 0
service_info *
FindServiceControlURLPath( service_table * table,
const char *controlURLPath )
@ -370,6 +373,7 @@ FindServiceControlURLPath( service_table * table,
return NULL;
}
#endif /* EXCLUDE_SOAP */
/************************************************************************
* Function : printService
@ -515,6 +519,7 @@ void printServiceTable(
printServiceList( table->serviceList, level, module );}
#endif
#if EXCLUDE_GENA == 0
/************************************************************************
* Function : freeService
*
@ -1062,6 +1067,7 @@ getServiceTable( IXML_Node * node,
return 0;
}
#endif /* EXCLUDE_GENA */
#endif /* INCLUDE_DEVICE_APIS */

View File

@ -54,6 +54,9 @@
#include <sys/types.h>
#endif
#ifdef INCLUDE_DEVICE_APIS
#ifdef INTERNAL_WEB_SERVER
/************************************************************************
* Function : addrToString
*
@ -417,3 +420,5 @@ error_handler:
}
return err_code;
}
#endif /* INCLUDE_DEVICE_APIS */
#endif /* INTERNAL_WEB_SERVER */