mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-23 03:39:51 +00:00
* Install libkqueue.la and libkqueue.a in LIBDIR
* New test target "test-libtool" builds the test program using libtool. git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@100 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
parent
3485e12297
commit
20bcd7a849
2
Makefile
2
Makefile
@ -28,7 +28,7 @@ install:
|
|||||||
$(INSTALL) -d -m 755 $(INCLUDEDIR)/kqueue/sys
|
$(INSTALL) -d -m 755 $(INCLUDEDIR)/kqueue/sys
|
||||||
$(INSTALL) -m 644 include/sys/event.h $(INCLUDEDIR)/kqueue/sys/event.h
|
$(INSTALL) -m 644 include/sys/event.h $(INCLUDEDIR)/kqueue/sys/event.h
|
||||||
$(INSTALL) -d -m 755 $(LIBDIR)
|
$(INSTALL) -d -m 755 $(LIBDIR)
|
||||||
$(INSTALL) -m 644 libkqueue.so $(LIBDIR)/libkqueue.so
|
$(INSTALL) -m 644 $(PROGRAM).so $(PROGRAM).la $(PROGRAM).a $(LIBDIR)
|
||||||
$(INSTALL) -d -m 755 $(LIBDIR)/pkgconfig
|
$(INSTALL) -d -m 755 $(LIBDIR)/pkgconfig
|
||||||
$(INSTALL) -m 644 libkqueue.pc $(LIBDIR)/pkgconfig
|
$(INSTALL) -m 644 libkqueue.pc $(LIBDIR)/pkgconfig
|
||||||
$(INSTALL) -d -m 755 $(MANDIR)/man2
|
$(INSTALL) -d -m 755 $(MANDIR)/man2
|
||||||
|
@ -19,6 +19,7 @@ pre_configure_hook() {
|
|||||||
cflags="$cflags -DKQUEUE_DEBUG"
|
cflags="$cflags -DKQUEUE_DEBUG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
libdepends=" -L$libdir"
|
||||||
if [ $target = "linux" ] ; then
|
if [ $target = "linux" ] ; then
|
||||||
libdepends="$libdepends -lpthread -lrt"
|
libdepends="$libdepends -lpthread -lrt"
|
||||||
required_headers="sys/epoll.h sys/inotify.h
|
required_headers="sys/epoll.h sys/inotify.h
|
||||||
|
1
configure
vendored
1
configure
vendored
@ -194,6 +194,7 @@ check_headers $optional_headers
|
|||||||
post_configure_hook
|
post_configure_hook
|
||||||
|
|
||||||
subst_vars "$program.pc"
|
subst_vars "$program.pc"
|
||||||
|
subst_vars "$program.la"
|
||||||
subst_vars "rpm.spec"
|
subst_vars "rpm.spec"
|
||||||
|
|
||||||
echo "Creating config.h"
|
echo "Creating config.h"
|
||||||
|
35
libkqueue.la.in
Normal file
35
libkqueue.la.in
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# @@PROGRAM@@.la - a libtool library file
|
||||||
|
# Generated by ltmain.sh - GNU libtool 1.5.20 (1.1220.2.287 2005/08/31 18:54:15)
|
||||||
|
#
|
||||||
|
# Please DO NOT delete this file!
|
||||||
|
# It is necessary for linking the library.
|
||||||
|
|
||||||
|
# The name that we can dlopen(3).
|
||||||
|
dlname='@@PROGRAM@@.so.0'
|
||||||
|
|
||||||
|
# Names of this library.
|
||||||
|
library_names='@@PROGRAM@@.so'
|
||||||
|
|
||||||
|
# The name of the static archive.
|
||||||
|
old_library='@@PROGRAM@@.a'
|
||||||
|
|
||||||
|
# Libraries that this one depends upon.
|
||||||
|
dependency_libs=' @@LIBDEPENDS@@'
|
||||||
|
|
||||||
|
# Version information for @@PROGRAM@@.
|
||||||
|
current=0
|
||||||
|
age=0
|
||||||
|
revision=0
|
||||||
|
|
||||||
|
# Is this an already installed library?
|
||||||
|
installed=yes
|
||||||
|
|
||||||
|
# Should we warn about portability when linking against -modules?
|
||||||
|
shouldnotlink=no
|
||||||
|
|
||||||
|
# Files to dlopen/dlpreopen
|
||||||
|
dlopen=''
|
||||||
|
dlpreopen=''
|
||||||
|
|
||||||
|
# Directory that this library needs to be installed in:
|
||||||
|
libdir='@@LIBDIR@@'
|
@ -35,6 +35,11 @@ check-installed:
|
|||||||
gcc $(CFLAGS) -I$(PREFIX)/kqueue test.c -lkqueue
|
gcc $(CFLAGS) -I$(PREFIX)/kqueue test.c -lkqueue
|
||||||
./a.out
|
./a.out
|
||||||
|
|
||||||
|
check-libtool:
|
||||||
|
gcc $(CFLAGS) -c *.c
|
||||||
|
libtool --mode=link gcc -g -O0 -o a.out *.o $(LIBDIR)/libkqueue.la
|
||||||
|
./a.out
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f config.mk config.h a.out
|
rm -f config.mk config.h a.out
|
||||||
|
|
||||||
|
@ -160,12 +160,45 @@ libkqueue currently requires the following:
|
|||||||
|
|
||||||
<h2>Usage</h2>
|
<h2>Usage</h2>
|
||||||
|
|
||||||
Here are the steps to use libkqueue in your program:
|
|
||||||
|
<h3>Ordinary Makefile</h3>
|
||||||
|
|
||||||
|
Here are the steps to use libkqueue in your program if you use an ordinary Makefile:
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Add <code>`pkg-config libkqueue --cflags`</code> to the CFLAGS variable.
|
<li>Add <code>`pkg-config libkqueue --cflags`</code> to the CFLAGS variable.
|
||||||
<li>Add <code>`pkg-config libkqueue --libs`</code> to the LDADD variable.
|
<li>Add <code>`pkg-config libkqueue --libs`</code> to the LDADD variable.
|
||||||
<li>Add <code>#include <sys/event.h></code> to the source code.
|
<li>Add <code>#include <sys/event.h></code> to the source code.
|
||||||
</ol>
|
</ol>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Autoconf/Automake/Libtool</h3>
|
||||||
|
|
||||||
|
If your program uses the GNU Autoconf/Automake/Libtool build system, the following steps will allow you to use libkqueue:
|
||||||
|
|
||||||
|
<ol>
|
||||||
|
|
||||||
|
<li>Add the following to <code>configure.ac</code>:
|
||||||
|
<pre>
|
||||||
|
#
|
||||||
|
# Prefer native kqueue(2); otherwise use libkqueue if present.
|
||||||
|
#
|
||||||
|
AC_CHECK_HEADER(sys/event.h, [],
|
||||||
|
[PKG_CHECK_MODULES(KQUEUE, libkqueue)]
|
||||||
|
)
|
||||||
|
</pre>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
Add the following to <code>Makefile.am</code> (assuming your program is named "foo"):
|
||||||
|
<pre>
|
||||||
|
foo_CFLAGS+=$(KQUEUE_CFLAGS)
|
||||||
|
foo_LDADD+=$(KQUEUE_LIBS)
|
||||||
|
</pre>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p>Instead of using the <code>$(KQUEUE_LIBS)</code> variable, you could just add <code>libkqueue.la</code> to your programs LDADD variable.
|
||||||
|
|
||||||
<h3>Threads</h3>
|
<h3>Threads</h3>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user