Merge lp:~jamesodhunt/upstart/fix-libupstart into lp:upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1501
Proposed branch: lp:~jamesodhunt/upstart/fix-libupstart
Merge into: lp:upstart
Diff against target: 190 lines (+55/-15)
6 files modified
ChangeLog (+18/-0)
Makefile.am (+1/-1)
configure.ac (+1/-1)
lib/Makefile.am (+31/-8)
lib/tests/test_libupstart.c (+0/-2)
lib/upstart.h (+4/-3)
To merge this branch: bzr merge lp:~jamesodhunt/upstart/fix-libupstart
Reviewer Review Type Date Requested Status
James Hunt Needs Resubmitting
Dimitri John Ledkov Needs Fixing
Review via email: mp+172371@code.launchpad.net

Description of the change

* lib/Makefile.am:
  - Install client library headers.
  - Add missing backslash.
* lib/upstart.h: Look in upstart/ sub-directory for auto-generated
  header files.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

* Remove ; at the end of rule "cp $< $@;" for aesthetic reasons =)
* upstart-dbus.h should be added to BUILT_SOURCES variable
* Fails to compile:

make[3]: Entering directory `/home/xnox/canonical/upstart/upstart/lib'
  CC test_libupstart.o
In file included from tests/test_libupstart.c:37:0:
./upstart.h:27:34: fatal error: upstart/upstart-dbus.h: No such file or directory
 #include "upstart/upstart-dbus.h"
                                  ^
compilation terminated.
make[3]: *** [test_libupstart.o] Error 1

review: Needs Fixing
1499. By James Hunt

* lib/Makefile.am: Make nih-dbus-tool generate code into the upstart/
  directory as we need it there to allow the tests to run against a simulated
  installed header directory.
* lib/tests/test_libupstart.c: Remove unecessary include (which is now
  included automatically by upstart.h).

1500. By James Hunt

* lib/Makefile.am: Replace upstart/ directory target with mkdir calls
  (as 'make distcheck' fails due to directory being created in the
   directory above _build/).

Revision history for this message
James Hunt (jamesodhunt) wrote :

Ok, 'make distcheck' is now happy.

review: Needs Resubmitting
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

autoreconf -f -i; ./configure; make distcheck
...
make[4]: Entering directory `/home/xnox/canonical/upstart/upstart/upstart-1.10/_build/lib'
  CC com.ubuntu.Upstart.lo
  CC com.ubuntu.Upstart.Job.lo
  CC com.ubuntu.Upstart.Instance.lo
  CCLD libupstart.la

*** Warning: Linking the shared library libupstart.la against the
*** static library ../intl/libintl.a is not portable!
/usr/bin/ld.bfd.real: ../intl/libintl.a(bindtextdom.o): relocation R_X86_64_32 against `libintl_nl_default_dirname' can not be used when making a shared object; recompile with -fPIC
../intl/libintl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[4]: *** [libupstart.la] Error 1
make[4]: Leaving directory `/home/xnox/canonical/upstart/upstart/upstart-1.10/_build/lib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/xnox/canonical/upstart/upstart/upstart-1.10/_build/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/xnox/canonical/upstart/upstart/upstart-1.10/_build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/xnox/canonical/upstart/upstart/upstart-1.10/_build'
make: *** [distcheck] Error 1

review: Needs Fixing
Revision history for this message
James Hunt (jamesodhunt) wrote :

This error appears to be a 64-bit-specific linker issue.

Revision history for this message
James Hunt (jamesodhunt) wrote :

Verbose log:

Making all in lib
make[2]: Entering directory `/home/james/upstart/fix-libupstart/upstart-1.10/_build/lib'
make all-am
make[3]: Entering directory `/home/james/upstart/fix-libupstart/upstart-1.10/_build/lib'
/bin/bash ../libtool --tag=CC --mode=link gcc -std=gnu99 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -g -O2 -version-info 1:0:0 -Wl,--version-script=../../lib/libupstart.ver -lnih -lnih-dbus -ldbus-1 -lrt -o libupstart.la -rpath /home/james/upstart/fix-libupstart/upstart-1.10/_inst/lib com.ubuntu.Upstart.lo com.ubuntu.Upstart.Job.lo com.ubuntu.Upstart.Instance.lo ../intl/libintl.a -lnih -lnih-dbus -ldbus-1 -lrt

