aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-24 17:11:45 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-24 17:11:45 +0000
commit29f496ef12247a2401d02428fa533020b588f5b6 (patch)
tree170532911902642fdae405ec644509398b0b6ee5 /res
parent3cbcc049473cb374710364337d0d415c56133b0e (diff)
Thanks to the fine work of Russell Bryant and Dancho Lazarov, we now have autoconf and menuselect tools for Asterisk!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22267 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/Makefile119
-rw-r--r--res/res_config_odbc.c4
-rw-r--r--res/res_config_pgsql.c4
-rw-r--r--res/res_crypto.c6
-rw-r--r--res/res_musiconhold.c26
-rw-r--r--res/res_odbc.c5
-rw-r--r--res/res_osp.c13
-rw-r--r--res/res_snmp.c4
8 files changed, 72 insertions, 109 deletions
diff --git a/res/Makefile b/res/Makefile
index 83a68d165..bd9c44618 100644
--- a/res/Makefile
+++ b/res/Makefile
@@ -11,25 +11,10 @@
# the GNU General Public License
#
-MODS:=$(patsubst %.c,%.so,$(wildcard res_*.c))
+MODS:=$(filter-out $(MENUSELECT_RES),$(patsubst %.c,%.so,$(wildcard res_*.c)))
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
- MODS:=$(filter-out res_odbc.so,$(MODS))
- MODS:=$(filter-out res_config_odbc.so,$(MODS))
-else
- ifeq (${OSARCH},FreeBSD)
- MODS:=$(filter-out $(shell if test ${BSDVERSION} -lt 500000 ; then echo "res_config_odbc.so"; fi),$(MODS))
- endif
-endif
-
-ifeq ($(NOCRYPTO),yes)
- MODS:=$(filter-out res_crypto.so,$(MODS))
- MODS:=$(filter-out res_osp.so,$(MODS))
-endif
-
-OSPLIB:=$(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libosptk.a $(CROSS_COMPILE_TARGET)/usr/local/lib/libosptk.a)
-ifeq (${OSPLIB},)
- MODS:=$(filter-out res_osp.so,$(MODS))
+ifeq ($(OSARCH),FreeBSD)
+ MODS:=$(filter-out $(shell if test ${BSDVERSION} -lt 500000 ; then echo "res_config_odbc.so"; fi),$(MODS))
endif
# NETsnmp has some difficulties on some platforms (conflict with unload_module)
@@ -43,82 +28,17 @@ else
endif
endif
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/pgsql $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql $(CROSS_COMPILE_TARGET)/opt/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
- MODS:=$(filter-out res_config_pgsql.so,$(MODS))
-endif
-
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/net-snmp/net-snmp-config.h),)
MODS:=$(filter-out res_snmp.so,$(MODS))
else
SNMP_LDLIBS+=$(shell net-snmp-config --agent-libs)
endif
-ifeq (${WITH_SMDI},)
- MODS:=$(filter-out res_smdi.so,$(MODS))
-endif
-
-MLFLAGS=
-
-# Now, go find postgresql libraries
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/postgresql
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/postgresql
-endif
-
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/pgsql/lib
-endif
-
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/pgsql
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
-endif
-
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
-endif
-
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/opt/pgsql/include
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/opt/pgsql/lib
-endif
-
-ifneq ($(wilcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql),)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/postgresql
-endif
-
-ifneq ($(wilcard $(CROSS_COMPILE_TARGET)/usr/lib/libpq.so),)
- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib
-endif
-
-ifeq (${OSARCH},CYGWIN)
- CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
- CYGSOLIB=-L.. -L. -lasterisk.dll
- CYG_RES_CONFIG_ODBC_LIB=-lres_odbc.so
- CYG_RES_FEATURES_LIB=-lres_adsi.so -lres_monitor.so
- MODS:=$(filter-out res_musiconhold.so,$(MODS))
-endif
-
-CRYPTO_LIBS=-lssl -lcrypto
-
-CFLAGS+=
-
-ifndef WITHOUT_ZAPTEL
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
- CFLAGS+=-DZAPATA_MOH
-endif
-endif # WITHOUT_ZAPTEL
#
# Work around buggy RedHat 9.0
#
-ifeq (${OSARCH},CYGWIN)
CFLAGS+=-DOPENSSL_NO_KRB5
-else
-CFLAGS+=-DOPENSSL_NO_KRB5 -fPIC
-endif
all: depend $(MODS)
@@ -142,7 +62,10 @@ install: all
uninstall:
res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CRYPTO_LIBS)
+ $(CC) $(SOLINK) -o $@ $< $(SSL_LIB)
+
+res_crypto.o: res_crypto.c
+ $(CC) -c -o $@ $(CFLAGS) $(SSL_INCLUDE) $<
clean-depend:
rm -f .depend
@@ -151,25 +74,31 @@ clean: clean-depend
rm -f *.so *.o
res_odbc.so: res_odbc.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
+ $(CC) $(SOLINK) -o $@ $< $(ODBC_LIB)
-res_osp.so: res_osp.o $(OSPLIB)
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(OSPLIB) $(CRYPTO_LIBS)
+res_odbc.o: res_odbc.c
+ $(CC) -c -o $@ $(CFLAGS) $(ODBC_INCLUDE) $<
-%.so : %.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+res_osp.so: res_osp.o
+ $(CC) $(SOLINK) -o $@ $< $(OSPTK_LIB)
+
+res_osp.o: res_osp.c
+ $(CC) -c -o $@ $(CFLAGS) $(OSPTK_INCLUDE) $<
-res_features.so: res_features.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} ${CYG_RES_FEATURES_LIB}
+%.so : %.o
+ $(CC) -o $@ $(SOLINK) $<
-res_config_odbc.so: res_config_odbc.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} ${CYG_RES_CONFIG_ODBC_LIB}
+res_config_odbc.o: res_config_odbc.c
+ $(CC) -c -o $@ $(CFLAGS) $(ODBC_INCLUDE) $<
res_snmp.so: res_snmp.o snmp/agent.o
- $(CC) $(SOLINK) ${SNMP_LDFLAGS} -o $@ ${CYGSOLINK} res_snmp.o snmp/agent.o ${CYGSOLIB} ${SNMP_LDLIBS}
+ $(CC) $(SOLINK) $(SNMP_LDFLAGS) -o $@ $< snmp/agent.o $(SNMP_LDLIBS)
res_config_pgsql.so: res_config_pgsql.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lpq -lz $(MLFLAGS)
+ $(CC) $(SOLINK) -o $@ $< $(PGSQL_LIB)
+
+res_config_pgsql.o: res_config_pgsql.c
+ $(CC) -c -o $@ $(CFLAGS) $(PGSQL_INCLUDE) $<
ifneq ($(wildcard .depend),)
include .depend
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c
index e48b01c02..31a2d1513 100644
--- a/res/res_config_odbc.c
+++ b/res/res_config_odbc.c
@@ -28,6 +28,10 @@
* \arg http://www.unixodbc.org
*/
+/*** MODULEINFO
+ <depend>unixodbc</depend>
+ ***/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index 61046c84b..ca23508c2 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -22,6 +22,10 @@
* \arg http://www.postgresql.org
*/
+/*** MODULEINFO
+ <depend>pgsql</depend>
+ ***/
+
#include <stdlib.h>
#include <string.h>
#include <libpq-fe.h> /* PostgreSQL */
diff --git a/res/res_crypto.c b/res/res_crypto.c
index d7c74d79f..e4d7ade8b 100644
--- a/res/res_crypto.c
+++ b/res/res_crypto.c
@@ -23,6 +23,10 @@
* \author Mark Spencer <markster@digium.com>
*/
+/*** MODULEINFO
+ <depend>ssl</depend>
+ ***/
+
#include <sys/types.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -612,4 +616,6 @@ static const char *key(void)
{
return ASTERISK_GPL_KEY;
}
+
STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
+
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 30a363574..061934335 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -25,6 +25,10 @@
* \author Mark Spencer <markster@digium.com>
*/
+/*** MODULEINFO
+ <conflict>win32</conflict>
+ ***/
+
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
@@ -37,13 +41,6 @@
#include <netinet/in.h>
#include <sys/stat.h>
#include <dirent.h>
-#ifdef ZAPATA_MOH
-#ifdef __linux__
-#include <linux/zaptel.h>
-#else
-#include <zaptel.h>
-#endif /* __linux__ */
-#endif
#include <unistd.h>
#include <sys/ioctl.h>
@@ -51,6 +48,14 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#ifdef HAVE_ZAPTEL
+#ifdef __linux__
+#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
+#endif
+
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
@@ -796,7 +801,7 @@ static int moh_scan_files(struct mohclass *class) {
static int moh_register(struct mohclass *moh, int reload)
{
-#ifdef ZAPATA_MOH
+#ifdef HAVE_ZAPTEL
int x;
#endif
ast_mutex_lock(&moh_lock);
@@ -834,7 +839,7 @@ static int moh_register(struct mohclass *moh, int reload)
ast_set_flag(moh, MOH_QUIET);
moh->srcfd = -1;
-#ifdef ZAPATA_MOH
+#ifdef HAVE_ZAPTEL
/* Open /dev/zap/pseudo for timing... Is
there a better, yet reliable way to do this? */
moh->pseudofd = open("/dev/zap/pseudo", O_RDONLY);
@@ -1228,3 +1233,4 @@ static const char *key(void)
}
STD_MOD(MOD_0 | NO_USECOUNT | NO_UNLOAD, reload, NULL, NULL);
+
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 76fd217ac..56d110152 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -19,7 +19,6 @@
* at the top of the source tree.
*/
-
/*! \file
*
* \brief ODBC resource manager
@@ -30,6 +29,10 @@
* \arg See also: \ref cdr_odbc
*/
+/*** MODULEINFO
+ <depend>unixodbc</depend>
+ ***/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/res/res_osp.c b/res/res_osp.c
index b8a6fd8ac..17b605fce 100644
--- a/res/res_osp.c
+++ b/res/res_osp.c
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -25,9 +25,14 @@
* \arg See also: \ref app_osplookup.c
*/
+/*** MODULEINFO
+ <depend>libosptk</depend>
+ <depend>ssl</depend>
+ ***/
+
#include <sys/types.h>
-#include <osp.h>
-#include <osputils.h>
+#include <osp/osp.h>
+#include <osp/osputils.h>
#include <openssl/err.h>
#include <stdio.h>
#include <dirent.h>
@@ -1106,3 +1111,5 @@ static const char *key(void)
}
STD_MOD(MOD_0, reload, NULL, NULL)
+
+
diff --git a/res/res_snmp.c b/res/res_snmp.c
index a399b8b8c..39e2cdb36 100644
--- a/res/res_snmp.c
+++ b/res/res_snmp.c
@@ -14,6 +14,10 @@
* \author Thorsten Lockert <tholo@voop.as>
*/
+/*** MODULEINFO
+ <defaultenabled>no</defaultenabled>
+ ***/
+
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")