I tried to compile the current version with a FreeBSD-6.1-amd64 machine, and ran into some problems. First of all, the easy one. libavcodec/grab_bktr line 28 has a statement: # if __FreeBSD__ >= 502100 This tests for the ioctl_meteor.h and ioctl_bt848.h location on newer FreeBSD revisions. However, __FreeBSD__ equals 6 in 6.1, which will cause the compilation to fail. Changing the line to # if __FreeBSD__ >= 502100 || __FreeBSD__ == 6 fixes the problem. Also, search from /usr/local/include and /usr/local/lib is not enabled by default, which will cause ALL configure probes to fail, but this is probably an user (mine) error, as people should probably have -I/usr/local/include and -L/usr/local/lib in their C- and LDFLAGS. You could also add a note in the FAQ about the link order. If an user is stupid enough to issue `pkg-config --libs avcodec` and `pkg-config --libs avformat` simultaneously, this will cause the linking to fail crypticly, as -lavutil is in the command line before -lavformat. It took me quite a while to figure out I only need to check for avformat. -- -Tatu Kilappa <trilkk at iki.fi>
On Sun, Oct 22, 2006 at 07:25:50PM +0300, Tatu Kilappa wrote:
First of all, the easy one. libavcodec/grab_bktr line 28 has a statement:
# if __FreeBSD__ >= 502100
This tests for the ioctl_meteor.h and ioctl_bt848.h location on newer FreeBSD revisions. However, __FreeBSD__ equals 6 in 6.1, which will cause the compilation to fail. Changing the line to
# if __FreeBSD__ >= 502100 || __FreeBSD__ == 6
fixes the problem.
This should be detected from configure instead. Diego
# if __FreeBSD__ >= 502100
This tests for the ioctl_meteor.h and ioctl_bt848.h location on newer FreeBSD revisions. However, __FreeBSD__ equals 6 in 6.1, which will cause the compilation to fail. Changing the line to
# if __FreeBSD__ >= 502100 || __FreeBSD__ == 6 Actually, this is GCC dependent I'm afraid, as __FreeBSD__ is in the default defines of the compiler. Most likely the GCC 3.4 shipped with base system and
On Sunday 22 October 2006 18:25, Tatu Kilappa wrote: the ones shipped with ports use different ways to define __FreeBSD__. Using it to desume the version is not correct anyway, instead one should use the __FreeBSD_version macro from <osreldate.h>: #define __FreeBSD_version 602100 this is from a 6.2-BETA2 insteall.
Also, search from /usr/local/include and /usr/local/lib is not enabled by default, which will cause ALL configure probes to fail, but this is probably an user (mine) error, as people should probably have -I/usr/local/include and -L/usr/local/lib in their C- and LDFLAGS. /usr/local/* is used only from ports, that is not the only way to install software on a FreeBSD system, most likely it should be local because it might be disruptive to force looking there on systems where /usr is used instead.
You could also add a note in the FAQ about the link order. If an user is stupid enough to issue `pkg-config --libs avcodec` and `pkg-config --libs avformat` simultaneously, this will cause the linking to fail crypticly, as -lavutil is in the command line before -lavformat. It took me quite a while to figure out I only need to check for avformat. Can you post the error? Because it seems pretty strange that this way it failed, as -lavutil should have been more than one time in the linking line.
I should probably check again the current SVN now that Luca committed the --as-needed thing and it should be fixed (especially considering I have to fix his snapshot in portage too :P). -- Diego "Flameeyes" Petten? - http://farragut.flameeyes.is-a-geek.org/ Gentoo/Alt lead, Gentoo/FreeBSD, Video, Sound, ALSA, PAM, KDE, CJK, Ruby ...
# if __FreeBSD__ >= 502100 || __FreeBSD__ == 6 Actually, this is GCC dependent I'm afraid, as __FreeBSD__ is in the default defines of the compiler. Most likely the GCC 3.4 shipped with base system... ...Using it to desume the version is not correct anyway, instead one should use the __FreeBSD_version macro from <osreldate.h>: #define __FreeBSD_version 602100 this is from a 6.2-BETA2 insteall.
So how should this be fixed? Shall I just check if the system is FreeBSD (for example by checking that __FreeBSD__ is defined at all), and if yes, then include <osreldate.h>, possibly with #undef to __FreeBSD__ beforehand? Personally, I'd just write Autotools -style cheks that produce output of the like #define HAVE_SYS_???_IOCTL_METEOR_H and we could forget the whole FreeBSD dependency stuff and focus on finding the headers, that's were the problem was anyway. Tell your preferred approach and I'll make a patch and submit wherever you like, this mailing list perhaps?
Also, search from /usr/local/include and /usr/local/lib is not enabled by default... /usr/local/* is used only from ports, that is not the only way to install software on a FreeBSD system...
Okay, user error. Disregard that.
You could also add a note in the FAQ about the link order. If an user is stupid enough to issue `pkg-config --libs avcodec`... Can you post the error? Because it seems pretty strange that this way it failed, as -lavutil should have been more than one time in the linking line.
Also my error. I have a SCons compiler script that does not duplicate linker flags (since --as-needed is not usually specified). Sorry for the trouble. Yet another thing about compiling. I have linux-ppc (current Debian testing, GCC 4.1.2) box where I also compiled the program, and ran into problems trying to enable XviD (latest SVN, refreshed today). The check fails with ERROR: XviD not found. I read the logs and it appeared the problem was that it did not find math library with the compiler string it was using. I edited configure line 1310: enabled xvid && require XviD xvid.h xvid_global -lxvidcore Changing the line to: enabled xvid && require XviD xvid.h xvid_global -lxvidcore -lm Solved the problem. -- -Tatu Kilappa <trilkk at iki.fi>
On Sun, Oct 29, 2006 at 01:10:21AM +0300, Tatu Kilappa wrote:
# if __FreeBSD__ >= 502100 || __FreeBSD__ == 6 Actually, this is GCC dependent I'm afraid, as __FreeBSD__ is in the default defines of the compiler. Most likely the GCC 3.4 shipped with base system... ...Using it to desume the version is not correct anyway, instead one should use the __FreeBSD_version macro from <osreldate.h>: #define __FreeBSD_version 602100 this is from a 6.2-BETA2 insteall.
So how should this be fixed? Shall I just check if the system is FreeBSD (for example by checking that __FreeBSD__ is defined at all), and if yes, then include <osreldate.h>, possibly with #undef to __FreeBSD__ beforehand?
Personally, I'd just write Autotools -style cheks that produce output of the like #define HAVE_SYS_???_IOCTL_METEOR_H and we could forget the whole FreeBSD dependency stuff and focus on finding the headers, that's were the problem was anyway.
Tell your preferred approach and I'll make a patch and submit wherever you like, this mailing list perhaps?
Check for the functionality, not for the system. Diego
Personally, I'd just write Autotools -style cheks that produce... ...Tell your preferred approach and I'll make a patch and submit wherever you like, this mailing list perhaps? Check for the functionality, not for the system.
Ok. Done. This patch works at least on FreeBSD 6.1-RELEASE with amd64 and current Debian/GNU Linux testing with ppc32, but you might want to check other systems before adding it anywhere. The patch is checked against current svn that was fetched one hour ago. -- -Tatu Kilappa <trilkk at iki.fi>
On Sun, Oct 29, 2006 at 08:45:46PM +0200, Tatu Kilappa wrote:
Personally, I'd just write Autotools -style cheks that produce... ...Tell your preferred approach and I'll make a patch and submit wherever you like, this mailing list perhaps? Check for the functionality, not for the system.
Ok. Done.
This patch works at least on FreeBSD 6.1-RELEASE with amd64 and current Debian/GNU Linux testing with ppc32, but you might want to check other systems before adding it anywhere.
The patch is checked against current svn that was fetched one hour ago.
Committed something inspired by your patch. It's much shorter but should work just as well. Let me know if it does not work on your system. TODO Mans: Extend check_header to support multiple header files. Diego
Committed something inspired by your patch. It's much shorter but should work just as well. Let me know if it does not work on your system.
Updated, checked, and it works just fine. Thanks. Concerning FreeBSD-amd64, there is some other problems with --enable-shared and even more stuff concerning assembler. If I'll get onto them, (assuming they're not user stupidity), I'll make a new thread. -- -Tatu Kilappa <trilkk at iki.fi>
participants (3)
-
diego@biurrun.de -
flameeyes@gentoo.org -
trilkk@iki.fi