*** Warning: Linking the shared library libupstart.la against the
*** static library ../intl/libintl.a is not portable!
libtool: link: gcc -shared -fPIC -DPIC .libs/com.ubuntu.Upstart.o .libs/com.ubuntu.Upstart.Job.o .libs/com.ubuntu.Upstart.Instance.o ../intl/libintl.a -lnih -lnih-dbus -ldbus-1 -lrt -O2 -Wl,--version-script=../../lib/libupstart.ver -Wl,-soname -Wl,libupstart.so.1 -o .libs/libupstart.so.1.0.0
/usr/bin/ld: ../intl/libintl.a(bindtextdom.o): relocation R_X86_64_32 against `libintl_nl_default_dirname' can not be used when making a shared object; recompile with -fPIC
../intl/libintl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [libupstart.la] Error 1
make[3]: Leaving directory `/home/james/upstart/fix-libupstart/upstart-1.10/_build/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/james/upstart/fix-libupstart/upstart-1.10/_build/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/james/upstart/fix-libupstart/upstart-1.10/_build'
make: *** [all] Error 2

Revision history for this message
James Hunt (jamesodhunt) wrote :

Comparing the generated lib/Makefile on 32-bit and 64-bit systems both running Ubuntu saucy with the same versions of autoconf and automake, the difference seems to relate to BUILD_INCLUDED_LIBINTL and USE_INCLUDED_LIBINTL being set to 'yes' on the 64-bit system, but to 'no' on the 32-bit one.

On the 64-bit system, having BUILD_INCLUDED_LIBINTL and USE_INCLUDED_LIBINTL set causes the following to also be set:

INTLLIBS = ${top_builddir}/intl/libintl.a
LIBINTL = ${top_builddir}/intl/libintl.a
LTLIBINTL = ${top_builddir}/intl/libintl.a

1501. By James Hunt

* Makefile.am: Remove intl directory.
* configure.ac: Use external gettext library.

Revision history for this message
James Hunt (jamesodhunt) wrote :

The solution proposed by cjwatson to use an external gettext library seems like the best for now.

1502. By James Hunt

Sync with lp:upstart.

Revision history for this message
James Hunt (jamesodhunt) wrote :

