Check-in [3a41ad49f2]
Overview
Comment:Added symbol versions and updated to set soname correctly if possible
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3a41ad49f23730c3165f99b8f3ea3a4241888614
User & Date: rkeene on 2014-11-24 18:54:12
Other Links: manifest | tags
Context
2014-11-24
18:55
Updated to use shared object extension correctly in soname check-in: d516625f90 user: rkeene tags: trunk
18:54
Added symbol versions and updated to set soname correctly if possible check-in: 3a41ad49f2 user: rkeene tags: trunk
18:23
Added more authors check-in: 6389f923c5 user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [1dd559b6be] to [7e1489e3be].

    23     23   libconfig.dll
    24     24   libconfig.dll.a
    25     25   libconfig.dll.def
    26     26   libconfig.so
    27     27   test-lc
    28     28   test-lc.exe
    29     29   test.cfg
           30  +libconfig.vers
           31  +libconfig.syms

Modified Makefile.in from [804405b696] to [3788187186].

    32     32   LIBS = libconfig.$(AREXT) libconfig.$(SHOBJEXT)
    33     33   BINS =
    34     34   # The following two lines need to be kept syncronised.
    35     35   OBJS = libconfig.o conf_space.o conf_section.o conf_apache.o conf_colon.o conf_equal.o conf_xml.o @LIBOBJS@
    36     36   SHOBJS = libconfig_shr.o conf_space_shr.o conf_section_shr.o conf_apache_shr.o conf_colon_shr.o conf_equal_shr.o conf_xml_shr.o @SHLIBOBJS@
    37     37   
    38     38   all: $(LIBS) $(BINS)
    39         -libconfig.$(SHOBJEXT): $(SHOBJS)
    40         -	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $^ $(LDFLAGS)
           39  +
           40  +libconfig.$(SHOBJEXT): $(SHOBJS) libconfig.vers libconfig.syms
           41  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $(SHOBJS) $(LDFLAGS)
           42  +	-@WEAKENSYMS@ libconfig.$(SHOBJEXT)
           43  +	-@REMOVESYMS@ libconfig.$(SHOBJEXT)
    41     44   
    42     45   libconfig.$(AREXT): $(OBJS)
    43         -	$(AR) rcu $@ $^
           46  +	$(AR) rcu $@ $(OBJS)
    44     47   	-$(RANLIB) $@
    45     48   
    46     49   libconfig.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h libconfig.h
    47     50   libconfig_shr.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h libconfig.h
    48     51   
    49     52   %_shr.o: $(srcdir)/%.c
    50     53   	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -c -o $@ "$(filter %.c, $^)"
    51     54   
    52     55   %.o: $(srcdir)/%.c
    53     56   	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ "$(filter %.c, $^)"
           57  +
           58  +libconfig.vers: libconfig.syms.in
           59  +	rm -f libconfig.vers
           60  +	echo 'LIBCONFIG_0.3.0 {' > '$@'
           61  +	echo '	global:' >> '$@'
           62  +	cat libconfig.syms.in | sed 's/^@SYMPREFIX@//;s/^/		/;s/$$/;/' >> '$@'
           63  +	echo '	local:' >> '$@'
           64  +	echo '		*;' >> '$@'
           65  +	echo '};' >> '$@'
    54     66   
    55     67   test-lc$(EXEEXT): $(LIBS) $(srcdir)/test-lc.c
    56     68   	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,. -L. -lconfig
    57     69   
    58     70   install: all libconfig.h
    59     71   	-$(INSTALL) -d "$(mandir)"
    60     72   	-$(INSTALL) -d "$(mandir)/man3"
................................................................................
    78     90   	-( cd "$(libdir)" && rm -f libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) )
    79     91   	-( cd "$(libdir)" && rm -f libconfig.$(SHOBJEXT) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT) )
    80     92   
    81     93   clean:
    82     94   	rm -f *.o $(BINS) $(LIBS) *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll
    83     95   
    84     96   distclean: clean
    85         -	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
           97  +	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
    86     98   
    87     99   mrproper: distclean
    88    100   	rm -f aclocal.m4 config.guess config.sub install-sh configure
    89    101   
    90    102   .PHONY: all clean distclean install

