From 827ebbd9749294dd82ddad4e22033dcc0bbc2c05 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 27 Feb 2011 09:53:48 +0100 Subject: [PATCH] Use libtool and compile libht as a shared library. --- .gitignore | 6 ++++++ bootstrap | 2 +- configure.in | 4 +--- lib/.gitignore | 2 +- lib/Makefile.am | 8 ++++---- src/Makefile.am | 2 +- src/dirplex/Makefile.am | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 90ca2a3..e4c7074 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,9 @@ Makefile Makefile.in .deps +.libs *.o +*.lo /aclocal.m4 /autom4te.cache @@ -16,3 +18,7 @@ Makefile.in /install-sh /missing /stamp-h1 +/libtool +/ltmain.sh +/config.guess +/config.sub diff --git a/bootstrap b/bootstrap index 91d2d2e..273016a 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #!/bin/sh -dolibtool=no +dolibtool=yes dogettext=no if [ "$dogettext" = yes ]; then diff --git a/configure.in b/configure.in index 38327ad..4ca3d93 100644 --- a/configure.in +++ b/configure.in @@ -5,10 +5,8 @@ AM_CONFIG_HEADER(config.h) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL -AC_PROG_RANLIB -dnl Add for libtool: -dnl AM_PROG_LIBTOOL +AM_PROG_LIBTOOL AC_HEADER_STDC diff --git a/lib/.gitignore b/lib/.gitignore index 67a4325..bf84e1b 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -1 +1 @@ -/libht.a +/libht.la diff --git a/lib/Makefile.am b/lib/Makefile.am index a41cde0..88056a0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ -noinst_LIBRARIES = libht.a +lib_LTLIBRARIES = libht.la -libht_a_SOURCES = utils.c mt.c log.c req.c proc.c mtio.c resp.c cf.c \ +libht_la_SOURCES = utils.c mt.c log.c req.c proc.c mtio.c resp.c cf.c \ utils.h mt.h log.h req.h proc.h mtio.h resp.h cf.h -libht_a_CFLAGS = -fPIC -libht_a_CPPFLAGS = -D_GNU_SOURCE +libht_la_CPPFLAGS = -D_GNU_SOURCE +libht_la_LDFLAGS = -version-info 1:0:0 diff --git a/src/Makefile.am b/src/Makefile.am index 3e3c6a7..73d21bc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ bin_PROGRAMS = htparser sendfile callcgi patplex userplex htls \ htparser_SOURCES = htparser.c htparser.h plaintcp.c ssl-gnutls.c -LDADD = $(top_srcdir)/lib/libht.a +LDADD = $(top_srcdir)/lib/libht.la AM_CPPFLAGS = -I$(top_srcdir)/lib htparser_CPPFLAGS = $(AM_CPPFLAGS) @GNUTLS_CPPFLAGS@ diff --git a/src/dirplex/Makefile.am b/src/dirplex/Makefile.am index 97d9842..95659a8 100644 --- a/src/dirplex/Makefile.am +++ b/src/dirplex/Makefile.am @@ -2,5 +2,5 @@ bin_PROGRAMS = dirplex dirplex_SOURCES = dirplex.c conf.c dirplex.h -LDADD = $(top_srcdir)/lib/libht.a +LDADD = $(top_srcdir)/lib/libht.la AM_CPPFLAGS = -I$(top_srcdir)/lib -- 2.11.0