?revision_form?Rev ?revision_input??revision_submit??revision_endform?
Blame |
Last modification |
View Log
| RSS feed
Author: Glenn McGrath <bug1@optushome.com.au>
Description: Use libtool to build dynamic library
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl ### Normal initialization. ######################################
AC_INIT([libtar], [1.2.11])
-AC_PREREQ([2.57])
+AC_PREREQ([2.61])
AC_CONFIG_AUX_DIR([autoconf])
AC_CONFIG_HEADERS([config.h])
AC_COPYRIGHT([[
@@ -26,15 +26,15 @@ AC_SUBST([MKDIR])
dnl ### Check for compiler et al. ###################################
+AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
-AC_PROG_RANLIB
+AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl ### Compiler characteristics. ##################################
-AC_AIX
AC_C_CONST
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -3,6 +3,7 @@
### Path settings
srcdir = @srcdir@
top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
@@ -23,6 +24,7 @@ MKDIR = @MKDIR@
### Compiler and link options
CC = @CC@
+LIBTOOL = @LIBTOOL@
CPPFLAGS = -I. \
-I.. \
-I${srcdir} \
@@ -32,7 +34,7 @@ CPPFLAGS = -I. \
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-LIBOBJS = @LIBOBJS@
+LTLIBOBJS = @LTLIBOBJS@
RANLIB = @RANLIB@
@SET_MAKE@
VPATH = @srcdir@:@top_srcdir@/compat:../listhash
@@ -40,24 +42,26 @@ VPATH = @srcdir@:@top_srcdir@/compat:..
### Makefile rules - no user-servicable parts below
-LIBTAR_OBJS = append.o \
- block.o \
- decode.o \
- encode.o \
- extract.o \
- handle.o \
- libtar_hash.o \
- libtar_list.o \
- output.o \
- util.o \
- wrapper.o
+LIBTAR_OBJS = append.lo \
+ block.lo \
+ decode.lo \
+ encode.lo \
+ extract.lo \
+ handle.lo \
+ libtar_hash.lo \
+ libtar_list.lo \
+ output.lo \
+ util.lo \
+ wrapper.lo
LIBTAR_HDRS = ../config.h \
${top_srcdir}/compat/compat.h \
${srcdir}/libtar.h \
${srcdir}/internal.h \
../listhash/libtar_listhash.h
-LIBTAR_LIBS = ./libtar.a
-ALL = libtar.a
+LIBTAR_LIBS = ./libtar.la
+ALL = libtar.la
+LDFLAGS = @LDFLAGS@
+CFLAGS = @CFLAGS@
DISTCLEANFILES = ../listhash/libtar_listhash.h \
../listhash/libtar_list.c \
@@ -68,24 +72,31 @@ all: ${ALL}
.PHONY: clean distclean install
-libtar.a: ${LIBTAR_OBJS} ${LIBOBJS}
- ${AR} rc libtar.a ${LIBTAR_OBJS} ${LIBOBJS}
- ${RANLIB} libtar.a
+libtar.la: ${LIBTAR_OBJS} ${LTLIBOBJS}
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o libtar.la $(LIBTAR_OBJS) $(LTLIBOBJS) -rpath $(libdir)
+# ${AR} rc libtar.a ${LIBTAR_OBJS} ${LIBOBJS}
+# ${RANLIB} libtar.a
${LIBTAR_OBJS}: ${LIBTAR_HDRS}
-.c.o:
- ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+%.lo: $(srcdir)/%.c
+ $(LIBTOOL) --mode=compile ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+
+%.lo: listhash/%.c
+ $(LIBTOOL) --mode=compile ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+
+%.lo: compat/%.c
+ $(LIBTOOL) --mode=compile ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
clean:
- rm -f *~ *.o ${ALL} core
+ rm -rf *~ *.o $(LIBTAR_OBJS) ${ALL} core .libs $(LTLIBOBJS)
distclean: clean
rm -f Makefile ${DISTCLEANFILES}
install: ${ALL}
${MKDIR} ${DESTDIR}${libdir}
- ${INSTALL_DATA} libtar.a ${DESTDIR}${libdir}
+ $(LIBTOOL) --mode=install ${INSTALL_DATA} libtar.la ${DESTDIR}${libdir}
${MKDIR} ${DESTDIR}${includedir}
${INSTALL_DATA} ${srcdir}/libtar.h ${DESTDIR}${includedir}
${INSTALL_DATA} ../listhash/libtar_listhash.h ${DESTDIR}${includedir}
--- a/libtar/Makefile.in
+++ b/libtar/Makefile.in
@@ -3,6 +3,7 @@
### Path settings
srcdir = @srcdir@
top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
@@ -23,6 +24,7 @@ MKDIR = @MKDIR@
### Compiler and link options
CC = @CC@
+LIBTOOL = @LIBTOOL@
CPPFLAGS = -I.. \
-I../lib \
-I../listhash \
@@ -31,7 +33,7 @@ CPPFLAGS = -I.. \
@CPPFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ -ltar
LIBOBJS = @LIBOBJS@
RANLIB = @RANLIB@
@SET_MAKE@
@@ -40,12 +42,12 @@ VPATH = @srcdir@
### Makefile rules - no user-servicable parts below
-LIBTAR_OBJS = libtar.o
+LIBTAR_OBJS = libtar.lo
LIBTAR_HDRS = ../config.h \
${top_srcdir}/compat/compat.h \
${top_srcdir}/lib/libtar.h \
../listhash/libtar_listhash.h
-LIBTAR_LIBS = ../lib/libtar.a
+LIBTAR_LIBS = $(top_builddir)/lib
ALL = libtar
@@ -54,20 +56,20 @@ all: ${ALL}
.PHONY: clean distclean install
libtar: ${LIBTAR_OBJS} ${LIBTAR_LIBS} ${LIBTAR_HDRS}
- ${CC} ${CFLAGS} ${LDFLAGS} -o libtar libtar.o ${LIBTAR_LIBS} ${LIBS}
+ $(LIBTOOL) --mode=link ${CC} ${CFLAGS} ${LDFLAGS} -o libtar $(LIBTAR_OBJS) -L${LIBTAR_LIBS} ${LIBS}
${LIBTAR_OBJS}: ${LIBTAR_HDRS}
-.c.o:
- ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+%.lo: %.c
+ $(LIBTOOL) --mode=compile ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
clean:
- rm -f *~ *.o ${ALL} core
+ rm -rf *~ *.o ${ALL} $(LIBTAR_OBJS) core .libs
distclean: clean
rm -f Makefile
install: ${ALL}
${MKDIR} ${DESTDIR}${bindir}
- ${INSTALL_PROGRAM} libtar ${DESTDIR}${bindir}
+ $(LIBTOOL) --mode=install ${INSTALL_PROGRAM} libtar ${DESTDIR}${bindir}