Resynced with trunk.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-07-03 08:26:23 +0000
3+++ ChangeLog 2013-07-03 12:39:26 +0000
4@@ -6,6 +6,24 @@
5 - Check nih_str_split() return.
6 - Only attempt to extract PID from UPSTART_SESSION
7 in user mode (LP: #1197225).
8+ * Makefile.am: Remove intl directory.
9+ * configure.ac: Use external gettext library.
10+
11+2013-07-02 James Hunt <james.hunt@ubuntu.com>
12+
13+ * lib/Makefile.am: Make nih-dbus-tool generate code into the
14+ upstart/ directory as we need it there to allow the tests to run
15+ against a simulated installed header directory.
16+ * lib/tests/test_libupstart.c: Remove unecessary include (which
17+ is now included automatically by upstart.h).
18+
19+2013-07-01 James Hunt <james.hunt@ubuntu.com>
20+
21+ * lib/Makefile.am:
22+ - Install client library headers.
23+ - Add missing backslash.
24+ * lib/upstart.h: Look in upstart/ sub-directory for
25+ auto-generated header files.
26
27 2013-06-28 James Hunt <james.hunt@ubuntu.com>
28
29
30=== modified file 'Makefile.am'
31--- Makefile.am 2013-06-26 09:43:16 +0000
32+++ Makefile.am 2013-07-03 12:39:26 +0000
33@@ -1,6 +1,6 @@
34 ## Process this file with automake to produce Makefile.in
35
36-SUBDIRS = test intl dbus init util extra lib conf doc contrib po scripts
37+SUBDIRS = test dbus init util extra lib conf doc contrib po scripts
38
39 EXTRA_DIST = HACKING
40
41
42=== modified file 'configure.ac'
43--- configure.ac 2013-06-28 13:30:44 +0000
44+++ configure.ac 2013-07-03 12:39:26 +0000
45@@ -16,7 +16,7 @@
46 LT_INIT
47
48 AM_GNU_GETTEXT_VERSION([0.17])
49-AM_GNU_GETTEXT()
50+AM_GNU_GETTEXT([external])
51
52 # Checks for programs.
53 AC_PROG_CC
54
55=== modified file 'lib/Makefile.am'
56--- lib/Makefile.am 2013-06-27 10:16:35 +0000
57+++ lib/Makefile.am 2013-07-03 12:39:26 +0000
58@@ -23,12 +23,30 @@
59
60 # The library is built from the autogenerated code.
61 libupstart_la_SOURCES = upstart.h
62+include_HEADERS = $(libupstart_la_SOURCES)
63+
64+upstartincludedir = $(includedir)/upstart
65+
66+upstartinclude_HEADERS = \
67+ upstart/com.ubuntu.Upstart.h \
68+ upstart/com.ubuntu.Upstart.Instance.h \
69+ upstart/com.ubuntu.Upstart.Job.h \
70+ upstart/upstart-dbus.h
71+
72+
73+upstart/upstart-dbus.h: \
74+ $(top_srcdir)/dbus/upstart.h \
75+ upstart/com.ubuntu.Upstart.h \
76+ upstart/com.ubuntu.Upstart.Instance.h \
77+ upstart/com.ubuntu.Upstart.Job.h
78+ cp $< $@
79+
80 nodist_libupstart_la_SOURCES = \
81 $(com_ubuntu_Upstart_OUTPUTS) \
82 $(com_ubuntu_Upstart_Job_OUTPUTS) \
83 $(com_ubuntu_Upstart_Instance_OUTPUTS)
84
85-libupstart_la_LIBADD =
86+libupstart_la_LIBADD = \
87 $(LTLIBINTL) \
88 $(NIH_LIBS) \
89 $(NIH_DBUS_LIBS) \
90@@ -86,8 +104,8 @@
91 -lrt
92
93 com_ubuntu_Upstart_OUTPUTS = \
94- com.ubuntu.Upstart.c \
95- com.ubuntu.Upstart.h
96+ upstart/com.ubuntu.Upstart.c \
97+ upstart/com.ubuntu.Upstart.h
98
99 com_ubuntu_Upstart_XML = \
100 ../dbus/com.ubuntu.Upstart.xml
101@@ -95,6 +113,7 @@
102 # XXX: We have to use proxy mode for clients
103 # XXX: (meaning we cannot use the library for init itself)
104 $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML)
105+ mkdir -p upstart
106 $(AM_V_GEN)$(NIH_DBUS_TOOL) \
107 --package=$(PACKAGE) \
108 --mode=proxy --prefix=upstart \
109@@ -102,13 +121,14 @@
110 --output=$@ $<
111
112 com_ubuntu_Upstart_Job_OUTPUTS = \
113- com.ubuntu.Upstart.Job.c \
114- com.ubuntu.Upstart.Job.h
115+ upstart/com.ubuntu.Upstart.Job.c \
116+ upstart/com.ubuntu.Upstart.Job.h
117
118 com_ubuntu_Upstart_Job_XML = \
119 ../dbus/com.ubuntu.Upstart.Job.xml
120
121 $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML)
122+ mkdir -p upstart
123 $(AM_V_GEN)$(NIH_DBUS_TOOL) \
124 --package=$(PACKAGE) \
125 --mode=proxy --prefix=job_class \
126@@ -116,13 +136,14 @@
127 --output=$@ $<
128
129 com_ubuntu_Upstart_Instance_OUTPUTS = \
130- com.ubuntu.Upstart.Instance.c \
131- com.ubuntu.Upstart.Instance.h
132+ upstart/com.ubuntu.Upstart.Instance.c \
133+ upstart/com.ubuntu.Upstart.Instance.h
134
135 com_ubuntu_Upstart_Instance_XML = \
136 ../dbus/com.ubuntu.Upstart.Instance.xml
137
138 $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML)
139+ mkdir -p upstart
140 $(AM_V_GEN)$(NIH_DBUS_TOOL) \
141 --package=$(PACKAGE) \
142 --mode=proxy --prefix=job \
143@@ -134,7 +155,8 @@
144 BUILT_SOURCES = \
145 $(com_ubuntu_Upstart_OUTPUTS) \
146 $(com_ubuntu_Upstart_Job_OUTPUTS) \
147- $(com_ubuntu_Upstart_Instance_OUTPUTS)
148+ $(com_ubuntu_Upstart_Instance_OUTPUTS) \
149+ upstart/upstart-dbus.h
150
151 CLEANFILES = \
152 $(com_ubuntu_Upstart_OUTPUTS) \
153@@ -149,6 +171,7 @@
154
155 clean-local:
156 rm -f *.gcno *.gcda
157+ rm -rf upstart/
158
159 maintainer-clean-local:
160 rm -f *.gcov
161
162=== modified file 'lib/tests/test_libupstart.c'
163--- lib/tests/test_libupstart.c 2013-06-27 15:14:30 +0000
164+++ lib/tests/test_libupstart.c 2013-07-03 12:39:26 +0000
165@@ -32,8 +32,6 @@
166 #include <nih-dbus/errors.h>
167 #include <nih-dbus/dbus_connection.h>
168
169-#include "dbus/upstart.h"
170-
171 #include "upstart.h"
172 #include "test_util_common.h"
173
174
175=== modified file 'lib/upstart.h'
176--- lib/upstart.h 2013-05-22 11:11:00 +0000
177+++ lib/upstart.h 2013-07-03 12:39:26 +0000
178@@ -24,9 +24,10 @@
179
180 NIH_BEGIN_EXTERN
181
182-#include "com.ubuntu.Upstart.h"
183-#include "com.ubuntu.Upstart.Instance.h"
184-#include "com.ubuntu.Upstart.Job.h"
185+#include "upstart/upstart-dbus.h"
186+#include "upstart/com.ubuntu.Upstart.h"
187+#include "upstart/com.ubuntu.Upstart.Instance.h"
188+#include "upstart/com.ubuntu.Upstart.Job.h"
189
190 NIH_END_EXTERN
191

Subscribers

People subscribed via source and target branches