diff --git a/ChangeLog b/ChangeLog index 8332c8b..3dec3b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,15 @@ Version 1.6.16 ******************************************************************************* +2012-03-09 Fabrice Fontaine + + 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 Optimisation of --disable-webserver diff --git a/build/inc/upnpconfig.h b/build/inc/upnpconfig.h index 77c1dfb..5ae8ea6 100644 --- a/build/inc/upnpconfig.h +++ b/build/inc/upnpconfig.h @@ -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) : file is available */ #define UPNP_HAVE_TOOLS 1 diff --git a/upnp/inc/upnpconfig.h.in b/upnp/inc/upnpconfig.h.in index 67d2e7c..3be6cc8 100644 --- a/upnp/inc/upnpconfig.h.in +++ b/upnp/inc/upnpconfig.h.in @@ -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) : file is available */ #undef UPNP_HAVE_TOOLS diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index 416e703..aa40f6a 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -850,6 +850,7 @@ int UpnpRegisterRootDevice( "UpnpRegisterRootDevice: No services found for RootDevice\n"); } +#if EXCLUDE_GENA == 0 /* * GENA SET UP */ @@ -869,6 +870,7 @@ int UpnpRegisterRootDevice( UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "\nUpnpRegisterRootDevice: Empty service table\n"); } +#endif /* EXCLUDE_GENA */ UpnpSdkDeviceRegisteredV4 = 1; @@ -1009,6 +1011,7 @@ int UpnpRegisterRootDevice2( "UpnpRegisterRootDevice2: No services found for RootDevice\n"); } +#if EXCLUDE_GENA == 0 /* * GENA SET UP */ @@ -1028,6 +1031,7 @@ int UpnpRegisterRootDevice2( UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "\nUpnpRegisterRootDevice2: Empty service table\n"); } +#endif /* EXCLUDE_GENA */ UpnpSdkDeviceRegisteredV4 = 1; @@ -1178,6 +1182,7 @@ int UpnpRegisterRootDevice4( "UpnpRegisterRootDevice4: No services found for RootDevice\n"); } +#if EXCLUDE_GENA == 0 /* * GENA SET UP */ @@ -1197,6 +1202,7 @@ int UpnpRegisterRootDevice4( UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "\nUpnpRegisterRootDevice4: Empty service table\n"); } +#endif /* EXCLUDE_GENA */ if (AddressFamily == AF_INET) { UpnpSdkDeviceRegisteredV4 = 1; diff --git a/upnp/src/genlib/client_table/client_table.c b/upnp/src/genlib/client_table/client_table.c index 1fe2d78..d0c5aee 100644 --- a/upnp/src/genlib/client_table/client_table.c +++ b/upnp/src/genlib/client_table/client_table.c @@ -2,6 +2,7 @@ * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. + * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -44,7 +45,7 @@ #ifdef INCLUDE_CLIENT_APIS - +#if EXCLUDE_GENA == 0 #include /* for calloc(), free() */ @@ -324,6 +325,6 @@ ClientSubscription *GetClientSubActualSID(ClientSubscription *head, token *sid) return next; } - - #endif /* INCLUDE_CLIENT_APIS */ +#endif /* EXCLUDE_GENA */ +#endif /* INCLUDE_CLIENT_APIS */ diff --git a/upnp/src/genlib/service_table/service_table.c b/upnp/src/genlib/service_table/service_table.c index 3add82d..173e3c1 100644 --- a/upnp/src/genlib/service_table/service_table.c +++ b/upnp/src/genlib/service_table/service_table.c @@ -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 */ diff --git a/upnp/src/urlconfig/urlconfig.c b/upnp/src/urlconfig/urlconfig.c index 00ac1df..26592b7 100644 --- a/upnp/src/urlconfig/urlconfig.c +++ b/upnp/src/urlconfig/urlconfig.c @@ -54,6 +54,9 @@ #include #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 */