I'm still stuck trying to compile the Zaptel driver to install
Asterisk on FreeBSD 6.2:
=============
# cd
# cvsup -g -L 2 standard-supfile
# cvsup -g -L 2 ports-supfile
# cd /usr/ports/misc/zaptel/
# make
===> Building for zaptel-1.4.6_2
make -C zaptel all
Warning: Object directory not changed from original
/usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6/zaptel
cc -O2 -fno-strict-aliasing -pipe -Wall -D_KERNEL -DKLD_MODULE
-std=c99 -nostdinc -I. -I@ -I@/contrib/altq -finline-limit=8000
--param inline-unit-growth=100 --param large-function-growth=1000
-fno-common -mno-align-long-strings -mpreferred-stack-boundary=2
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
-Wno-pointer-sign -fformat-extensions -c zaptel.c
cc1: error: unrecognized command line option "-Wno-pointer-sign"
*** Error code 1
Stop in /usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6/zaptel.
*** Error code 1
Stop in /usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6.
*** Error code 1
Stop in /usr/ports/misc/zaptel.
=============
Any idea where I could look for a possible explanation?
Thank for any tip.
I wonder if maybe the people who ported Asterisk to FreeBSD aren't
using a more recent version of GCC than what's available in the 6.2
ports:
======
# cc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.6 [FreeBSD] 20060305
======
Since GCC was not upgraded by running cvsup, what would be a valid way
to upgrade it myself? By downloading a package for a more recent
version of FBSD?
Thank you.
Remember that this only updates your system source. It doesn't install
the new system. zaptel appears to be a kernel module--the Makefile says
it needs to be in sync with the system source. So you should rebuild
your system before building zaptel:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
Incidentally, the -g -L 2 stuff is unnecessary, and if you have csup it
replaces cvsup.
> # cvsup -g -L 2 ports-supfile
>
> # cd /usr/ports/misc/zaptel/
> # make
>===> Building for zaptel-1.4.6_2
> make -C zaptel all
> Warning: Object directory not changed from original
> /usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6/zaptel
> cc -O2 -fno-strict-aliasing -pipe -Wall -D_KERNEL -DKLD_MODULE
> -std=c99 -nostdinc -I. -I@ -I@/contrib/altq -finline-limit=8000
> --param inline-unit-growth=100 --param large-function-growth=1000
> -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2
> -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Wall
> -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
> -Wno-pointer-sign -fformat-extensions -c zaptel.c
> cc1: error: unrecognized command line option "-Wno-pointer-sign"
> *** Error code 1
>
> Stop in /usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6/zaptel.
> *** Error code 1
>
> Stop in /usr/ports/misc/zaptel/work/zaptel-bsd-1.4.6.
> *** Error code 1
>
> Stop in /usr/ports/misc/zaptel.
>=============
--
Warren Block * Rapid City, South Dakota * USA
Well, gcc4.2 and 4.3 are in ports. But the 4.2 binary is called gcc42,
so it's unlikely they'd get mixed up. If zaptel really needs a later
gcc, it would be a bug in the port to not have it depend on that.
> Since GCC was not upgraded by running cvsup,
Well, no. cvsup just updated the source files. You'll have to build
the system to get the new binaries. Try that first. If that doesn't
work, I'd either submit a PR or contact the port maintainer.
> what would be a valid way to upgrade it myself? By downloading a
> package for a more recent version of FBSD?
Installing from the lang/gcc ports would be the right way. But don't do
that yet, because gcc is a huge port to build and that's probably not
the problem.
Thanks a lot for the tip.
However, I ran "# cd /usr/src ; make buildworld" over two hours ago,
and the screen hasn't displayed anything at all. Is it stuck or doing
number-crunching on this old AMD Duron?
Notice that the state of the four "make" is set to "wait":
===========
# top
last pid: 1252; load averages: 0.07, 0.02, 0.00 up 0+03:00:27
19:15:48
28 processes: 1 running, 27 sleeping
Mem: 7780K Active, 10M Inact, 16M Wired, 10M Buf, 461M Free
Swap: 999M Total, 999M Free
PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU
COMMAND
761 root 1 96 0 6252K 3344K select 0:00 0.00% sshd
906 root 1 8 0 3200K 2088K wait 0:00 0.00% bash
697 root 1 8 0 1388K 1100K nanslp 0:00 0.00% cron
555 root 1 96 0 1376K 1028K select 0:00 0.00%
syslogd
766 root 1 8 0 3200K 2088K wait 0:00 0.00% bash
777 root 1 8 0 652K 540K wait 0:00 0.00% make
633 root 1 96 0 1288K 824K select 0:00 0.00% usbd
863 root 1 5 0 3104K 1896K ttyin 0:00 0.00% bash
862 root 1 8 0 628K 516K wait 0:00 0.00% make
860 root 1 8 0 628K 516K wait 0:00 0.00% make
771 root 1 8 0 556K 444K wait 0:00 0.00% make
740 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
745 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
744 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
751 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
742 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
743 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
741 root 1 5 0 1344K 952K ttyin 0:00 0.00% getty
===========
Pfff, found what it was: Like most Linux users, I'm used to Bash, so
had the following in ~/.chsrc:
[ -x /usr/local/bin/bash ] && exec /usr/local/bin/bash
Apparently, "make buildworld" won't work with Bash. The solution is to
comment the line out, log off-on, and retry.
HTH,
IIRC, you could also just have started sh bfore doing the make buildworld.
--
Torfinn Ingolfsen,
Norway
Or created an /etc/make.conf containing:
MAKE_SHELL=sh
--
Bob Eager
UNIX since v6..
http://tinyurl.com/2xqr6h
Thanks for the tip, but I first had to figure out 1) that something
was wrong (number crunching over the network doesn't trigger HD
activity, so I thought things were OK), and 2) that if buildworld was
indeed stuck, it was because of the shell :-/ Learned something new
today.
BTW, "make buildworld" has been running for four hours now: Do I
really need this to solve the Zaptel issue above? If yes, on that ol'
AMD Duron, how long can I expect this to last, including the other
steps?
# make buildworld
# make buildkernel
# make installkernel
# reboot
www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
Thanks.
> BTW, "make buildworld" has been running for four hours now: Do I
> really need this to solve the Zaptel issue above?
It may not be the particular problem you're having, but according to the
zaptel Makefile, it can be a problem.
> If yes, on that ol' AMD Duron, how long can I expect this to last,
> including the other steps?
buildworld takes quite a while on slow systems. buildkernel takes a
while, but not quite as much. Fortunately, it doesn't have to be done
all that often. How long depends on the CPU, cache, and disk, but
multiple hours is not unusual. It can help to remove /usr/obj first.
> # make buildworld
> # make buildkernel
> # make installkernel
> # reboot
And then
# make installworld
# mergemaster
# reboot
Thanks. Unfortunately, things are not looking good :-/
Following "23.4.1 The Canonical Way to Update Your System", I did
this:
# make buildworld
# make buildkernel
# make installkernel
kldxref: file isn't dynamically-linked
kldxref: file isn't dynamically-linked
kldxref: file isn't dynamically-linked
Google says: "This hs nothing to do with DEFAULT. Instead it is a
-current only wanring based on work that Ru@ did to install the
symbols for the modules and kernel. It really is a harmless warning."
Ok then...
# reboot
=>Here, the computer is stuck at "hpttr: no controller detected."
Maybe I should just reinstall 6.2, and compile Asterisk from source
instead of ports?
> Apparently, "make buildworld" won't work with Bash. The solution is to
> comment the line out, log off-on, and retry.
I make buildworld under bash all the time.
The difference here is that he's effectively replaced tcsh with bash
through his if-there-is-bash-then-exec-bash trick. The right way to
change your login shell is by using chsh. That way scripts that expect
to get t/csh when they ask for it won't get bash after all.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
OK, so it's either:
- /etc/make.conf -> "MAKE_SHELL=sh"
- run "chsh". Can I avoid having to type this manually, and have some
script run the command when I log on?
Sorry, no idea about that. Maybe it'll timeout and go on eventually.
> Maybe I should just reinstall 6.2, and compile Asterisk from source
> instead of ports?
Or reinstall 6.2 including source but don't update the source. The
Asterisk install from ports should be okay with that. Looking at the
Asterisk Makefile shows that you can build it without Zaptel, too.
You run it manually. Once. It updates the user database. Login again and
you're done. Try it, you'll be amazed.
Nope, I left it there for 10mn, it's stuck. I didn't get this error
before.
>Or reinstall 6.2 including source but don't update the source. The
>Asterisk install from ports should be okay with that. Looking at the
>Asterisk Makefile shows that you can build it without Zaptel, too.
But I need Zaptel because I have a PCI card :-/
In your opinion, what could be the cause of the pb? That the persons
in charge of the Asterisk/Zaptel ports don't actually use 6.2, and
assume some dependencies that are actually available in more recent
version of FreeBSD?
Thanks.
Not likely. Port Makefiles will usually have conditions for different
major versions of the OS.
Just for fun, I just now built and installed Asterisk. I turned off
every option except Zaptel. There weren't any errors. Here's my uname
-a:
FreeBSD speedy.wonkity.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Tue Jan 1 14:16:24 MST 2008
ro...@speedy.wonkity.com:/usr/obj/usr/src/sys/SPEEDY i386
Mmm... I installed 6.2, since it's the current RELEASE version, and
I'm just too newbie to take the risk of using anything else.
So, at this point, I reinstalled 6.2 from the Net. What do you think I
should do? Should I update the host with newer stuff, and if yes, how?
Following the instructions in Chap 23 again, at the risk of getting
the error once more?
Mine is just 6-STABLE, but on your machine it'll take a while to build.
6.2-RELEASE should be fine.
> So, at this point, I reinstalled 6.2 from the Net. What do you think I
> should do? Should I update the host with newer stuff, and if yes, how?
Install source from the 6.2 CD, if you didn't already. Don't update it.
In fact, don't change anything you don't have to, like bash instead of
csh. (csh/tcsh with a decent .cshrc is very tolerable.)
pkg_add -r cvsup-without-gui (I don't think 6.2-RELEASE had csup, or you
could use it).
Update ports. Use the /usr/share/examples/ports-supfile.
Don't mess with /etc/make.conf or other stuff.
Then install Asterisk from ports, turning off everything you don't need.
> Gilles Ganault <nos...@nospam.com> wrote:
> > On Sun, 13 Jan 2008 19:19:24 -0000, Warren Block <wbl...@wonkity.com>
> > wrote:
> >>Just for fun, I just now built and installed Asterisk. I turned off
> >>every option except Zaptel. There weren't any errors. Here's my uname
> >>-a:
> >>
> >>FreeBSD speedy.wonkity.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Tue Jan 1 14:16:24 MST 2008
> >>ro...@speedy.wonkity.com:/usr/obj/usr/src/sys/SPEEDY i386
> >
> > Mmm... I installed 6.2, since it's the current RELEASE version, and
> > I'm just too newbie to take the risk of using anything else.
>
> Mine is just 6-STABLE, but on your machine it'll take a while to build.
> 6.2-RELEASE should be fine.
>
> > So, at this point, I reinstalled 6.2 from the Net. What do you think I
> > should do? Should I update the host with newer stuff, and if yes, how?
>
> Install source from the 6.2 CD, if you didn't already. Don't update it.
> In fact, don't change anything you don't have to, like bash instead of
> csh. (csh/tcsh with a decent .cshrc is very tolerable.)
>
> pkg_add -r cvsup-without-gui (I don't think 6.2-RELEASE had csup, or you
> could use it).
No need - 6.2-RELEASE has csup.
I installed 6.2 from the 10MB boot ISO, "Minimal install" so the Ports
aren't there.
What does "install source" mean? Is it running "csup
standard-supfile"?
I know, newbie stuff :-)
I've found that pretty much every time I get a mini-ISO, I end up
downloading a full one later. So I don't bother with the minis any
more.
> What does "install source" mean? Is it running "csup
> standard-supfile"?
No, well at least not as-is. You could use the stable-supfile and
change the tag, but let's not do that.
You can do it with sysinstall:
sysinstall
Configure
Distributions
Mark "src".
Okay/Exit/Install/whatever it asks. It should download the source tree
(/usr/src) from the net. You may have to tell it to use FTP and which
server.
> I know, newbie stuff :-)
Everybody starts that way, and thanks to CRS syndrome, some of us pretty
much remain there. 8-)
OK. So /usr/src is the source code of FreeBSD proper, while
/usr/ports/ is the source code of the thousands of applications that's
been ported to FBSD, ready to be compiled (as opposed to installing
binary packages with pkg_add)?
Actually, while waiting for a reply, I ran the following commands to
install Lighttpd + PHP + MySQL:
# portsnap fetch
# portsnap extract
# portsnap update
Hopefully, it's the same as running SysInstall > Configure
Distributions Mark "src" > OK.
>Everybody starts that way, and thanks to CRS syndrome, some of us pretty
>much remain there. 8-)
http://www.google.com/search?q=crs+syndrome
:-)
Exactly.
> while /usr/ports/ is the source code of the thousands of applications
> that's been ported to FBSD,
Almost. The ports tree doesn't have the actual source, but a Makefile
and a few other things like patches. Think of it as a "how to build
from this application from source on FreeBSD" set of instructions. When
you do a make in a port dir, then it goes out to the net and retrieves
the application source.
> ready to be compiled (as opposed to installing binary packages with
> pkg_add)?
Yes.
> Actually, while waiting for a reply, I ran the following commands to
> install Lighttpd + PHP + MySQL:
>
> # portsnap fetch
> # portsnap extract
> # portsnap update
>
> Hopefully, it's the same as running SysInstall > Configure
> Distributions Mark "src" > OK.
Nope--you updated the ports, which is fine. portsnap is the new
alternate way to do that instead of with csup. But still no system
source.
Okay, the other way is to use csup. I haven't tested that tag, but I
think it's right.
(log in as root)
cp /usr/share/examples/cvsup/stable-supfile /root/6.2.0-supfile
Change the default host and tag lines:
*default host=cvsup.fr.FreeBSD.org
*default release=cvs tag=RELENG_6_2_0_RELEASE
And then get it. This will take a while:
csup 6.2.0-supfile
> OK. So /usr/src is the source code of FreeBSD proper,
Yes.
> while
> /usr/ports/ is the source code of the thousands of applications that's
> been ported to FBSD, ready to be compiled (as opposed to installing
> binary packages with pkg_add)?
Not quite. It's a set of skeleton directories, makefiles and patches.
The actual source code is downloaded (often from the maintainer's site)
when you 'make' the port. If it were the entire source code, it'd be
many times its (already quite large) size.
Thanks a lot. I could compile Zaptel and Asterisk :-)
I just had the following errors at the end of compiling Asterisk:
==========
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ gmake samples +
+ +
[...]
# gmake samples
Makefile:54: *** missing separator. Stop.
# make samples
make: don't know how to make samples. Stop
==========
Am I missing something?
Makes sense. Thank you.
Yes--that's a message from Asterisk. It doesn't know it's being built
as a port. gmake will try the nearest Makefile--the port's Makefile,
not the Asterisk Makefile the message is expecting.
However, you should look in /usr/local/etc/asterisk first. There are
lots of sample files (-dist) in there already, and they should have been
adjusted by the port so they're more likely to be correct for FreeBSD.
OK. There were indeed some sample files already. I guess they were
installed before by "make install", although under Linux, this doesn't
install samples.
Generally speaking, is this kind of error an oversight by the person
who ported a software to FBSD's Ports collection?
Originally, I meant to note the difference between gmake and FreeBSD's
make, too. The ports Makefiles are for BSD make, and gmake will
probably choke on them.
> OK. There were indeed some sample files already. I guess they were
> installed before by "make install", although under Linux, this doesn't
> install samples.
>
> Generally speaking, is this kind of error an oversight by the person
> who ported a software to FBSD's Ports collection?
It's standard practice for sample config files to be installed. The
port probably ought to be modified so the message tells the user where
the example files are.
Whether what's in /usr/local/etc/asterisk are all the examples, or the
user really does need to use gmake in the port workdir, I don't know.
Once you've got a handle on that, I encourage you to check with the port
maintainer (make maintainer), man send-pr, or the more accessible web
version:
http://www.freebsd.org/support/bugreports.html
(It's like investing. It may not pay off for a while (or ever), but
you'll be glad when it does.)
I hope you'll post about how well Asterisk works for you, and where you
got the hardware and what it cost.
Will do. I keep notes of things I try.
>I hope you'll post about how well Asterisk works for you, and where you
>got the hardware and what it cost.
At this point, it's working OK. Zaptel can configure the PCI card to
which I connect an analog phone line, and Asterisk reacts to an
incoming phone call.
I've also installed Apache + PHP + MySQL since incoming calls will
need to launch a PHP script that will look for information in a SQLite
database. I'm also looking at some poor man's CRM so that our little
team can keep track of calls, who handled them, etc.
The hardware is minimal, since it's a Pentium 233MHz with 256MB I got
off eBay for 20E, but I only need to handle one phone line anyway, and
a couple of remote SIP or IAX phones.
Anyway, I wanted to thank you guys for the great help I got. I could
never have gone that far with FreeBSD without your help!
Which PCI card? How much did it cost?
> Anyway, I wanted to thank you guys for the great help I got. I could
> never have gone that far with FreeBSD without your help!
You're welcome. Help out somebody else if you get the chance!
A clone of the Digium TDM card built by OpenVox. About $85.
http://www.openvox.com.cn/products.php?genre_id=9
>You're welcome. Help out somebody else if you get the chance!
I do, when I can :-)