Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Linux shared library support with autotools #577

Closed
wants to merge 1 commit into from

2 participants

@sgallagher

This patch is a first pass at making libuv compilable as a shared library that can be used by multiple projects. The configure.ac is minimalistic (providing checks only for the presence of libev at this time) and does not yet work on non-Linux environments (such as AIX).

Of particular note, this patch modifies the build so that it is linking against the system shared version of libev rather than the bundled copy. This is much safer, as libev has a stable ABI and so it's better to leave updates to the system library.

@sgallagher sgallagher referenced this pull request
Closed

Make a release :) #354

@bnoordhuis

I appreciate the effort but I'm in the process of ripping out libev. Expect that change to land in the next few days.

Next time, ping one of us on IRC. We're in #libuv on freenode.org.

@bnoordhuis bnoordhuis closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2012
  1. @sgallagher
This page is out of date. Refresh to see the latest.
View
81 Makefile.am
@@ -0,0 +1,81 @@
+AM_CFLAGS = "--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter"
+ACLOCAL_AMFLAGS = -I m4 -I .
+
+lib_LTLIBRARIES = libuv.la
+
+dist_noinst_DATA = \
+ README.md \
+ README.autotools
+
+dist_include_HEADERS = \
+ include/uv.h
+dist_noinst_HEADERS = \
+ include/uv-private/ngx-queue.h \
+ include/uv-private/tree.h \
+ include/uv-private/uv-bsd.h \
+ include/uv-private/uv-darwin.h \
+ include/uv-private/uv-linux.h \
+ include/uv-private/uv-sunos.h \
+ include/uv-private/uv-unix.h \
+ include/uv-private/uv-win.h \
+ src/unix/internal.h \
+ src/unix/linux/syscalls.h \
+ src/uv-common.h \
+ src/win/atomicops-inl.h \
+ src/win/handle-inl.h \
+ src/win/internal.h \
+ src/win/req-inl.h \
+ src/win/stream-inl.h \
+ src/win/winapi.h \
+ src/win/winsock.h \
+ test/benchmark-list.h \
+ test/runner.h \
+ test/runner-unix.h \
+ test/runner-win.h \
+ test/task.h \
+ test/test-list.h
+
+UV_OBJS = \
+ src/unix/async.c \
+ src/unix/core.c \
+ src/unix/dl.c \
+ src/unix/error.c \
+ src/unix/fs.c \
+ src/unix/getaddrinfo.c \
+ src/unix/loop.c \
+ src/unix/loop-watcher.c \
+ src/unix/pipe.c \
+ src/unix/poll.c \
+ src/unix/process.c \
+ src/unix/signal.c \
+ src/unix/stream.c \
+ src/unix/tcp.c \
+ src/unix/thread.c \
+ src/unix/threadpool.c \
+ src/unix/timer.c \
+ src/unix/tty.c \
+ src/unix/udp.c \
+ src/fs-poll.c \
+ src/inet.c \
+ src/uv-common.c
+
+UV_LINUX_OBJS = \
+ src/unix/linux/linux-core.c \
+ src/unix/linux/inotify.c \
+ src/unix/linux/syscalls.c
+
+#TODO conditionalize this in automake
+UV_OBJS += $(UV_LINUX_OBJS)
+
+libuv_la_SOURCES = $(UV_OBJS)
+
+AM_CPPFLAGS = \
+ -I $(srcdir)/include \
+ -I $(srcdir)/include/uv-private \
+ -I $(srcdir)/src
+
+libuv_la_CFLAGS = $(LIBEV_CFLAGS)
+libuv_la_LIBADD = $(LIBEV_LIBS)
+libuv_la_LDFLAGS = \
+ -version-info 0:0:0 \
+ $(LIBEV_LDFLAGS)
View
7 README.autotools
@@ -0,0 +1,7 @@
+To build libuv as a shared library on Linux, take the following steps
+
+autoreconf -if
+mkdir linux; cd linux
+../configure [--enable-static]
+make
+sudo make install
View
0  build/.dir
No changes.
View
29 configure.ac
@@ -0,0 +1,29 @@
+AC_PREREQ(2.59)
+
+AC_INIT([libuv],
+ [0.8.11],
+ [libuv@groups.google.com])
+
+m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_USE_SYSTEM_EXTENSIONS],
+ [AC_GNU_SOURCE])
+
+AC_CONFIG_SRCDIR([README.md])
+AC_CONFIG_AUX_DIR([build])
+
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax])
+AM_PROG_CC_C_O
+AC_DISABLE_STATIC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_CONFIG_MACRO_DIR([m4])
+m4_pattern_allow([AM_SILENT_RULES])
+AM_SILENT_RULES
+
+AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
+
+PKG_CHECK_MODULES([LIBEV],[libev])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
Something went wrong with that request. Please try again.