From fa17ec0a03fffe6e8a3699485306d9c3ea61a5a5 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 28 Feb 2011 14:19:09 +0000 Subject: dahdi: Do not rebuild dahdi-base.c when only updating the version. This moves the version string into dahdi-version.c that is then linked into dahdi-base.c and dahdi-sysfs.c. This speeds builds on slow computers since dahdi-base.c and dahdi-sysfs.c does not need to be rebuilt if only the version string is changing. Signed-off-by: Shaun Ruffell Acked-by: Oron Peled git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9777 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/Kbuild | 2 +- drivers/dahdi/dahdi-base.c | 4 +--- drivers/dahdi/dahdi-sysfs.c | 3 +-- drivers/dahdi/dahdi-version.c | 33 +++++++++++++++++++++++++++++++++ drivers/dahdi/dahdi.h | 1 + 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 drivers/dahdi/dahdi-version.c (limited to 'drivers/dahdi') diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild index e138573..ec881dc 100644 --- a/drivers/dahdi/Kbuild +++ b/drivers/dahdi/Kbuild @@ -76,7 +76,7 @@ CFLAGS_dahdi_dynamic_ethmf.o := -DNEW_SKB_LINEARIZE endif endif -dahdi-objs := dahdi-base.o dahdi-sysfs.o +dahdi-objs := dahdi-base.o dahdi-sysfs.o dahdi-version.o ############################################################################### # Find appropriate ARCH value for VPMADT032 and HPEC binary modules diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index e7951c0..8a634d3 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -62,7 +62,6 @@ #define DAHDI_PRINK_MACROS_USE_debug #define module_printk(level, fmt, args...) printk(level "%s: " fmt, THIS_MODULE->name, ## args) -#include /* Grab fasthdlc with tables */ #define FAST_HDLC_NEED_TABLES #include @@ -4799,7 +4798,7 @@ static int dahdi_ioctl_get_version(unsigned long data) size_t space = sizeof(vi.echo_canceller) - 1; memset(&vi, 0, sizeof(vi)); - strlcpy(vi.version, DAHDI_VERSION, sizeof(vi.version)); + strlcpy(vi.version, dahdi_version, sizeof(vi.version)); spin_lock(&ecfactory_list_lock); list_for_each_entry(cur, &ecfactory_list, list) { strncat(vi.echo_canceller + strlen(vi.echo_canceller), @@ -9148,7 +9147,6 @@ MODULE_LICENSE("GPL v2"); * for that. So make dahdi provide it for now. This alias may be removed * in the future, and users are encouraged not to rely on it. */ MODULE_ALIAS("dahdi_dummy"); -MODULE_VERSION(DAHDI_VERSION); module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "Sets debugging verbosity as a bitfield, to see"\ diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c index 0c7d0b6..5de4bcf 100644 --- a/drivers/dahdi/dahdi-sysfs.c +++ b/drivers/dahdi/dahdi-sysfs.c @@ -4,7 +4,6 @@ #include #include #include -#include #include "dahdi.h" @@ -182,7 +181,7 @@ int __init dahdi_sysfs_init(const struct file_operations *dahdi_fops) } module_printk(KERN_INFO, "Telephony Interface Registered on major %d\n", DAHDI_MAJOR); - module_printk(KERN_INFO, "Version: %s\n", DAHDI_VERSION); + module_printk(KERN_INFO, "Version: %s\n", dahdi_version); dahdi_class = class_create(THIS_MODULE, "dahdi"); if (!dahdi_class) { diff --git a/drivers/dahdi/dahdi-version.c b/drivers/dahdi/dahdi-version.c new file mode 100644 index 0000000..c360a9d --- /dev/null +++ b/drivers/dahdi/dahdi-version.c @@ -0,0 +1,33 @@ +/* + * Dahdi Version + * + * Copyright (C) 2001 Jim Dixon / Zapata Telephony. + * Copyright (C) 2011 Digium, Inc. + * + * All rights reserved. + * + */ + +/* + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2 as published by the + * Free Software Foundation. See the LICENSE file included with + * this program for more details. + */ + +#include + +#include +#include + +#include "dahdi.h" + +const char *const dahdi_version = DAHDI_VERSION; + +MODULE_VERSION(DAHDI_VERSION); diff --git a/drivers/dahdi/dahdi.h b/drivers/dahdi/dahdi.h index 54960dd..92ddbdc 100644 --- a/drivers/dahdi/dahdi.h +++ b/drivers/dahdi/dahdi.h @@ -25,6 +25,7 @@ */ extern int debug; +extern const char *const dahdi_version; int dahdi_register_chardev(struct dahdi_chardev *dev); int dahdi_unregister_chardev(struct dahdi_chardev *dev); -- cgit v1.2.3