]> git.zarvox.org Git - crbtree.git/commitdiff
build: adjust to autotool standards
authorKay Sievers <kay@vrfy.org>
Sat, 9 Apr 2016 18:44:01 +0000 (20:44 +0200)
committerKay Sievers <kay@vrfy.org>
Sat, 9 Apr 2016 18:44:01 +0000 (20:44 +0200)
https://github.com/bus1/cvariant/commit/9d645c5506148e62483f2870ceb92853899553e6

.gitignore
Makefile.am
configure.ac

index e9b5e3bb84f3fa777ed4c423c87c26c14607e2e2..d6c94773e97ea97599e65270cc1daa0db352106e 100644 (file)
@@ -21,8 +21,8 @@
 /Makefile.in
 /install-tree
 
-/src/crbtree.pc
 /libcrbtree.so.0
+/src/crbtree.pc
 
 /test-api
 /test-basic
index b92aa40e164a982f1f7db43b5e32cb114d9ffe9c..2ba0c284ba1c34c775593c703cb5285f996c6cec 100644 (file)
@@ -41,42 +41,46 @@ AM_CFLAGS = $(OUR_CFLAGS)
 AM_LDFLAGS = $(OUR_LDFLAGS)
 
 # ------------------------------------------------------------------------------
-# libcrbtree.a
+# library archive
 
 noinst_LIBRARIES += \
        libcrbtree.a
 
-pkginclude_HEADERS += \
-       src/org.bus1/c-rbtree.h
-
 libcrbtree_a_SOURCES = \
        src/libcrbtree.sym \
        src/c-rbtree-private.h \
-       src/c-rbtree.c
+       src/c-rbtree.c \
+       src/org.bus1/c-rbtree.h
 
 # ------------------------------------------------------------------------------
-# libcrbtree.so.0
+# shared library built from archive
+
+all-local: libcrbtree.so.0
+
+pkginclude_HEADERS += \
+       src/org.bus1/c-rbtree.h
 
 libcrbtree.so.0: libcrbtree.a $(top_srcdir)/src/libcrbtree.sym
-       $(AM_V_CCLD)$(CCLD) $(AM_CFLAGS) $(AM_LDFLAGS) \
-       -shared \
+       $(AM_V_CCLD)$(LINK) -shared \
        -Wl,-soname=$@ \
        -Wl,--version-script=$(top_srcdir)/src/libcrbtree.sym \
-       -Wl,--whole-archive libcrbtree.a -Wl,--no-whole-archive \
-       -o $@
+       -Wl,--whole-archive libcrbtree.a -Wl,--no-whole-archive
 
 CLEANFILES += \
        libcrbtree.so.0
 
-all-local: libcrbtree.so.0
-
-install-exec-hook:
-       $(MKDIR_P) $(DESTDIR)$(libdir)
-       cp libcrbtree.so.0 $(DESTDIR)$(libdir)
-       $(AM_V_LN)ln -sf libcrbtree.so.0 $(DESTDIR)$(libdir)/libcrbtree.so
-
-uninstall-hook:
-       rm -f $(DESTDIR)$(libdir)/libcrbtree.so.0
+install-exec-local:
+       @echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+               $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1
+       @echo " $(INSTALL) libcrbtree.so.0 '$(DESTDIR)$(libdir)'"; \
+               $(INSTALL) libcrbtree.so.0 "$(DESTDIR)$(libdir)" || exit $$?
+       @echo " $(LN_S) -f libcrbtree.so.0 '$(DESTDIR)$(libdir)/libcrbtree.so'"; \
+               $(LN_S) -f libcrbtree.so.0 "$(DESTDIR)$(libdir)/libcrbtree.so" || exit $$?
+
+uninstall-local:
+       @test ! -d "$(DESTDIR)$(libdir)" || \
+               { echo " ( cd '$(DESTDIR)$(libdir)' && rm -f libcrbtree.so.0 )"; \
+                 rm -f "$(DESTDIR)$(libdir)/libcrbtree.so.0"; }
 
 %.pc: %.pc.in
        $(AM_V_GEN)$(SED) \
index 38e8c3d2b2639b6dcfe06ee056af43c09ce6f38b..0f61ce869803da1819458ed2bffafe31d448b46c 100644 (file)
@@ -16,8 +16,9 @@ AC_CONFIG_MACRO_DIR([build/m4])
 AC_CONFIG_HEADERS([build/config.h])
 AC_CONFIG_AUX_DIR([build/build-aux])
 
-# AC_PROG_CC sets default CFLAGS which conflict with our own configuration
+# suppress conflicting defaults
 CFLAGS=${CFLAGS:-""}
+CXXFLAGS=${CXXFLAGS:-""}
 
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
@@ -29,6 +30,7 @@ AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
 AC_PROG_CC_C99
 AC_PROG_RANLIB
 AC_PROG_SED
+AC_PROG_LN_S
 
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])