[svn-commits] dbailey: branch 1.4 r189601 - in /branches/1.4: ./ include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 21 09:00:59 CDT 2009


Author: dbailey
Date: Tue Apr 21 09:00:55 2009
New Revision: 189601

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=189601
Log:
Add check in configure script to check for GLOB_NOMAGIC and GLOB_BRACE in glob.h 
This allows config.c to compile when linked against uclibc that does not support these parameters

Modified:
    branches/1.4/configure
    branches/1.4/configure.ac
    branches/1.4/include/asterisk/autoconfig.h.in
    branches/1.4/include/asterisk/compat.h
    branches/1.4/main/config.c

Modified: branches/1.4/configure.ac
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/configure.ac?view=diff&rev=189601&r1=189600&r2=189601
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Tue Apr 21 09:00:55 2009
@@ -429,6 +429,24 @@
 		AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
 		AC_MSG_RESULT(no)
 	),
+	AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(for GLOB_NOMAGIC)
+AC_LINK_IFELSE(
+	AC_LANG_PROGRAM([#include <glob.h>],
+			[int foo = GLOB_NOMAGIC;]),
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([HAVE_GLOB_NOMAGIC], 1, [Define to 1 if your glob function supports GLOB_NOMAGIC option.]),
+	AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(for GLOB_BRACE)
+AC_LINK_IFELSE(
+	AC_LANG_PROGRAM([#include <glob.h>],
+			[int foo = GLOB_BRACE;]),
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([HAVE_GLOB_BRACE], 1, [Define to 1 if your glob function supports GLOB_BRACE option.]),
 	AC_MSG_RESULT(no)
 )
 

Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=189601&r1=189600&r2=189601
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Tue Apr 21 09:00:55 2009
@@ -146,6 +146,12 @@
 
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if your glob function supports GLOB_BRACE option. */
+#undef HAVE_GLOB_BRACE
+
+/* Define to 1 if your glob function supports GLOB_NOMAGIC option. */
+#undef HAVE_GLOB_NOMAGIC
 
 /* Define to indicate the ${GNUTLS_DESCRIP} library */
 #undef HAVE_GNUTLS

Modified: branches/1.4/include/asterisk/compat.h
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/include/asterisk/compat.h?view=diff&rev=189601&r1=189600&r2=189601
==============================================================================
--- branches/1.4/include/asterisk/compat.h (original)
+++ branches/1.4/include/asterisk/compat.h Tue Apr 21 09:00:55 2009
@@ -128,4 +128,15 @@
 typedef unsigned long long uint64_t;
 #endif
 
+/* glob compat stuff */ 
+#if defined(__Darwin__) || defined(__CYGWIN__)
+#define GLOB_ABORTED GLOB_ABEND
 #endif
+
+#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE)
+#define MY_GLOB_FLAGS   GLOB_NOCHECK
+#else
+#define MY_GLOB_FLAGS   (GLOB_NOMAGIC | GLOB_BRACE)
+#endif
+
+#endif

Modified: branches/1.4/main/config.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/main/config.c?view=diff&rev=189601&r1=189600&r2=189601
==============================================================================
--- branches/1.4/main/config.c (original)
+++ branches/1.4/main/config.c Tue Apr 21 09:00:55 2009
@@ -39,9 +39,6 @@
 #include <sys/stat.h>
 #define AST_INCLUDE_GLOB 1
 #ifdef AST_INCLUDE_GLOB
-#if defined(__Darwin__) || defined(__CYGWIN__)
-#define GLOB_ABORTED GLOB_ABEND
-#endif
 # include <glob.h>
 #endif
 
@@ -852,11 +849,7 @@
 		int glob_ret;
 		glob_t globbuf;
 		globbuf.gl_offs = 0;	/* initialize it to silence gcc */
-#ifdef SOLARIS
-		glob_ret = glob(fn, GLOB_NOCHECK, NULL, &globbuf);
-#else
-		glob_ret = glob(fn, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
-#endif
+		glob_ret = glob(fn, MY_GLOB_FLAGS, NULL, &globbuf);
 		if (glob_ret == GLOB_NOSPACE)
 			ast_log(LOG_WARNING,
 				"Glob Expansion of pattern '%s' failed: Not enough memory\n", fn);




More information about the svn-commits mailing list