Use libtool for linking but keep the libraries static.
authorPetter Urkedal <paurkedal@gmail.com>
Sun, 14 Aug 2011 10:24:30 +0000 (12:24 +0200)
committerPetter Urkedal <paurkedal@gmail.com>
Sun, 14 Aug 2011 10:42:05 +0000 (12:42 +0200)
* configure.ac: Use LT_INIT([disable-shared]) instead of AC_PROG_RANLIB.
Also, re-enable the m4 macro directory.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
* m4/.keep: Create the m4 directory to avoid problems due to the above
m4 flag when running autoreconf for the first time.

.gitignore
Makefile.am
configure.ac
m4/.keep [new file with mode: 0644]
src/Makefile.am
tests/Makefile.am

index 4ea6525..d233246 100644 (file)
@@ -43,6 +43,14 @@ Makefile
 /src/config.h.in
 Makefile.in
 
+# Generated by libtoolize:
+/ltmain.sh
+/m4/libtool.m4
+/m4/ltoptions.m4
+/m4/ltsugar.m4
+/m4/ltversion.m4
+/m4/lt~obsolete.m4
+
 # These files are generated by make check:
 /tests/list_atomic.c
 /tests/test_atomic_include.h
index 606ba8b..deb22b9 100644 (file)
@@ -1,5 +1,7 @@
 SUBDIRS = src doc tests
 
+ACLOCAL_AMFLAGS = -I m4
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = atomic_ops.pc
 
index c1dca75..9855a2f 100644 (file)
@@ -4,16 +4,16 @@ AC_INIT([libatomic_ops],[7.2alpha7])
 AC_PREREQ(2.64)
 AC_CANONICAL_TARGET([])
 AC_CONFIG_SRCDIR(src/atomic_ops.c)
-#AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc])
 AM_MAINTAINER_MODE
-AC_PROG_RANLIB
 
 AM_CONFIG_HEADER(src/config.h)
 
 # Checks for programs.
 AM_PROG_CC_C_O
 AM_PROG_AS
+LT_INIT([disable-shared])
 
 # Checks for functions.
 AC_FUNC_MMAP
diff --git a/m4/.keep b/m4/.keep
new file mode 100644 (file)
index 0000000..e69de29
index 875a7ce..b439521 100644 (file)
@@ -2,14 +2,14 @@ AM_CFLAGS=@PICFLAG@
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
 
 include_HEADERS=atomic_ops.h atomic_ops_stack.h atomic_ops_malloc.h
-lib_LIBRARIES = libatomic_ops.a libatomic_ops_gpl.a
+lib_LTLIBRARIES = libatomic_ops.la libatomic_ops_gpl.la
 if NEED_ASM
-libatomic_ops_a_SOURCES = atomic_ops.c atomic_ops_sysdeps.S
+libatomic_ops_la_SOURCES = atomic_ops.c atomic_ops_sysdeps.S
 else
-libatomic_ops_a_SOURCES = atomic_ops.c
+libatomic_ops_la_SOURCES = atomic_ops.c
 endif
 
-libatomic_ops_gpl_a_SOURCES = atomic_ops_stack.c atomic_ops_malloc.c
+libatomic_ops_gpl_la_SOURCES = atomic_ops_stack.c atomic_ops_malloc.c
 
 EXTRA_DIST=Makefile.msft atomic_ops/sysdeps/README \
         atomic_ops/generalize-small.template atomic_ops/sysdeps/sunc/sparc.S
index acf699b..b5891fd 100644 (file)
@@ -16,19 +16,21 @@ TESTS=test_atomic test_atomic_pthreads test_stack test_malloc
 check_PROGRAMS=test_atomic test_atomic_pthreads test_stack test_malloc
 
 test_atomic_SOURCES=test_atomic.c
-test_atomic_LDADD=$(THREADDLLIBS) ../src/libatomic_ops.a
+test_atomic_LDADD = $(THREADDLLIBS) $(top_builddir)/src/libatomic_ops.la
 
 test_atomic_pthreads_SOURCES=test_atomic.c
 test_atomic_pthreads_CPPFLAGS=-DAO_USE_PTHREAD_DEFS $(AM_CPPFLAGS)
-test_atomic_pthreads_LDADD=$(THREADDLLIBS) ../src/libatomic_ops.a
+test_atomic_pthreads_LDADD = $(THREADDLLIBS) $(top_builddir)/src/libatomic_ops.la
 
 test_stack_SOURCES=test_stack.c
-test_stack_LDADD=$(THREADDLLIBS) ../src/libatomic_ops_gpl.a \
-       ../src/libatomic_ops.a
+test_stack_LDADD = $(THREADDLLIBS) \
+       $(top_builddir)/src/libatomic_ops_gpl.la \
+       $(top_builddir)/src/libatomic_ops.la
 
 test_malloc_SOURCES=test_malloc.c
-test_malloc_LDADD=$(THREADDLLIBS) ../src/libatomic_ops_gpl.a \
-       ../src/libatomic_ops.a
+test_malloc_LDADD = $(THREADDLLIBS) \
+       $(top_builddir)/src/libatomic_ops_gpl.la \
+       $(top_builddir)/src/libatomic_ops.la
 
 test_atomic_include.h: test_atomic_include.template
        sed -e s/XX// $? > $@