Lenard Lindstrom  committed 817c25b

Windows build chain installs most prebuilts

The dependency build chain builds and installs most
of the libraries for msvcr71 (Python 2.5).

Still need to check SDL_ttf and MikMod, as well as
the ffmpeg libraries (no rush on those).

The Pygame unit tests do not complete for Python 2.5.

Get the following periodic Windows console error message:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Build the dependencies for msvcr90.dll. Attempt to get to
build the DLLs directly, either by running the configure scripts with msvcr71
and switching to msvcr90 for Make, or adding manifest files for the configure
test programs.

  • Participants
  • Parent commits cfcdc09
  • Branches default

Comments (0)

Files changed (2)


         return '-L' + p
     return ''
+def as_preprocessor_header_path(p):
+    """Return as a C preprocessor header include path argument"""
+    if p:
+        return '-I' + p
+    return ''
 def merge_strings(*args, **kwds):
     """Returns non empty string joined by sep
         msvcr71_mp = lib_mp + '/msvcr71'
         environ['DBMSVCR71'] = msvcr71_mp
     if prefix_wp:
-        environ['CPPFLAGS'] = merge_strings('-I"%s/include"' % (prefix_mp,),
+        environ['CPPFLAGS'] = merge_strings(as_preprocessor_header_path(prefix_mp + '/include'),
                                             environ.get('CPPFLAGS', ''),
                                             sep=' ')
     subsystem = ''
             print_("No libraries specified.")
         elif options.build_all:
             print_("All libraries excluded")
-    if options.msvcr71:
+    if options.msvcr71 and not options.clean_only:
         chosen_deps.insert(0, msvcr71_preparation)
         print_("Linking to msvcr71.dll.")
         print_("Linking to MinGW default C runtime library.")
-    if chosen_deps:
+    if chosen_deps and not options.clean_only:
         chosen_deps.insert(0, msys_preparation)
         m = msys.Msys(options.msys_directory)
     start_time = None
     return_code = 1
     set_environment_variables(m, options)
-    print_("Destination directory:",
-           m.msys_to_windows(m.environ['PREFIX']).replace('/', os.sep))
+    if not options.clean_only:
+        print_("Destination directory:",
+               m.msys_to_windows(m.environ['PREFIX']).replace('/', os.sep))
     print_("common CPPFLAGS:", m.environ.get('CPPFLAGS', ''))
     print_("common CFLAGS:", m.environ.get('CFLAGS', ''))
     print_("common LDFLAGS:", m.environ.get('LDFLAGS', ''))
     except BuildError:
         print_("Build aborted:", geterror())
-        print_("\n=== Starting build ===")
+        if options.clean_only:
+            print_("\n=== Performing clean ===")
+        else:
+            print_("\n=== Starting build ===")
         start_time = time.time()  # For file timestamp checks.
             build(chosen_deps, m)
             # A successful build!
             return_code = 0
-    summary(dependencies, m, start_time, chosen_deps)
+    if not options.clean_only:
+        summary(dependencies, m, start_time, chosen_deps)
     # MinGW configure file for (optional).
-  # Disable dynamic loading of image libraries as that uses the wrong DLL
-  # search path. --disable-libtool-lock: Prevent libtool deadlocks (maybe).
+  # configure searches for the JPEG dll. Unfortunately it uses the wrong file
+  # name. Correct this.
+  mv configure configure~
+  sed -e 's|jpeg\.dll|libjpeg-*.dll|' configure~ >configure
+  # Add the destination bin directory to the library search path so
+  # configure can find its precious DLL files.
+  export LDFLAGS="$LDFLAGS -L$PREFIX/bin"
+  # Add path to PNG headers
+  CPPFLAGS="$CPPFLAGS `$PREFIX/bin/libpng-config --I_opts`"
+  # Disable dynamic loading of image libraries as it uses the wrong DLL
+  # search path: does not check in the same directory.
+  #  --disable-libtool-lock: Prevent libtool deadlocks (maybe).
   ./configure --disable-jpg-shared --disable-png-shared --disable-tif-shared \
               --disable-libtool-lock \
-              --prefix="$PREFIX" LDFLAGS="$LDFLAGS"
+              --prefix="$PREFIX" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
   # check for MSYS permission errors
   if [ x"`grep 'Permission denied' config.log`" != x ]; then

File prebuilt-template/

 COPYLIB_SDL_mixer -lSDL -lvorbisfile -lsmpeg -Lprebuilt/lib/SDL_mixer.dll
 COPYLIB_freetype -lz -Lprebuilt/lib/libfreetype-6.dll
 COPYLIB_smpeg -lSDL -Lprebuilt/lib/smpeg.dll
-COPYLIB_tiff -ljpeg -lz -Lprebuilt/lib/libtiff-3.dll
-COPYLIB_png -lz -Lprebuilt/lib/libpng14.dll
+COPYLIB_tiff -ljpeg -lz -Lprebuilt/lib/libtiff-5.dll
+COPYLIB_png -lz -Lprebuilt/lib/libpng16-16.dll
 COPYLIB_jpeg -Lprebuilt/lib/libjpeg-8.dll
 COPYLIB_z -Lprebuilt/lib/zlib1.dll
 COPYLIB_vorbisfile -lvorbis -Lprebuilt/lib/libvorbisfile-3.dll
 COPYLIB_swscale -lavutil -Lprebuilt/lib/swscale-0.dll
 COPYLIB_avcodec -lavutil -Lprebuilt/lib/avcodec-52.dll
 COPYLIB_avutil -Lprebuilt/lib/avutil-50.dll
+COPYLIB_gcc -Lprebuilt/lib/libgcc_s_dw2-1.dll
+COPYLIB_stdcpp -Lprebuilt/lib/libstdc++-6.dll