Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "Libartnet on Windows"

From wiki.openlighting.org

Jump to: navigation, search
(Download Libartnet)
 
(7 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
(nicole-banana.com)
 
(nicole-banana.com)
  
This HOWTO outlines a method for compiling libartnet on Windows using MinGW (libartnet-1.dll).
+
This HOWTO outlines a method for compiling libartnet on Windows using MinGW to produce the libartnet-1.dll.
  
you'll need msys, mingw and autotools installed.
 
  
          o autoconf [http://ftp.gnu.org/gnu/autoconf/]
+
== Install Mingw, msys & build tools ==
          o automake [http://ftp.gnu.org/gnu/automake/]
 
          o libtool [http://ftp.gnu.org/gnu/libtool/]
 
  
*  Unpack autoconf, automake and libtool to a directory of your choice.
+
The instructions at http://www.mingw.org/wiki/MSYS are very helpful. There are similar instructions at http://www.cccp-project.net/wiki/index.php?title=Installing_MSYS-MinGW
  
* Install them with the 3 with the following command:
+
* Install mingw and msys
  
../path/to/configure --prefix=/mingw && make && make install
+
* Download these packages
 +
** autoconf [http://ftp.gnu.org/gnu/autoconf/]
 +
** automake [http://ftp.gnu.org/gnu/automake/]
 +
** libtool [http://ftp.gnu.org/gnu/libtool/]
 +
 
 +
* Launch the msys shell
 +
 
 +
* Unpack autoconf, automake and libtool to a directory of your choice.
 +
 
 +
* Install each of them with the following command:
 +
 
 +
$ ./configure --prefix=/mingw && make && make install
 +
 
 +
* Update PKG_CONFIG_PATH
  
 
As all the libraries will be installed in /mingw, PKG_CONFIG_PATH must be set.  
 
As all the libraries will be installed in /mingw, PKG_CONFIG_PATH must be set.  
Line 35: Line 45:
  
 
Now restart MSYS. You should now be able to use MSYS without problems.
 
Now restart MSYS. You should now be able to use MSYS without problems.
 
(taken from http://www.mingw.org/wiki/msys)
 
 
 
            
 
            
 
This is the biggest part of the job.
 
This is the biggest part of the job.
  
 +
== Install Git ==
 +
 +
See http://code.google.com/p/msysgit/, be sure to select "unix style carriage returns" otherwise you'll get autoconf errors.
  
 
== Download Libartnet ==
 
== Download Libartnet ==
  
Sources (via git) - this will download latest libartnet version
+
Grab the libarnet sources (via the git shell or the git UI)
 
 
git clone http://www.nomis52.net/git/libartnet
 
 
 
== CHECK ==
 
 
 
check that AC_LIBTOOL_WIN32_DLL macro is present in libartnet/configure.in
 
 
 
 
 
if not, add AC_LIBTOOL_WIN32_DLL macro before AC_PROG_LIBTOOL
 
 
 
 
 
          o AC_PROG_CC
 
          o AC_PROG_INSTALL
 
          o AC_PROG_LN_S
 
          o AC_PROG_MAKE_SET
 
          o ''AC_LIBTOOL_WIN32_DLL''
 
          o AC_PROG_LIBTOOL
 
 
 
 
 
i did this with Bloc-notes because the way the file is recorded is important. you don't want \cr\lf end of lines, you just want \lf.
 
otherwise, you'll get errors like
 
 
 
' is already registered with AC_CONFIG_FILES.
 
../../lib/autoconf/status.m4:305: AC_CONFIG_FILES is expanded from...
 
configure.in:76: the top level
 
  
 +
$ git clone https://github.com/OpenLightingProject/libartnet.git libartnet
  
edit libartnet/artnet/Makefile.am, and check if libartnet_la_LDFLAGS look like this
+
== Compile Libartnet ==
 
 
libartnet_la_LDFLAGS = -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 -ldpnet -version-info 1:0:0
 
 
or
 
 
 
if USING_WIN32
 
libartnet_la_LDFLAGS += -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 \
 
                        -ldpnet
 
endif
 
 
 
 
 
 
 
== Build ==
 
 
 
now go to libartnet
 
  
 
  $ cd libartnet
 
  $ cd libartnet
 
+
  $ autoreconf -i -f
launch reconf script (autotools where installed in/c/MinGW, so i pass this prefix)
+
  $ ./configure --prefix=/mingw && make && make install
 
 
  $ reconf --prefix=/c/MinGW/
 
configure.in:14: installing `./config.guess'
 
configure.in:14: installing `./config.sub'
 
configure.in:7: installing `./install-sh'
 
configure.in:15: required file `./ltmain.sh' not found
 
configure.in:7: installing `./missing'
 
artnet/Makefile.am: installing `./depcomp'
 
 
 
libtoolize everything to copy ./ltmain.sh
 
 
 
$ libtoolize --force --copy
 
libtoolize: putting auxiliary files in `.'.
 
libtoolize: copying file `./ltmain.sh'
 
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
 
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
 
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 
 
 
(i didn't set AC_CONFIG_MACRO_DIR([m4]) neither ACLOCAL_AMFLAGS)
 
 
 
re-launch reconf script
 
 
 
$ reconf --prefix=/c/MinGW/
 
 
 
compile everything
 
 
 
  $ ./configure --prefix=/c/MinGW/ && make && make install
 
 
 
AC_PROG_LIBTOOL macro and -no-undefined flag cause libartnet to build as DLL
 

Latest revision as of 21:23, 19 January 2014

Written by sl1200mk2 2009/07/01. (nicole-banana.com)

This HOWTO outlines a method for compiling libartnet on Windows using MinGW to produce the libartnet-1.dll.


Install Mingw, msys & build tools

The instructions at http://www.mingw.org/wiki/MSYS are very helpful. There are similar instructions at http://www.cccp-project.net/wiki/index.php?title=Installing_MSYS-MinGW

  • Install mingw and msys
  • Download these packages
  • Launch the msys shell
  • Unpack autoconf, automake and libtool to a directory of your choice.
  • Install each of them with the following command:
$ ./configure --prefix=/mingw && make && make install
  • Update PKG_CONFIG_PATH

As all the libraries will be installed in /mingw, PKG_CONFIG_PATH must be set.

Open the file /etc/profile (C:\msys\1.0\etc\profile) with your favorite editor (make sure it uses LF line endings) and add:

PKG_CONFIG_PATH="/mingw/lib/pkgconfig"

You might also want to set CFLAGS. Safe options for MinGW are:

CFLAGS="-pipe -O2 -mms-bitfields -march=i686"

just before

export HOME LOGNAME MSYSTEM HISTFILE

and modify that line by adding the variables:

export HOME LOGNAME MSYSTEM HISTFILE CFLAGS PKG_CONFIG_PATH

Now restart MSYS. You should now be able to use MSYS without problems.

This is the biggest part of the job.

Install Git

See http://code.google.com/p/msysgit/, be sure to select "unix style carriage returns" otherwise you'll get autoconf errors.

Download Libartnet

Grab the libarnet sources (via the git shell or the git UI)

$ git clone https://github.com/OpenLightingProject/libartnet.git libartnet

Compile Libartnet

$ cd libartnet
$ autoreconf -i -f 
$ ./configure --prefix=/mingw && make && make install