Skip to content

Commit

Permalink
[WIP]libtool: build a shared library on Cygwin
Browse files Browse the repository at this point in the history
Relates to esnet#514

Changed:
- enable libtool's Win32 DLL feature
- set libtool flags to force building a shared library

Build steps:
```
$ touch NEWS README AUTHORS ChangeLog
$ automake --add-missing --copy --foreign
$ autoreconf
$ ./configure
$ make -j8
```

Verification:
- build artifacts cre located under `src/.libs`
- there should be:
  - `cygiperf-0.dll` shared library
  - `iperf3.exe` executable binary linked to it
- `$ ldd src/.libs/iperf3.exe`

See:
- http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
- https://www.sourceware.org/autobook/autobook/autobook_135.html
- https://www.sourceware.org/autobook/autobook/autobook_136.html
- https://www.sourceware.org/autobook/autobook/autobook_137.html
- http://stackoverflow.com/questions/26151995/autotools-make-doesnt-create-dll-under-cygwin
- https://autotools.io/libtool/windows.html
- https://cygwin.com/cygwin-ug-net/dll.html
- https://cygwin.com/problems.html
- http://stackoverflow.com/questions/25105573/compile-for-windows-using-mingw-w64-and-autotools

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
  • Loading branch information
virtualtam committed May 10, 2017
1 parent e255a12 commit 45ab0a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LN_S

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
LT_INIT

# Add -Wall if we are using GCC.
if test "x$GCC" = "xyes"; then
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include_HEADERS = iperf_api.h # Defines the headers that get installed w


# Specify the source files and flags for the iperf library
libiperf_la_LDFLAGS = -no-undefined -version-info 0:0:0
libiperf_la_SOURCES = \
cjson.c \
cjson.h \
Expand Down

0 comments on commit 45ab0a8

Please sign in to comment.