Fixes for building erlang under windows

Davide Marquês nesrait@REDACTED
Fri Sep 25 14:55:31 CEST 2009


Hi all,

Here are some fixes I picked up along the way while building erlang on a
fresh install of Windows.

Fix for cygwin environments that might have non-default cygdrive prefixes:

> $ERL_TOP/erts/configure.in:
> 3242:
>     open_ssl_default_dir=`cygpath "c:\OpenSSL"`
>     for dir in $extra_dir $open_ssl_default_dir \
> 3493:
>     kerberos_default_dir=`cygpath "c:\kerberos"`
>     SSL_KRB5_INCLUDE=
>     if test "x$ssl_krb5_enabled" = "xyes" ; then
>         AC_MSG_CHECKING(for krb5.h in standard locations)
>     for dir in $extra_dir $SSL_ROOT/include $SSL_ROOT/include/openssl \
>         $SSL_ROOT/include/kerberos $kerberos_default_dir/include \
>
>
> $ERL_TOP/erts/configure:
> 21867:
>     open_ssl_default_dir=`cygpath "c:\OpenSSL"`
>     for dir in $extra_dir $open_ssl_default_dir \
> 22235:
>     kerberos_default_dir=`cygpath "c:\kerberos"`
>     SSL_KRB5_INCLUDE=
>         if test "x$ssl_krb5_enabled" = "xyes" ; then
>             echo "$as_me:$LINENO: checking for krb5.h in standard
> locations" >&5
>     echo $ECHO_N "checking for krb5.h in standard locations... $ECHO_C" >&6
>         for dir in $extra_dir $SSL_ROOT/include $SSL_ROOT/include/openssl \
>             $SSL_ROOT/include/kerberos $kerberos_default_dir/include \
>

Needed changes for OpenSSL installations in non-default paths:

> Using the "--with-ssl" option in configure (EVEN IF OpenSSL is installed
> in a default location) will set the SSL_LIBDIR variable to an incorrect
> value
> and crypto and ssh compilation will fail.
>
>     - If OpenSSL is found in the default location:
>         $ ./otp_build configure
>         ...
>         $ grep "SSL_LIBDIR =" lib/crypto/c_src/win32/Makefile
>         SSL_LIBDIR = /c/OpenSSL/lib
>
>     - Otherwise if we provide the path to OpenSSL:
>         $ ./otp_build configure --with-ssl="/c/OpenSSL"
>         ...
>         $ grep "SSL_LIBDIR =" lib/crypto/c_src/win32/Makefile
>         SSL_LIBDIR = /c/OpenSSL/lib/VC
>
> $ERL_TOP/erts/configure:22139
> $ERL_TOP/erts/configure.in:3418
>     if test "x$MIXED_CYGWIN" = "xyes" -a -d "$with_ssl/lib/VC"; then
>         SSL_LIBDIR="$with_ssl/lib/VC"
> should include the additional tests:
>     if test "x$MIXED_CYGWIN" = "xyes" ; then
>         if test -f "$dir/lib/VC/ssleay32.lib" -o \
>             -f "$dir/lib/VC/openssl.lib"; then
>             SSL_LIBDIR="$dir/lib/VC"
>         elif test -f "$dir/lib/ssleay32.lib" -o \
>             -f "$dir/lib/openssl.lib"; then
>             SSL_LIBDIR="$dir/lib"
>         else
>             is_real_ssl=no
>         fi
> that are done when looking open OpenSSL in the default paths
> ($ERL_TOP/erts/configure.in:21867 and $ERL_TOP/erts/configure:3242).
>

Others...

> $ERL_TOP/erts/etc/win32/cygwin_tools/vc/mc.sh:
> 70:
>         if [ "X$MC_SH_DEBUG_LOG" != "X" ]; then
>             echo mc.sh "$SAVE" >>$MC_SH_DEBUG_LOG
>             echo $MCC $CMD >>$MC_SH_DEBUG_LOG
>         fi
>
> Comparing line 33 of $ERL_TOP/erts/etc/win32/cygwin_tools/vc/mc.sh:
>     if [ -n "`$p/mc.exe -? 2>&1 >/dev/null </dev/null \
>                  | grep -i \"message compiler\"`" ]; then
>         MCC=$p/mc.exe
>     fi
> with line 33 of $ERL_TOP/erts/etc/win32/cygwin_tools/vc/rc.sh:
>     if [ -n "`$p/rc.exe -? 2>&1 | grep -i "resource compiler"`" ]; then
>         RCC=$p/rc.exe
>     fi
> It seems the second one needs some escaping: \"resource compiler\".
>

That's it for now.

I'm rewriting a step-by-step
tutorial<http://github.com/davide/erl_interface-examples/tree/master/doc/>on
how to build erlang under windows
using Visual C++ Express 2008 which I'll share when complete (wxWidgets
and gs are still giving me an hard time).

Cheers,
:Davide


More information about the erlang-patches mailing list