[FFmpeg-cvslog] configure: Check for getenv

Martin Storsjö git at videolan.org
Sun May 5 13:10:27 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Nov 30 11:16:58 2012 +0200| [2cca96e670e78bb19eb0232469d5a27245e18c02] | committer: Martin Storsjö

configure: Check for getenv

When targeting the "windows store application" (metro) API subset
(or the windows phone API subset), the getenv function isn't
available. If it is unavailable, just define getenv to NULL.

The check uses check_func_headers, since the function actually
might exist in the libraries, but is hidden in the headers.

The fallback is in config.h since msvc can't do -D defines with
parameters on the command line, and it's used both within the
libraries and the frontend applications (so a libavutil internal
header wouldn't be enough).

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2cca96e670e78bb19eb0232469d5a27245e18c02
---

 configure |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure b/configure
index 5deb69e..d165e68 100755
--- a/configure
+++ b/configure
@@ -3499,6 +3499,7 @@ check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
 
 check_func  fcntl
 check_func  fork
+check_func_headers stdlib.h getenv
 check_func  gethrtime
 check_func  getopt
 check_func  getrusage
@@ -4086,6 +4087,8 @@ if enabled yasm; then
     printf '' >$TMPASM
 fi
 
+enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
+
 if enabled msvc && ! enabled shared; then
     echo '#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")' >> $TMPH
     echo '#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")' >> $TMPH



More information about the ffmpeg-cvslog mailing list