[PATCH] Fix compilation on OpenBSD
Hello, the following patches fix complation of mplayer svn head on openbsd-4.2. 1) socklen_t data type is defined in sys/types.h in OpenBSD, thus compilation fails with the following: ======= stream/network.h:29: error: conflicting types for `socklen_t' /usr/include/sys/types.h:161: error: previous declaration of `socklen_t' ======= socklen_t.patch fixes this. 2) Include directories reported by pkg-config for theora are not included in $_inc_extra, thus if theora is not installed in standard location, compilation fails due to unknown header file "theora/theora.h". In case on OpenBSD theora's headers are usually installed in the /usr/local/include. theora_local.patch is the fix for this. 3) The third problem is the ffmpeg's problem, I will post to ffmpeg-devel, but I want to put this patch here for convenience for those, who want to check/use these patches on OpenBSD. There is no #define INFINITY in OpenBSD, but HUGE_VAL is. So nellymouserenc.patch fixes this. -- Best regards, Andrew
On Mon, Nov 17, 2008 at 11:25:53PM +0300, Andrew Savchenko wrote:
the following patches fix complation of mplayer svn head on openbsd-4.2.
1) socklen_t data type is defined in sys/types.h in OpenBSD, thus compilation fails with the following: ======= stream/network.h:29: error: conflicting types for `socklen_t' /usr/include/sys/types.h:161: error: previous declaration of `socklen_t' ======= socklen_t.patch fixes this.
Patch is fine, commit anytime. But I do wonder why this does not cause you problems with FFmpeg. Have you just tested FFmpeg within MPlayer?
2) Include directories reported by pkg-config for theora are not included in $_inc_extra, thus if theora is not installed in standard location, compilation fails due to unknown header file "theora/theora.h". In case on OpenBSD theora's headers are usually installed in the /usr/local/include. theora_local.patch is the fix for this.
Hmmm, /usr/local/include should always be in the search path...
--- configure (revision 27949) +++ configure (working copy) @@ -6055,6 +6055,7 @@ EOF for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \ + && _inc_extra="$_inc_extra `$_pkg_config --silence-errors --cflags theora`" \ && _theora=yes && break done
Hmm, that will subtly break if the pkg-config call fails, but Theora is installed. Diego
Hi, On Tuesday 18 November 2008 00:45, Diego Biurrun wrote: [...]
1) socklen_t data type is defined in sys/types.h in OpenBSD, thus compilation fails with the following: ======= stream/network.h:29: error: conflicting types for `socklen_t' /usr/include/sys/types.h:161: error: previous declaration of `socklen_t' ======= socklen_t.patch fixes this.
Patch is fine, commit anytime.
Applied.
But I do wonder why this does not cause you problems with FFmpeg. Have you just tested FFmpeg within MPlayer?
As I mentioned on ffmpeg-devel, I just can't compile FFmpeg at all due to failed gmake... (I'll try with locally installed gmake-3.81 later). Our do you mean building FFmpeg inside MPlayer using experimental patch you proposed earlier?
2) Include directories reported by pkg-config for theora are not included in $_inc_extra, thus if theora is not installed in standard location, compilation fails due to unknown header file "theora/theora.h". In case on OpenBSD theora's headers are usually installed in the /usr/local/include. theora_local.patch is the fix for this.
Hmmm, /usr/local/include should always be in the search path...
Maybe, I dunno, I suppose some feature of OpenBSD. By the way I can't find standard include search path specifications in gcc manual... And gcc -print-search-dirs says nothing about them. Nevertheless instead of /usr/local/include it may be (in theory) /some/very/tricky/patch/to/the/library/header here.
--- configure (revision 27949) +++ configure (working copy) @@ -6055,6 +6055,7 @@ EOF for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \ + && _inc_extra="$_inc_extra `$_pkg_config --silence-errors --cflags theora`" \ && _theora=yes && break done
Hmm, that will subtly break if the pkg-config call fails, but Theora is installed.
Agreed. I missed that. What about the following patch? Should we add similar changes for all pkg-config detected libraries where this kind of behaviour may be required? -- Best regards, Andrew
On Tuesday 18 November 2008 12:58, Andrew Savchenko wrote: [...]
Hmmm, /usr/local/include should always be in the search path...
Maybe, I dunno, I suppose some feature of OpenBSD. By the way I can't find standard include search path specifications in gcc manual... And gcc -print-search-dirs says nothing about them.
Nevertheless instead of /usr/local/include it may be (in theory) /some/very/tricky/patch/to/the/library/header here.
--- configure (revision 27949) +++ configure (working copy) @@ -6055,6 +6055,7 @@ EOF for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \ + && _inc_extra="$_inc_extra `$_pkg_config --silence-errors --cflags theora`" \ && _theora=yes && break done
Hmm, that will subtly break if the pkg-config call fails, but Theora is installed.
Agreed. I missed that. What about the following patch? Should we add similar changes for all pkg-config detected libraries where this kind of behaviour may be required?
ping -- Best regards, Andrew
On Tue, Nov 18, 2008 at 12:58:00PM +0300, Andrew Savchenko wrote:
On Tuesday 18 November 2008 00:45, Diego Biurrun wrote:
--- configure (revision 27949) +++ configure (working copy) @@ -6055,6 +6055,7 @@ EOF for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \ + && _inc_extra="$_inc_extra `$_pkg_config --silence-errors --cflags theora`" \ && _theora=yes && break done
Hmm, that will subtly break if the pkg-config call fails, but Theora is installed.
Agreed. I missed that. What about the following patch? Should we add similar changes for all pkg-config detected libraries where this kind of behaviour may be required?
--- configure (revision 27953) +++ configure (working copy) @@ -6053,8 +6053,10 @@ + test $_pkg_config == "false" || _inc_theora="`$_pkg_config --silence-errors --cflags theora`"
Using == in 'test' invocations is a bashism. Also, the value of _pkg_config is the *program* false, so that all invocations of pkg-config via $_pkg_config will simply fail cleanly. So you can simply execute the command and react according to the return value. Diego
Hi, On Friday 28 November 2008 12:41, Diego Biurrun wrote: [...]
+ test $_pkg_config == "false" || _inc_theora="`$_pkg_config --silence-errors --cflags theora`"
Using == in 'test' invocations is a bashism.
Also, the value of _pkg_config is the *program* false, so that all invocations of pkg-config via $_pkg_config will simply fail cleanly. So you can simply execute the command and react according to the return value.
Return value check is the same as previos solution in terms of complexity, but if in your opinion check of return value is more elegant solution, so it should be. -- Best regards, Andrew
On Sat, Nov 29, 2008 at 12:09:51AM +0300, Andrew Savchenko wrote:
On Friday 28 November 2008 12:41, Diego Biurrun wrote: [...]
+ test $_pkg_config == "false" || _inc_theora="`$_pkg_config --silence-errors --cflags theora`"
Using == in 'test' invocations is a bashism.
Also, the value of _pkg_config is the *program* false, so that all invocations of pkg-config via $_pkg_config will simply fail cleanly. So you can simply execute the command and react according to the return value.
Return value check is the same as previos solution in terms of complexity, but if in your opinion check of return value is more elegant solution, so it should be.
Look at how some of the other pkg-config tests are done in configure. Anyway, the whole Theora test in configure looks quite crufty and suspicious. I think it needs to be rewritten. Diego
On Sat, Nov 29, 2008 at 11:27:05AM +0100, Diego Biurrun wrote:
On Sat, Nov 29, 2008 at 12:09:51AM +0300, Andrew Savchenko wrote:
On Friday 28 November 2008 12:41, Diego Biurrun wrote: [...]
+ test $_pkg_config == "false" || _inc_theora="`$_pkg_config --silence-errors --cflags theora`"
Using == in 'test' invocations is a bashism.
Also, the value of _pkg_config is the *program* false, so that all invocations of pkg-config via $_pkg_config will simply fail cleanly. So you can simply execute the command and react according to the return value.
Return value check is the same as previos solution in terms of complexity, but if in your opinion check of return value is more elegant solution, so it should be.
Look at how some of the other pkg-config tests are done in configure.
Anyway, the whole Theora test in configure looks quite crufty and suspicious. I think it needs to be rewritten.
Test rewritten. Let me know if you still experience issues. Diego
participants (2)
-
Andrew Savchenko -
Diego Biurrun