Building Erlang OTP R15B from source in cygwin using jdk javac & jar, cygwin make, install, gcc and ld

Does anyone know how to get Erlang built in cygwin?

I downloaded the Erlang OTP R15B source in my cygwin installation. Gunzipped and untarred the source. Then I did a ./configure --prefix=/usr and then make install

Screenshot of all my steps below.

# wget the Erlang source (for UNIX systems)
wget "http://www.erlang.org/download/otp_src_R15B.tar.gz" -O "$HOME/erlang/otp_src_R15B.tar.gz"

# tar -zxvf the tarball
tar -zxvf "$HOME/erlang/otp_src_R15B.tar.gz"

# Go to the location of the code
pushd "$HOME/erlang/otp_src_R15B"

# Create perl5 symlink for perl
ln -s /usr/bin/perl.exe perl5.exe

# Configure the build
./configure --prefix=/usr
    ...
    *********************************************************************
    **********************  APPLICATIONS INFORMATION  *******************
    *********************************************************************

    wx             : wxWidgets not found, wx will NOT be usable

    *********************************************************************
    *********************************************************************
    **********************  DOCUMENTATION INFORMATION  ******************
    *********************************************************************

    documentation  :
                     fop is missing.
                     Using fakefop to generate placeholder PDF files.

    *********************************************************************

I was able to get past the javac paths problem by using the following script in /usr/bin/javac.exe

$ cat /usr/bin/javac.exe
#!/bin/bash
#
# A wrapper for calling javac from Cygwin.
# Tries to convert any arguments that are Unix-style paths into
# Windows-style paths.  This includes any arguments to classpath or
# sourcepath or any arguments that begin with / .
#

ME="`basename $0`"
JAVAC_EXEC="$JAVA_HOME/bin/javac"
ARGS=""

