blob: 80ee458b6d89e8521a267579595f54d415189a8a [file] [log] [blame]
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +01001# This is _NOT_ the library release version, it's an API version.
2# Please read chapter "Library interface versions" of the libtool documentation
3# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html
Pau Espin Pedrol5f15e412023-02-07 11:20:41 +01004LIBVERSION=20:0:0
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +01005
Pau Espin Pedrol88955fb2023-01-18 18:54:00 +01006AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir)
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +01007AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) $(LIBSCTP_CFLAGS) $(LIBMNL_CFLAGS)
8
9if ENABLE_PSEUDOTALLOC
10AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc
11endif
12
13lib_LTLIBRARIES = libosmocore.la
14
Pau Espin Pedrol1162a242023-01-18 17:28:17 +010015libosmocore_la_LIBADD = \
16 $(BACKTRACE_LIB) \
17 $(TALLOC_LIBS) \
18 $(LIBRARY_RT) \
19 $(PTHREAD_LIBS) \
20 $(LIBSCTP_LIBS) \
21 $(NULL)
22
23libosmocore_la_SOURCES = \
24 application.c \
25 backtrace.c \
26 base64.c \
27 bits.c \
28 bitvec.c \
29 bitcomp.c \
30 context.c \
31 conv.c \
32 conv_acc.c \
33 conv_acc_generic.c \
34 counter.c \
35 crc16.c \
36 crc8gen.c \
37 crc16gen.c \
38 crc32gen.c \
39 crc64gen.c \
40 exec.c \
41 fsm.c \
42 gsmtap_util.c \
43 isdnhdlc.c \
44 it_q.c \
45 logging.c \
46 logging_syslog.c \
47 logging_gsmtap.c \
48 loggingrb.c \
49 macaddr.c \
50 msgb.c \
Pau Espin Pedrol9d0321d2023-01-24 17:33:06 +010051 netdev.c \
Pau Espin Pedrol8a5014b2023-01-19 16:54:47 +010052 netns.c \
Harald Welte8857f3b2022-11-18 13:54:44 +010053 osmo_io.c \
54 osmo_io_poll.c \
Pau Espin Pedrol1162a242023-01-18 17:28:17 +010055 panic.c \
56 prbs.c \
57 prim.c \
58 rate_ctr.c \
59 rbtree.c \
60 select.c \
61 sercomm.c \
62 signal.c \
63 sockaddr_str.c \
64 socket.c \
65 stat_item.c \
66 stats.c \
67 stats_statsd.c \
68 stats_tcp.c \
69 strrb.c \
70 tdef.c \
71 thread.c \
72 time_cc.c \
73 timer.c \
74 timer_gettimeofday.c \
75 timer_clockgettime.c \
Pau Espin Pedrol51e9dde2023-01-24 17:34:34 +010076 tun.c \
Pau Espin Pedrol1162a242023-01-18 17:28:17 +010077 use_count.c \
78 utils.c \
79 write_queue.c \
80 probes.d \
81 $(NULL)
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +010082
83if HAVE_SSSE3
84libosmocore_la_SOURCES += conv_acc_sse.c
85if HAVE_SSE4_1
86conv_acc_sse.lo : AM_CFLAGS += -mssse3 -msse4.1
87else
88conv_acc_sse.lo : AM_CFLAGS += -mssse3
89endif
90
91if HAVE_AVX2
92libosmocore_la_SOURCES += conv_acc_sse_avx.c
93if HAVE_SSE4_1
94conv_acc_sse_avx.lo : AM_CFLAGS += -mssse3 -mavx2 -msse4.1
95else
96conv_acc_sse_avx.lo : AM_CFLAGS += -mssse3 -mavx2
97endif
98endif
99endif
100
101if HAVE_NEON
102libosmocore_la_SOURCES += conv_acc_neon.c
103# conv_acc_neon.lo : AM_CFLAGS += -mfpu=neon no, could as well be vfp with neon
104endif
105
106BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
107
108EXTRA_DIST = \
109 conv_acc_sse_impl.h \
110 conv_acc_neon_impl.h \
111 crcXXgen.c.tpl \
Harald Welte8857f3b2022-11-18 13:54:44 +0100112 osmo_io_internal.h \
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +0100113 stat_item_internal.h \
Daniel Willmann213fc422023-02-03 07:44:55 +0100114 libosmocore.map \
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +0100115 $(NULL)
116
Harald Weltec9527762023-03-05 20:07:01 +0100117EXTRA_libosmocore_la_DEPENDENCIES = libosmocore.map
118
Daniel Willmann213fc422023-02-03 07:44:55 +0100119libosmocore_la_LDFLAGS = \
120 $(LTLDFLAGS_OSMOCORE) \
121 -version-info \
122 $(LIBVERSION) \
123 -no-undefined
Pau Espin Pedrold4c3dc82023-01-18 17:04:04 +0100124
125if ENABLE_PLUGIN
126libosmocore_la_SOURCES += plugin.c
127libosmocore_la_LIBADD += $(LIBRARY_DLOPEN)
128endif
129
130if ENABLE_MSGFILE
131libosmocore_la_SOURCES += msgfile.c
132endif
133
134if ENABLE_SERIAL
135libosmocore_la_SOURCES += serial.c
136endif
137
138if ENABLE_SYSTEMD_LOGGING
139libosmocore_la_SOURCES += logging_systemd.c
140libosmocore_la_LIBADD += $(SYSTEMD_LIBS)
141endif
142
143if ENABLE_LIBMNL
144libosmocore_la_SOURCES += mnl.c
145libosmocore_la_LIBADD += $(LIBMNL_LIBS)
146endif
147
148if ENABLE_SYSTEMTAP
149probes.h: probes.d
150 $(DTRACE) -C -h -s $< -o $@
151
152probes.lo: probes.d
153 $(LIBTOOL) --mode=compile $(AM_V_lt) --tag=CC env CFLAGS="$(CFLAGS)" $(DTRACE) -C -G -s $< -o $@
154
155BUILT_SOURCES += probes.h probes.lo
156libosmocore_la_LIBADD += probes.lo
157endif
158
159crc%gen.c: crcXXgen.c.tpl
160 $(AM_V_GEN)sed -e's/XX/$*/g' $< > $@