]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
Use AC_SEARCH_LIBS instead of hardcoded lists
[mirror_lxc.git] / src / lxc / Makefile.am
1 pkginclude_HEADERS = \
2 arguments.h \
3 start.h \
4 console.h \
5 error.h \
6 monitor.h \
7 utils.h \
8 namespace.h \
9 caps.h \
10 lxc.h \
11 cgroup.h \
12 conf.h \
13 list.h \
14 log.h \
15 state.h \
16 attach.h \
17 lxccontainer.h \
18 lxclock.h
19
20 if IS_BIONIC
21 pkginclude_HEADERS += \
22 ../include/openpty.h \
23 ../include/lxcmntent.h
24 endif
25
26 if !HAVE_GETLINE
27 if HAVE_FGETLN
28 pkginclude_HEADERS += ../include/getline.h
29 endif
30 endif
31
32 sodir=$(libdir)
33 # use PROGRAMS to avoid complains from automake
34 so_PROGRAMS = liblxc.so
35
36 liblxc_so_SOURCES = \
37 arguments.c arguments.h \
38 commands.c commands.h \
39 start.c start.h \
40 stop.c \
41 execute.c \
42 monitor.c monitor.h \
43 console.c \
44 freezer.c \
45 checkpoint.c \
46 restart.c \
47 error.h error.c \
48 parse.c parse.h \
49 cgroup.c cgroup.h \
50 lxc.h \
51 utils.c utils.h \
52 sync.c sync.h \
53 namespace.h namespace.c \
54 conf.c conf.h \
55 confile.c confile.h \
56 list.h \
57 state.c state.h \
58 log.c log.h \
59 attach.c attach.h \
60 \
61 network.c network.h \
62 nl.c nl.h \
63 rtnl.c rtnl.h \
64 genl.c genl.h \
65 \
66 caps.c caps.h \
67 lxcseccomp.h \
68 mainloop.c mainloop.h \
69 af_unix.c af_unix.h \
70 \
71 lxcutmp.c lxcutmp.h \
72 apparmor.c apparmor.h \
73 lxclock.h lxclock.c \
74 lxccontainer.c lxccontainer.h
75
76 if IS_BIONIC
77 liblxc_so_SOURCES += \
78 ../include/openpty.c ../include/openpty.h \
79 ../include/lxcmntent.c ../include/lxcmntent.h
80 endif
81
82 if !HAVE_GETLINE
83 if HAVE_FGETLN
84 liblxc_so_SOURCES += ../include/getline.c ../include/getline.h
85 endif
86 endif
87
88 AM_CFLAGS=-I$(top_srcdir)/src \
89 -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
90 -DLXCPATH=\"$(LXCPATH)\" \
91 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
92 -DLXCINITDIR=\"$(LXCINITDIR)\" \
93 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
94 -DLOGPATH=\"$(LOGPATH)\"
95
96 if ENABLE_APPARMOR
97 AM_CFLAGS += -DHAVE_APPARMOR
98 endif
99
100 if USE_CONFIGPATH_LOGS
101 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
102 endif
103
104 if ENABLE_SECCOMP
105 AM_CFLAGS += -DHAVE_SECCOMP
106 liblxc_so_SOURCES += seccomp.c
107 endif
108
109 liblxc_so_CFLAGS = -fPIC -DPIC $(AM_CFLAGS)
110
111 liblxc_so_LDFLAGS = \
112 -shared \
113 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,$(VERSION)))
114
115 liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
116
117 bin_SCRIPTS = \
118 lxc-ps \
119 lxc-netstat \
120 lxc-checkconfig \
121 lxc-version \
122 lxc-create \
123 lxc-clone \
124 lxc-shutdown \
125 lxc-destroy
126
127 EXTRA_DIST=
128 if ENABLE_PYTHON
129 EXTRA_DIST += lxc-device lxc-ls
130 bin_SCRIPTS += lxc-device
131 bin_SCRIPTS += lxc-ls
132 bin_SCRIPTS += lxc-start-ephemeral
133 else
134 bin_SCRIPTS += legacy/lxc-ls
135 endif
136
137 if ENABLE_LUA
138 EXTRA_DIST += lxc-top
139 bin_SCRIPTS += lxc-top
140 endif
141
142 bin_PROGRAMS = \
143 lxc-attach \
144 lxc-unshare \
145 lxc-stop \
146 lxc-start \
147 lxc-execute \
148 lxc-monitor \
149 lxc-wait \
150 lxc-console \
151 lxc-freeze \
152 lxc-info \
153 lxc-cgroup \
154 lxc-unfreeze \
155 lxc-checkpoint \
156 lxc-restart \
157 lxc-kill
158
159 pkglibexec_PROGRAMS = \
160 lxc-init
161
162 #pkglibexec_SCRIPTS = \
163 # lxc.functions
164
165 AM_LDFLAGS = -Wl,-E
166 if ENABLE_RPATH
167 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
168 endif
169 LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@
170
171 lxc_attach_SOURCES = lxc_attach.c
172 lxc_cgroup_SOURCES = lxc_cgroup.c
173 lxc_checkpoint_SOURCES = lxc_checkpoint.c
174 lxc_console_SOURCES = lxc_console.c
175 lxc_execute_SOURCES = lxc_execute.c
176 lxc_freeze_SOURCES = lxc_freeze.c
177 lxc_info_SOURCES = lxc_info.c
178 lxc_init_SOURCES = lxc_init.c
179 lxc_monitor_SOURCES = lxc_monitor.c
180 lxc_restart_SOURCES = lxc_restart.c
181 lxc_start_SOURCES = lxc_start.c
182 lxc_stop_SOURCES = lxc_stop.c
183 lxc_unfreeze_SOURCES = lxc_unfreeze.c
184 lxc_unshare_SOURCES = lxc_unshare.c
185 lxc_wait_SOURCES = lxc_wait.c
186 lxc_kill_SOURCES = lxc_kill.c
187
188 install-exec-local: install-soPROGRAMS
189 mkdir -p $(DESTDIR)$(datadir)/lxc
190 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
191 mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
192 /sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
193 cd $(DESTDIR)$(libdir); \
194 ln -sf liblxc.so.$(VERSION) liblxc.so.$(firstword $(subst ., ,$(VERSION))); \
195 ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
196
197 uninstall-local:
198 $(RM) $(DESTDIR)$(libdir)/liblxc.so*