Check-in [adc5ae917e]
Overview
Comment:Updated to correctly handle out-of-directory builds
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: adc5ae917e7b23d0451b61fa1b3e4215ee344d79
User & Date: rkeene on 2014-11-24 19:14:15
Other Links: manifest | tags
Context
2014-11-24
19:16
libconfig 0.3.0 check-in: 60ed8780ab user: rkeene tags: trunk
19:14
Updated to correctly handle out-of-directory builds check-in: adc5ae917e user: rkeene tags: trunk
19:05
Added DESTDIR support check-in: 2c61bc2285 user: rkeene tags: trunk
Changes

Modified Makefile.in from [d0ff1229aa] to [b1254947ba].

33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50


51
52
53
54
55
56
57
58
59


60
61
62

63
64
65
66
67
68

69
70

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98
99
100
101
102
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48


49
50
51
52
53
54
55
56
57


58
59
60
61

62
63
64
65
66
67

68
69

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96
97
98
99
100
101
102







-
+








-
-
+
+







-
-
+
+


-
+





-
+

-
+


















-
+













BINS =
# The following two lines need to be kept syncronised.
OBJS = libconfig.o conf_space.o conf_section.o conf_apache.o conf_colon.o conf_equal.o conf_xml.o @LIBOBJS@
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@

all: $(LIBS) $(BINS)

libconfig.$(SHOBJEXT): $(SHOBJS) libconfig.vers libconfig.syms
libconfig.$(SHOBJEXT): $(SHOBJS) $(srcdir)/libconfig.vers libconfig.syms
	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $(SHOBJS) $(LDFLAGS)
	-@WEAKENSYMS@ libconfig.$(SHOBJEXT)
	-@REMOVESYMS@ libconfig.$(SHOBJEXT)

libconfig.$(AREXT): $(OBJS)
	$(AR) rcu $@ $(OBJS)
	-$(RANLIB) $@

libconfig.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h libconfig.h
libconfig_shr.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h libconfig.h
libconfig.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h $(srcdir)/libconfig.h
libconfig_shr.o: $(srcdir)/libconfig.c $(srcdir)/compat.h $(srcdir)/win32.h $(srcdir)/config.h $(srcdir)/libconfig.h

%_shr.o: $(srcdir)/%.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -c -o $@ "$(filter %.c, $^)"

%.o: $(srcdir)/%.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ "$(filter %.c, $^)"

libconfig.vers: libconfig.syms.in
	rm -f libconfig.vers
$(srcdir)/libconfig.vers: $(srcdir)/libconfig.syms.in
	rm -f $(srcdir)/libconfig.vers
	echo 'LIBCONFIG_0.3.0 {' > '$@'
	echo '	global:' >> '$@'
	cat libconfig.syms.in | sed 's/^@SYMPREFIX@//;s/^/		/;s/$$/;/' >> '$@'
	cat '$(srcdir)/libconfig.syms.in' | sed 's/^@''SYMPREFIX@//;s/^/		/;s/$$/;/' >> '$@'
	echo '	local:' >> '$@'
	echo '		*;' >> '$@'
	echo '};' >> '$@'

test-lc$(EXEEXT): $(LIBS) $(srcdir)/test-lc.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,. -L. -lconfig
	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,$(srcdir) -L$(srcdir) -lconfig

install: all libconfig.h
install: all $(srcdir)/libconfig.h
	-$(INSTALL) -d "$(DESTDIR)$(mandir)"
	-$(INSTALL) -d "$(DESTDIR)$(mandir)/man3"
	-$(INSTALL) -d "$(DESTDIR)$(libdir)"
	-$(INSTALL) -d "$(DESTDIR)$(includedir)"
	-$(INSTALL) -m 644 libconfig.$(SHOBJEXT).def "$(DESTDIR)$(libdir)/libconfig.def"
	-$(INSTALL) -m 644 libconfig.$(SHOBJEXT).a "$(DESTDIR)$(libdir)/libconfig.lib"
	$(INSTALL) -m 755 libconfig.$(SHOBJEXT) "$(DESTDIR)$(libdir)/libconfig.$(SHOBJEXT).$(PKGVERS)"
	$(INSTALL) -m 644 libconfig.$(AREXT) "$(DESTDIR)$(libdir)/libconfig.$(AREXT)"
	$(INSTALL) -m 644 lc_register_callback.3 "$(DESTDIR)$(mandir)/man3/lc_register_callback.3"
	$(INSTALL) -m 644 lc_register_var.3 "$(DESTDIR)$(mandir)/man3/lc_register_var.3"
	$(INSTALL) -m 644 lc_process_file.3 "$(DESTDIR)$(mandir)/man3/lc_process_file.3"
	$(INSTALL) -m 644 lc_handle_type.3 "$(DESTDIR)$(mandir)/man3/lc_handle_type.3"
	$(INSTALL) -m 644 lc_geterrstr.3 "$(DESTDIR)$(mandir)/man3/lc_geterrstr.3"
	$(INSTALL) -m 644 lc_seterrstr.3 "$(DESTDIR)$(mandir)/man3/lc_seterrstr.3"
	$(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 libconfig.h "$(DESTDIR)$(includedir)/libconfig.h"
	$(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) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT) )

clean:
	rm -f *.o $(BINS) $(LIBS) *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll

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

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

21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+







aclocal -I aclocal
autoconf
automake -fca

rm -rf autom4te.cache

rm -f libconfig.vers
make -f Makefile.in libconfig.vers
make srcdir=. -f Makefile.in ./libconfig.vers

# Add Linux/MUSL support if missing
if ! grep '[-]musl' config.sub >/dev/null 2>/dev/null; then
	sed 's@\(-*\)linux-gnu\* @\1linux-musl | &@g' config.sub > config.sub.new
	cat config.sub.new > config.sub
	rm -f config.sub.new
fi

Modified configure.ac from [82bc168655] to [22b42621c8].

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50







-
+








AC_HEADER_TIME

AC_REPLACE_FUNCS(strsep strtoll getuid)
AC_CHECK_FUNCS(getpwuid strtof)

dnl Setup stable API
DC_SETUP_STABLE_API(libconfig.vers, libconfig.syms)
DC_SETUP_STABLE_API([${srcdir}/libconfig.vers], libconfig.syms)

dnl Set a soname
SHOBJ_SET_SONAME([libconfig.$SHOBJEXT.$PACKAGE_VERSION])

dnl This MUST be last.
DC_SYNC_SHLIBOBJS