Skip to content

Commit

Permalink
Add msinttypes to the dependency pack and make setup.py use it iff bu…
Browse files Browse the repository at this point in the history
…ilding with MSVC.
  • Loading branch information
stump committed Nov 27, 2010
1 parent dd3a7d8 commit 0d17024
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/setup.py
Expand Up @@ -329,6 +329,10 @@ def run(self, *args, **kw):
libfile = os.path.splitext(deffile)[0] + '.lib'
if newer(deffile, libfile):
msvc.spawn([msvc.lib, '/nologo', '/machine:x86', '/out:'+libfile, '/def:'+deffile])

# Also add the directory containing the msinttypes headers to the include path.
self.include_dirs.append(os.path.join('..', 'win32', 'deps', 'include', 'msinttypes'))

return _build_ext.run(self, *args, **kw)

# Add the common arguments to setup().
Expand Down
10 changes: 10 additions & 0 deletions win32/makedeps-cross.sh
Expand Up @@ -277,6 +277,16 @@ if test ! -f "$PREFIX"/build-stamps/ffmpeg; then
$RM_RF ffmpeg
fi

# msinttypes
# MSVC needs these to compile stuff that uses ffmpeg. Since they intentionally
# do not work with gcc, we install them to a subdirectory of deps/include
# and feed MSVC an appropriate include_dir option in setup.py.
if test ! -f "$PREFIX"/build-stamps/msinttypes; then
download http://msinttypes.googlecode.com/files/msinttypes-r26.zip
unzip -od deps/include/msinttypes msinttypes-r26.zip stdint.h inttypes.h
touch "$PREFIX"/build-stamps/msinttypes
fi

echo "All dependencies done."

echo -n "Creating .def files... "
Expand Down

0 comments on commit 0d17024

Please sign in to comment.