]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Resolve a number of FreeBSD build issues.
authorRussell Bryant <russell@russellbryant.com>
Sat, 20 Mar 2010 19:17:28 +0000 (19:17 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 20 Mar 2010 19:17:28 +0000 (19:17 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@253631 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
apps/app_dial.c
apps/app_followme.c
channels/chan_dahdi.c
main/http.c
main/manager.c
main/sched.c
main/utils.c
pbx/pbx_dundi.c
res/res_features.c

index 41d3017fbf3963f97057e9a04bbfc2329d6fcd95..778879d31c7f5e0c0c9e9c6356c24b8304c93c64 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -358,10 +358,10 @@ $(SUBDIRS): include/asterisk/version.h include/asterisk/buildopts.h defaults.h m
 main: $(filter-out main,$(MOD_SUBDIRS))
 
 $(MOD_SUBDIRS):
-       +@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" $(MAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+       +@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
 
 $(OTHER_SUBDIRS):
-       +@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" $(MAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+       +@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
 
 defaults.h: makeopts
        @build_tools/make_defaults_h > $@.tmp
index 963b0c9ce206482120603c2eff6ae05b2d11d8b5..b8ce0fabed233926ec7f824ba67a8786dfcaf72d 100644 (file)
@@ -870,12 +870,12 @@ static void end_bridge_callback (void *data)
 
        ast_channel_lock(chan);
        if (chan->cdr->answer.tv_sec) {
-               snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec);
+               snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec);
                pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
        }
 
        if (chan->cdr->start.tv_sec) {
-               snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec);
+               snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec);
                pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
        }
        ast_channel_unlock(chan);
index 6b228f416201f3034f9231308d36d4b9ce8f7924..4b93b3b105234ac0a191385b6ec0bd44fdbe8378 100644 (file)
@@ -928,12 +928,12 @@ static void end_bridge_callback (void *data)
 
        ast_channel_lock(chan);
        if (chan->cdr->answer.tv_sec) {
-               snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec);
+               snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec);
                pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
        }
 
        if (chan->cdr->start.tv_sec) {
-               snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec);
+               snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec);
                pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
        }
        ast_channel_unlock(chan);
index 63ac20a106915b04b80586504c11554574bf9856..d21ec017f46250700024fe08432eef2062b7367f 100644 (file)
@@ -51,7 +51,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include <stdio.h>
 #include <string.h>
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 #include <pthread.h>
 #include <signal.h>
 #else
index cee1d913cf68a1ae718b9c1c6cf37e31ec44ea6d..f8d9f1e526d6f947458c65b2d9a3faabe2628274 100644 (file)
@@ -47,6 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <errno.h>
 #include <fcntl.h>
 #include <pthread.h>
+#include <signal.h>
 
 #include "asterisk/cli.h"
 #include "asterisk/http.h"
index 173964b19e4910cd2be067df6ed0f69556d95eb6..f3d040f1b4c76ad71b263d5fc2c313e18bdf48f2 100644 (file)
@@ -2589,7 +2589,7 @@ int manager_event(int category, const char *event, const char *fmt, ...)
                now = ast_tvnow();
                ast_dynamic_str_thread_append(&buf, 0, &manager_event_buf,
                                "Timestamp: %ld.%06lu\r\n",
-                                now.tv_sec, (unsigned long) now.tv_usec);
+                                (long) now.tv_sec, (unsigned long) now.tv_usec);
        }
 
        va_start(ap, fmt);
index cb609863562b41366b63c13b701ad2edf197e2a1..8a916cde02a6b5cd15a43dd405bf9258d8b4022d 100644 (file)
@@ -316,7 +316,7 @@ void ast_sched_dump(const struct sched_context *con)
                        q->id,
                        q->callback,
                        q->data,
-                       delta.tv_sec,
+                       (long) delta.tv_sec,
                        (long int)delta.tv_usec);
        }
        ast_log(LOG_DEBUG, "=============================================================\n");
index 3fc9faf8fb2f925e4cfa56522acc3982e81581c8..a9b887205c2312c05767fb9e8f3b082e86e31dda 100644 (file)
@@ -1099,12 +1099,12 @@ static struct timeval tvfix(struct timeval a)
 {
        if (a.tv_usec >= ONE_MILLION) {
                ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
-                       a.tv_sec, (long int) a.tv_usec);
+                       (long) a.tv_sec, (long int) a.tv_usec);
                a.tv_sec += a.tv_usec / ONE_MILLION;
                a.tv_usec %= ONE_MILLION;
        } else if (a.tv_usec < 0) {
                ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
-                       a.tv_sec, (long int) a.tv_usec);
+                       (long) a.tv_sec, (long int) a.tv_usec);
                a.tv_usec = 0;
        }
        return a;
index 412e24e9a497094d50f767e71d2d7796daa85268..4b7e25636b0fcd134d16aaeaa8158201617cc1b5 100644 (file)
@@ -38,6 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <string.h>
 #include <errno.h>
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(SOLARIS) || defined(__Darwin__)
+#include <signal.h>
 #include <sys/types.h>
 #include <netinet/in_systm.h>
 #endif
index fa938087acb44e14f7ac85ceb81272020b44abdc..7bfd5b24681349054f629b98d333023d4e557689 100644 (file)
@@ -33,6 +33,7 @@
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include <pthread.h>
+#include <signal.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
@@ -2726,7 +2727,7 @@ static int handle_parkedcalls(int fd, int argc, char *argv[])
        for (cur = parkinglot; cur; cur = cur->next) {
                ast_cli(fd, "%-10.10s %25s (%-15s %-12s %-4d) %6lds\n"
                        ,cur->parkingexten, cur->chan->name, cur->context, cur->exten
-                       ,cur->priority, cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL));
+                       ,cur->priority, (long) cur->start.tv_sec + (cur->parkingtime/1000) - time(NULL));
 
                numparked++;
        }