Modified aclocal/libconfig.m4 from [d46c22e181] to [35c3537925].

    46     46   	if test $SMALL = 0; then
    47     47   		dnl Use opennet if it's available AND not small
    48     48   		DC_ASK_OPTLIB(opennet, fopen_net, opennet.h, [      Enable opennet support (auto)], libopennet, HAVE_LIBOPENNET, HAVE_OPENNET_H)
    49     49   	else
    50     50   		AC_DEFINE(ENABLE_SMALL, [1], [Define to 1 if you want to produce a minimalistic build.])
    51     51   	fi
    52     52   ])
           53  +
           54  +AC_DEFUN(LC_SET_SONAME, [
           55  +	SAVE_LDFLAGS="$LDFLAGS"
           56  +
           57  +	AC_MSG_CHECKING([how to specify soname])
           58  +
           59  +	for try in "-Wl,--soname,$1" '__fail__'; do
           60  +		LDFLAGS="$SAVE_LDFLAGS"
           61  +
           62  +		if test "${try}" = '__fail__'; then
           63  +			AC_MSG_RESULT([can't])
           64  +
           65  +			break
           66  +		fi
           67  +
           68  +		LDFLAGS="${LDFLAGS} ${try}"
           69  +		AC_TRY_LINK([void TestTest(void) { return; }], [], [
           70  +			AC_MSG_RESULT([$try])
           71  +
           72  +			break
           73  +		])
           74  +	done
           75  +])

Modified build/prep.sh from [be7bb3d1c2] to [317dfaf547].

    20     20   
    21     21   aclocal -I aclocal
    22     22   autoconf
    23     23   automake -fca
    24     24   
    25     25   rm -rf autom4te.cache
    26     26   
           27  +rm -f libconfig.vers
           28  +make -f Makefile.in libconfig.vers
           29  +
    27     30   # Add Linux/MUSL support if missing
    28     31   if ! grep '[-]musl' config.sub >/dev/null 2>/dev/null; then
    29     32   	sed 's@\(-*\)linux-gnu\* @\1linux-musl | &@g' config.sub > config.sub.new
    30     33   	cat config.sub.new > config.sub
    31     34   	rm -f config.sub.new
    32     35   fi

Modified configure.ac from [10d96ac7ab] to [23d52dd695].

    35     35   AC_CHECK_HEADERS(ctype.h dirent.h pwd.h stdio.h stdlib.h string.h sys/stat.h sys/time.h sys/types.h time.h unistd.h netdb.h netinet/in.h)
    36     36   
    37     37   AC_HEADER_TIME
    38     38   
    39     39   AC_REPLACE_FUNCS(strsep strtoll getuid)
    40     40   AC_CHECK_FUNCS(getpwuid strtof)
    41     41   
           42  +dnl Setup stable API
           43  +DC_SETUP_STABLE_API(libconfig.vers, libconfig.syms)
           44  +
           45  +dnl Set a soname
           46  +LC_SET_SONAME([libconfig.so.$PACKAGE_VERSION])
           47  +
    42     48   dnl This MUST be last.
    43     49   DC_SYNC_SHLIBOBJS
    44     50   
    45         -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)
           51  +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)

Added libconfig.syms.in version [160176fe5f].

            1  +@SYMPREFIX@lc_cleanup
            2  +@SYMPREFIX@lc_geterrno
            3  +@SYMPREFIX@lc_geterrstr
            4  +@SYMPREFIX@lc_handle_type
            5  +@SYMPREFIX@lc_process
            6  +@SYMPREFIX@lc_process_conf_apache
            7  +@SYMPREFIX@lc_process_conf_colon
            8  +@SYMPREFIX@lc_process_conf_equal
            9  +@SYMPREFIX@lc_process_conf_section
           10  +@SYMPREFIX@lc_process_conf_space
           11  +@SYMPREFIX@lc_process_conf_xml
           12  +@SYMPREFIX@lc_process_file
           13  +@SYMPREFIX@lc_process_var
           14  +@SYMPREFIX@lc_register_callback
           15  +@SYMPREFIX@lc_register_var
           16  +@SYMPREFIX@lc_seterrstr
           17  +@SYMPREFIX@lc_err_usererrmsg
           18  +@SYMPREFIX@lc_errfile
           19  +@SYMPREFIX@lc_errline
           20  +@SYMPREFIX@lc_errno
           21  +@SYMPREFIX@lc_optind