Index: tools/zapscan.c =================================================================== --- tools/zapscan.c (revision 140) +++ tools/zapscan.c (working copy) @@ -29,7 +29,12 @@ #include #include #include + +#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) +#include +#else #include +#endif int main(int argc, char *argv[]) { Index: tools/Makefile =================================================================== --- tools/Makefile (revision 140) +++ tools/Makefile (working copy) @@ -10,16 +10,26 @@ # This program is free software, distributed under the terms of # the GNU General Public License # + +OSARCH=FreeBSD +prefix=/usr/local + all: zapscan.bin +ifeq ($(OSARCH),FreeBSD) + ASTFLAGS=-I/usr/local/include +endif zapscan.bin: zapscan.o $(CC) -o zapscan.bin zapscan.o +zapscan.o: + $(CC) $(ASTFLAGS) -c -o zapscan.o zapscan.c + install: - mkdir -p $(DESTDIR)/sbin - $(INSTALL) -m 755 zapscan $(DESTDIR)/sbin - $(INSTALL) -m 755 zapscan.bin $(DESTDIR)/sbin + mkdir -p $(DESTDIR)${prefix}/sbin + $(INSTALL) -m 755 zapscan $(DESTDIR)${prefix}/sbin + $(INSTALL) -m 755 zapscan.bin $(DESTDIR)${prefix}/sbin clean: rm -f zapscan.o Index: Makefile =================================================================== --- Makefile (revision 140) +++ Makefile (working copy) @@ -22,6 +22,9 @@ # Overwite config files on "make samples" OVERWRITE=y +# Prefix to asterisk etc directory +prefix=/usr/local + # Staging directory # Files are copied here temporarily during the install process # For example, make DESTDIR=/tmp/asterisk-gui would put things in @@ -31,26 +34,22 @@ # # Asterisk var/lib directory... # -ASTVARLIB?=$(shell cat $(DESTDIR)/etc/asterisk/asterisk.conf 2>/dev/null | grep -v ^\; | grep astvarlibdir | cut -f 3 -d ' ') +ASTVARLIB?=$(shell cat ${prefix}/etc/asterisk/asterisk.conf 2>/dev/null | grep -v ^\; | grep astvarlibdir | cut -f 3 -d ' ') ifeq ($(ASTVARLIB),) ASTVARLIB=/var/lib/asterisk endif -ASTETCDIR?=$(shell cat $(DESTDIR)/etc/asterisk/asterisk.conf 2>/dev/null | grep -v ^\; | grep astetcdir | cut -f 3 -d ' ') -ifeq ($(ASTETCDIR),) - ASTETCDIR=/etc/asterisk -endif HTTPDIR=$(DESTDIR)$(ASTVARLIB)/static-http CONFIGDIR=$(HTTPDIR)/config -ASTETCDIR?=$(shell cat $(DESTDIR)/etc/asterisk/asterisk.conf 2>/dev/null | grep -v ^\; | grep astetcdir | cut -f 3 -d ' ') +ASTETCDIR?=$(shell cat ${prefix}/etc/asterisk/asterisk.conf 2>/dev/null | grep -v ^\; | grep astetcdir | cut -f 3 -d ' ') ifeq ($(ASTETCDIR),) ASTETCDIR=/etc/asterisk endif HTTPHOST?=$(shell hostname) -HTTPBINDPORT?=$(shell cat $(DESTDIR)/etc/asterisk/http.conf 2>/dev/null | grep -v ^\; | grep bindport | cut -f 2 -d '=') +HTTPBINDPORT?=$(shell cat ${prefix}/etc/asterisk/http.conf 2>/dev/null | grep -v ^\; | grep bindport | cut -f 2 -d '=') ifeq ($(HTTPBINDPORT),) HTTPBINDPORT=8088 endif -HTTPPREFIXBASE?=$(shell cat $(DESTDIR)/etc/asterisk/http.conf 2>/dev/null | grep -v ^\; | grep prefix ) +HTTPPREFIXBASE?=$(shell cat ${prefix}/etc/asterisk/http.conf 2>/dev/null | grep -v ^\; | grep prefix ) HTTPPREFIX?=$(shell echo $(HTTPPREFIXBASE) | cut -f 2 -d '=') ifeq ($(HTTPPREFIXBASE),) HTTPPREFIX=asterisk @@ -66,7 +65,7 @@ @echo " + Asterisk-GUI has successfully been built, +" @echo " + and can be installed by running: +" @echo " + +" - @echo " + make install +" + @echo " + $(MAKE) install +" @echo " +-------------------------------------------+" _all: @@ -81,7 +80,7 @@ echo "OK" ; \ else \ echo "FAILED"; \ - echo " -- Please run 'make samples' in *Asterisk* or " ; \ + echo " -- Please run '$(MAKE) samples' in *Asterisk* or " ; \ echo " -- create your own $(ASTETCDIR)/http.conf" ; \ exit 1; \ fi @@ -90,7 +89,7 @@ echo "OK" ; \ else \ echo "FAILED"; \ - echo " -- Please run 'make samples' in *Asterisk* or " ; \ + echo " -- Please run '$(MAKE) samples' in *Asterisk* or " ; \ echo " -- create your own $(ASTETCDIR)/manager.conf" ; \ exit 1; \ fi