while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      -cp | -classpath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      -sourcepath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      /*)
         arg="`cygpath -p -w "$arg"`"
         ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"
#echo "$JAVAC_EXEC" "$@"
exec "$JAVAC_EXEC" "$@"

Also added /usr/bin/jar.exe as follows:

$ cat /usr/bin/jar.exe
#!/bin/bash
#
# A wrapper for calling javac from Cygwin.
# Tries to convert any arguments that are Unix-style paths into
# Windows-style paths.  This includes any arguments to classpath or
# sourcepath or any arguments that begin with / .
#

ME="`basename $0`"
JAR_EXEC="$JAVA_HOME/bin/jar"
ARGS=""

while [ -n "$1" ]; do
   arg="$1"
   shift
   case "$arg" in
      -cp | -classpath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      -sourcepath)
         arg="$arg' '`cygpath -p -w "$1"`"
         shift
         ;;
      /*)
         arg="`cygpath -p -w "$arg"`"
         ;;
   esac
   ARGS="$ARGS '$arg'"
done

eval "set -- $ARGS"
#echo "$JAR_EXEC" "$@"
exec "$JAR_EXEC" "$@"

Also, modified otp.mk file setting CLASSPATH to expected windows paths as follows:

Line
172     .java.class:
173         CLASSPATH=`cygpath -wp $(CLASSPATH)` $(JAVA) $(JAVA_OPTIONS) $<
174     
175     
176     $(JAVA_DEST_ROOT)$(JAVA_CLASS_SUBDIR)%.class: %.java
177         CLASSPATH=`cygpath -wp $(CLASSPATH)` $(JAVA) $(JAVA_OPTIONS) -d $(JAVA_DEST_ROOT) $<

I was finally ready to do the installation

# Make 
make install

...
make[6]: Entering directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
ld -shared -o ../priv/lib/i686-pc-cygwin/trace_ip_drv.so ../priv/obj/i686-pc-cygwin/trace_ip_drv.o -lc -lutil -ldl -lm
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_alloc_binary':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:606: undefined reference to `driver_alloc_binary'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:608: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `write_until_done':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:632: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_alloc':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:591: undefined reference to `driver_alloc'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:593: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_driver_select':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:916: undefined reference to `driver_select'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `clean_que':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:736: undefined reference to `driver_free'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:744: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `close_unlink_port':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:820: undefined reference to `driver_free'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:820: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `trace_ip_ready_output':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:523: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `trace_ip_start':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:371: undefined reference to `set_port_control_flags'
/usr/lib/libc.a(t-d000779.o):fake:(.text+0x2): undefined reference to `_imp__close'
/usr/lib/libc.a(t-d000994.o):fake:(.text+0x2): undefined reference to `_imp__fprintf'
/usr/lib/libc.a(t-d000913.o):fake:(.text+0x2): undefined reference to `_imp__exit'
/usr/lib/libc.a(t-d001041.o):fake:(.text+0x2): undefined reference to `_imp__fwrite'
/usr/lib/libc.a(t-d001602.o):fake:(.text+0x2): undefined reference to `_imp__send'
/usr/lib/libc.a(t-d000032.o):fake:(.text+0x2): undefined reference to `_imp____errno'
/usr/lib/libc.a(t-d000934.o):fake:(.text+0x2): undefined reference to `_imp___fcntl64'
/usr/lib/libc.a(t-d001300.o):fake:(.text+0x2): undefined reference to `_imp__memcpy'
/usr/lib/libc.a(t-d000669.o):fake:(.text+0x2): undefined reference to `_imp__accept'
/usr/lib/libc.a(t-d001513.o):fake:(.text+0x2): undefined reference to `_imp__read'
/usr/lib/libc.a(t-d001304.o):fake:(.text+0x2): undefined reference to `_imp__memset'
/usr/lib/libc.a(t-d001706.o):fake:(.text+0x2): undefined reference to `_imp__sscanf'
/usr/lib/libc.a(t-d001690.o):fake:(.text+0x2): undefined reference to `_imp__socket'
/usr/lib/libc.a(t-d001636.o):fake:(.text+0x2): undefined reference to `_imp__setsockopt'
/usr/lib/libc.a(t-d000723.o):fake:(.text+0x2): undefined reference to `_imp__bind'
/usr/lib/libc.a(t-d001119.o):fake:(.text+0x2): undefined reference to `_imp__getsockname'
/usr/lib/libc.a(t-d001239.o):fake:(.text+0x2): undefined reference to `_imp__listen'
i686-pc-cygwin/Makefile:100: recipe for target `../priv/lib/i686-pc-cygwin/trace_ip_drv.so' failed
make[6]: *** [../priv/lib/i686-pc-cygwin/trace_ip_drv.so] Error 1
make[6]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/run_make.mk:38: recipe for target `release_spec' failed
make[5]: *** [release_spec] Error 2
make[5]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/otp_release_targets.mk:119: recipe for target `release' failed
make[4]: *** [release] Error 2
make[4]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/run_make.mk:38: recipe for target `release' failed
make[3]: *** [release] Error 2
make[3]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/otp_subdir.mk:28: recipe for target `release' failed
make[2]: *** [release] Error 2
make[2]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools'
/home/Dragos/erlang/otp_src_R15B/make/otp_subdir.mk:28: recipe for target `release' failed
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib'
Makefile:899: recipe for target `install.libs' failed
make: *** [install.libs] Error 2

Does anyone know how to get past this step? Thanks in advance.

Answers


I think you're wrong. If you read better you should see this line: javac: directory not found: /home/Dragos/erlang/otp_src_R15B/lib/jinterface/priv/

From what I can understand, the following error messages are simply there 'cause is the unwinding of the compilation stack.

Does the directory really exists or not? Give more information, please!


Need Your Help

How to make calls to Twitter API using Postman client

twitter postman

I have followed the steps required to create a new application and getting consumer key, secret pairs and also the token access details. Now I would like to make calls to Twitter Rest API, using ch...

Getting linker error

visual-c++

I am tring singalton class example.