move FreeTDS version check into configure script
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 29 Jun 2006 07:50:01 +0000 (07:50 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 29 Jun 2006 07:50:01 +0000 (07:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@36255 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/Makefile
codecs/Makefile
configure
configure.ac

index 1e77912..e713d94 100644 (file)
@@ -16,18 +16,6 @@ endif
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.c,%,$(wildcard cdr_*.c)))
 
-ifneq ($(FREETDS_LIB),)
-  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
-    CFLAGS += -DFREETDS_0_63
-  else
-       ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
-      CFLAGS += -DFREETDS_0_62
-    else
-      CFLAGS += -DFREETDS_PRE_0_62
-    endif
-  endif
-endif
-
 all: _all
 
 include ../Makefile.rules
index 61c5510..23e9e67 100644 (file)
@@ -18,12 +18,7 @@ endif
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.c,%,$(wildcard codec_*.c)))
 
-ifeq ($(wildcard ilbc/iLBC_decode.h),)
-  MODS:=$(filter-out codec_ilbc,$(MODS))
-else
-  LIBILBC:=ilbc/libilbc.a
-endif
-
+LIBILBC:=ilbc/libilbc.a
 LIBLPC10:=lpc10/liblpc10.a
 
 all: _all
index c31e5be..d27ef58 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 35832 .
+# From configure.ac Revision: 35852 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59e.
 #
 
 
 
+if test "${PBX_LIBFREETDS}" != "0";
+then
+    case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
+    *0.63*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
+       ;;
+    *0.62*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
+       ;;
+    *)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
+       ;;
+    esac
+fi
+
+
 
 # Check whether --with-termcap was given.
 if test "${with_termcap+set}" = set; then
index 9839a85..7da4da6 100644 (file)
@@ -635,6 +635,22 @@ AST_EXT_LIB([speex], [speex_encode], [speex/speex.h], [SPEEX], [Speex], [-lm])
 AST_EXT_LIB([sqlite], [sqlite_exec], [sqlite.h], [SQLITE], [SQLite])
 AST_EXT_LIB([ssl], [ssl2_connect], [openssl/ssl.h], [OPENSSL], [OpenSSL], [-lcrypto])
 AST_EXT_LIB([tds], [tds_version], [tds.h], [FREETDS], [FreeTDS])
+
+if test "${PBX_LIBFREETDS}" != "0";
+then
+    case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
+    *0.63*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
+       ;;
+    *0.62*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
+       ;;
+    *)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
+       ;;
+    esac
+fi
+
 AST_EXT_LIB([termcap], [tgetent], [], [TERMCAP], [Termcap])
 AST_EXT_LIB([tinfo], [tgetent], [], [TINFO], [Term Info])