author Ryan C. Gordon <>
Thu, 28 May 2015 01:54:52 -0400
changeset 9671 0e1f57b051f4
parent 7232 6f17d930be39
child 10398 165f98326b5c
permissions -rwxr-xr-x
Windows GetBasePath should use GetModuleFileNameExW() and check for overflows.

Apparently you might get strange paths from GetModuleFileName(), such as
short path names or UNC filenames, so this avoids that problem. Since you have
to tapdance with linking different libraries and defining macros depending on
what Windows you plan to target, we dynamically load the API we need, which
works on all versions of Windows (on Win7, it'll load a compatibility wrapper
for the newer API location).

What a mess.

This also now does the right thing if there isn't enough space to store the
path, looping with a larger allocated buffer each try.

Fixes Bugzilla #2435.
     1 #!/bin/sh
     2 #
     3 echo "Generating build information using autoconf"
     4 echo "This may take a while ..."
     6 # Regenerate configuration files
     7 cat acinclude/* >aclocal.m4
     8 found=false
     9 for autoconf in autoconf autoconf259 autoconf-2.59
    10 do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
    11 done
    12 if test x$found = xfalse; then
    13     echo "Couldn't find autoconf, aborting"
    14     exit 1
    15 fi
    16 (cd test; sh
    18 # Run configure for this platform
    19 echo "Now you are ready to run ./configure"