Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -14,11 +14,11 @@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ SHOBJEXT = @SHOBJEXT@ ARFLAGS = # @ARFLAGS@ AREXT = @AREXT@ PKGVERS = @PACKAGE_VERSION@ -PKGVERSMAJOR = `echo $(PKGVERS) | cut -f 1 -d .` +ABI_VERSION = @ABI_VERSION@ EXEEXT = @EXEEXT@ LIBS = @LIBS@ prefix = @prefix@ mandir = @mandir@ @@ -63,11 +63,13 @@ echo ' local:' >> '$@' echo ' *;' >> '$@' echo '};' >> '$@' test-lc$(EXEEXT): $(BINS) $(srcdir)/test-lc.c - $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,$(srcdir) -L$(srcdir) -lconfig + rm -f libconfig.$(SHOBJEXT).$(ABI_VERSION) + $(LN_S) libconfig.$(SHOBJEXT) libconfig.$(SHOBJEXT).$(ABI_VERSION) + $(CC) $(CPPFLAGS) $(CFLAGS) -I$(srcdir) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R,$(shell pwd) -L$(shell pwd) -lconfig install: all $(srcdir)/libconfig.h -$(INSTALL) -d "$(DESTDIR)$(mandir)" -$(INSTALL) -d "$(DESTDIR)$(mandir)/man3" -$(INSTALL) -d "$(DESTDIR)$(libdir)" @@ -85,18 +87,19 @@ $(INSTALL) -m 644 lc_geterrno.3 "$(DESTDIR)$(mandir)/man3/lc_geterrno.3" $(INSTALL) -m 644 lc_process.3 "$(DESTDIR)$(mandir)/man3/lc_process.3" $(INSTALL) -m 644 lc_cleanup.3 "$(DESTDIR)$(mandir)/man3/lc_cleanup.3" $(INSTALL) -m 644 libconfig.3 "$(DESTDIR)$(mandir)/man3/libconfig.3" $(INSTALL) -m 644 $(srcdir)/libconfig.h "$(DESTDIR)$(includedir)/libconfig.h" - -( cd "$(DESTDIR)$(libdir)" && rm -f libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) ) + -( cd "$(DESTDIR)$(libdir)" && rm -f libconfig.$(SHOBJEXT).$(ABI_VERSION) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT).$(ABI_VERSION) ) -( cd "$(DESTDIR)$(libdir)" && rm -f libconfig.$(SHOBJEXT) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT) ) clean: rm -f *.o $(BINS) *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll + rm -f libconfig.$(SHOBJEXT).$(ABI_VERSION) distclean: clean rm -f Makefile config.h config.status config.log lc_geterrno.3 lc_process.3 lc_cleanup.3 lc_process_file.3 lc_register_var.3 lc_geterrstr.3 lc_register_callback.3 libconfig.3 libconfig.syms mrproper: distclean rm -f aclocal.m4 config.guess config.sub install-sh configure .PHONY: all clean distclean install Index: aclocal/shobj.m4 ================================================================== --- aclocal/shobj.m4 +++ aclocal/shobj.m4 @@ -184,11 +184,16 @@ break fi LDFLAGS="${LDFLAGS} ${try}" AC_TRY_LINK([void TestTest(void) { return; }], [], [ + LDFLAGS="${SAVE_LDFLAGS}" + SHOBJLDFLAGS="${SHOBJLDFLAGS} ${try}" + AC_MSG_RESULT([$try]) break ]) done + + AC_SUBST(SHOBJLDFLAGS) ]) Index: aclocal/versionscript.m4 ================================================================== --- aclocal/versionscript.m4 +++ aclocal/versionscript.m4 @@ -33,18 +33,22 @@ ]) done rm -f "${TMPSYMFILE}" rm -f "${TMPVERSIONSCRIPT}" + + LDFLAGS="${SAVE_LDFLAGS}" if test -n "${addldflags}"; then - LDFLAGS="${SAVE_LDFLAGS} ${addldflags}" + SHOBJLDFLAGS="${SHOBJLDFLAGS} ${addldflags}" + AC_MSG_RESULT($addldflags) else - LDFLAGS="${SAVE_LDFLAGS}" AC_MSG_RESULT([don't know]) fi + + AC_SUBST(SHOBJLDFLAGS) ]) AC_DEFUN([DC_FIND_STRIP_AND_REMOVESYMS], [ SYMFILE="$1" Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -44,11 +44,13 @@ dnl Setup stable API DC_SETUP_STABLE_API([${srcdir}/libconfig.vers], libconfig.syms) dnl Set a soname -SHOBJ_SET_SONAME([libconfig.$SHOBJEXT.$PACKAGE_VERSION]) +ABI_VERSION='0' +SHOBJ_SET_SONAME([libconfig.$SHOBJEXT.$ABI_VERSION]) +AC_SUBST(ABI_VERSION) dnl This MUST be last. DC_SYNC_SHLIBOBJS AC_OUTPUT(Makefile lc_geterrno.3 lc_process.3 lc_register_var.3 lc_geterrstr.3 lc_seterrstr.3 lc_register_callback.3 lc_cleanup.3 lc_process_file.3 libconfig.3 lc_handle_type.3 libconfig.syms) Index: test-lc.c ================================================================== --- test-lc.c +++ test-lc.c @@ -46,11 +46,11 @@ lc_register_var("long", LC_VAR_BOOL_BY_EXISTANCE, &onoff2, 'l'); lc_register_var("ipaddr", LC_VAR_IP, &ipaddr, 'i'); lc_register_callback("sally", 0, LC_VAR_STRING, sally_cmd, NULL); lc_register_callback("HELP", 'h', LC_VAR_NONE, help_cmd, NULL); lc_register_callback("*.ifmodule", 0, LC_VAR_NONE, cmd_ifmodule, NULL); - lcpret = lc_process_file("testapp", "build/test.conf", LC_CONF_APACHE); + lcpret = lc_process_file("testapp", "test.conf", LC_CONF_APACHE); if (lcpret < 0) { fprintf(stderr, "Error processing config file: %s\n", lc_geterrstr()); return(EXIT_FAILURE); }