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.
This commit is contained in:
Fabrice Fontaine 2012-03-09 23:58:01 +01:00
parent 7aef73d7eb
commit bb140000c0
7 changed files with 60 additions and 3 deletions

View File

@ -2,6 +2,15 @@
Version 1.6.16 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> 2012-03-09 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Optimisation of --disable-webserver Optimisation of --disable-webserver

View File

@ -100,6 +100,21 @@
#define UPNP_HAVE_WEBSERVER 1 #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 /** Defined to 1 if the library has been compiled with helper API
* (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */ * (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */
#define UPNP_HAVE_TOOLS 1 #define UPNP_HAVE_TOOLS 1

View File

@ -99,6 +99,21 @@
#undef UPNP_HAVE_WEBSERVER #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 /** Defined to 1 if the library has been compiled with helper API
* (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */ * (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */
#undef UPNP_HAVE_TOOLS #undef UPNP_HAVE_TOOLS

View File

@ -850,6 +850,7 @@ int UpnpRegisterRootDevice(
"UpnpRegisterRootDevice: No services found for RootDevice\n"); "UpnpRegisterRootDevice: No services found for RootDevice\n");
} }
#if EXCLUDE_GENA == 0
/* /*
* GENA SET UP * GENA SET UP
*/ */
@ -869,6 +870,7 @@ int UpnpRegisterRootDevice(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice: Empty service table\n"); "\nUpnpRegisterRootDevice: Empty service table\n");
} }
#endif /* EXCLUDE_GENA */
UpnpSdkDeviceRegisteredV4 = 1; UpnpSdkDeviceRegisteredV4 = 1;
@ -1009,6 +1011,7 @@ int UpnpRegisterRootDevice2(
"UpnpRegisterRootDevice2: No services found for RootDevice\n"); "UpnpRegisterRootDevice2: No services found for RootDevice\n");
} }
#if EXCLUDE_GENA == 0
/* /*
* GENA SET UP * GENA SET UP
*/ */
@ -1028,6 +1031,7 @@ int UpnpRegisterRootDevice2(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice2: Empty service table\n"); "\nUpnpRegisterRootDevice2: Empty service table\n");
} }
#endif /* EXCLUDE_GENA */
UpnpSdkDeviceRegisteredV4 = 1; UpnpSdkDeviceRegisteredV4 = 1;
@ -1178,6 +1182,7 @@ int UpnpRegisterRootDevice4(
"UpnpRegisterRootDevice4: No services found for RootDevice\n"); "UpnpRegisterRootDevice4: No services found for RootDevice\n");
} }
#if EXCLUDE_GENA == 0
/* /*
* GENA SET UP * GENA SET UP
*/ */
@ -1197,6 +1202,7 @@ int UpnpRegisterRootDevice4(
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"\nUpnpRegisterRootDevice4: Empty service table\n"); "\nUpnpRegisterRootDevice4: Empty service table\n");
} }
#endif /* EXCLUDE_GENA */
if (AddressFamily == AF_INET) { if (AddressFamily == AF_INET) {
UpnpSdkDeviceRegisteredV4 = 1; UpnpSdkDeviceRegisteredV4 = 1;

View File

@ -2,6 +2,7 @@
* *
* Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. * All rights reserved.
* Copyright (c) 2012 France Telecom All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -44,7 +45,7 @@
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
#if EXCLUDE_GENA == 0
#include <stdlib.h> /* for calloc(), free() */ #include <stdlib.h> /* for calloc(), free() */
@ -324,6 +325,6 @@ ClientSubscription *GetClientSubActualSID(ClientSubscription *head, token *sid)
return next; return next;
} }
#endif /* EXCLUDE_GENA */
#endif /* INCLUDE_CLIENT_APIS */ #endif /* INCLUDE_CLIENT_APIS */

View File

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

View File

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