Browse Source

Move to autotools

master
Jeroen Vreeken 4 years ago
parent
commit
5b61611abb
6 changed files with 110 additions and 166 deletions
  1. +29
    -1
      .gitignore
  2. +0
    -67
      Makefile
  3. +51
    -0
      Makefile.am
  4. +6
    -0
      bootstrap
  5. +0
    -98
      build.mk
  6. +24
    -0
      configure.ac

+ 29
- 1
.gitignore View File

@ -1,6 +1,5 @@
*.pem
*.o
*.d
dmld
dml_httpd
dml_list
@ -8,3 +7,32 @@ dml_reflector
dml_streamer
dml_stream_client
dml_trx
# http://www.gnu.org/software/automake
Makefile.in
# http://www.gnu.org/software/autoconf
/Makefile
/Makefile.in
/autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.*
/configure
/configure.scan
/depcomp
/install-sh
/libtool
/ltmain.sh
/m4/
/missing
/stamp-h?
.deps/
.dirstamp
.libs/
*.l[ao]
*~

+ 0
- 67
Makefile View File

@ -1,67 +0,0 @@
include build.mk
CFLAGS += -g -Wall -Werror -O3
LDFLAGS += -lcrypto -lm
DML_SRCS = \
dml_client.c \
dml_config.c \
dml_connection.c \
dml_crypto.c \
dml_id.c \
dml_packet.c \
dml_poll.c \
dml_route.c \
dml_server.c \
dml_stream.c \
dml_stream_client_simple.c
TRX_SRCS = \
trx_dv.c
DML_OBJS = $(DML_SRCS:.c=.o)
TRX_OBJS = $(TRX_SRCS:.c=.o)
all: dmld dml_list dml_reflector dml_streamer dml_stream_client dml_trx dml_httpd
SRCS += $(DML_SRCS) $(TRX_SRCS)
SRCS += dmld.c
dmld: $(DML_OBJS) dmld.o
SRCS += dml_list.c
dml_list: $(DML_OBJS) dml_list.o
SRCS += dml_reflector.c alaw.c
dml_reflector_LDFLAGS += -lcodec2 -leth_ar
dml_reflector: $(DML_OBJS) $(TRX_OBJS) dml_reflector.o alaw.o
SRCS += dml_trx.c trx_sound.c alaw.c
dml_trx_LDFLAGS += -lasound -lcodec2 -leth_ar
dml_trx: $(DML_OBJS) $(TRX_OBJS) dml_trx.o alaw.o
SRCS += dml_streamer.c matroska.c ogg.c
dml_streamer: $(DML_OBJS) dml_streamer.o matroska.o ogg.o
SRCS += dml_stream_client.c
dml_stream_client: $(DML_OBJS) dml_stream_client.o
SRCS += dml_httpd.c
dml_httpd_LDFLAGS += -lwebsockets -lmagic
dml_httpd: $(DML_OBJS) dml_httpd.o
DEPS:=$(SRCS:.c=.d)
-include $(DEPS)
OBJS+=$(SRCS:.c=.o)
$(OBJS): Makefile
clean:
rm -rf $(OBJS) $(DEPS) \
dml_list \
dml_reflector \
dml_streamer \
dml_stream_client \
dml_trx

+ 51
- 0
Makefile.am View File

@ -0,0 +1,51 @@
ACLOCAL_AMFLAGS=-I m4
CFLAGS+= -Wall -Werror -O3
bin_PROGRAMS = dmld dml_list dml_reflector dml_streamer dml_stream_client dml_trx dml_httpd
DML_SRCS = \
dml_client.c \
dml_config.c \
dml_connection.c \
dml_crypto.c \
dml_id.c \
dml_packet.c \
dml_poll.c \
dml_route.c \
dml_server.c \
dml_stream.c \
dml_stream_client_simple.c
TRX_SRCS = \
trx_dv.c
dmld_SOURCES = $(DML_SRCS) dmld.c
dmld_LDFLAGS = -lcrypto
dml_list_SOURCES = $(DML_SRCS) dml_list.c
dml_list_LDFLAGS = -lcrypto
dml_reflector_SOURCES = $(DML_SRCS) $(TRX_SRCS) dml_reflector.c alaw.c
dml_reflector_LDFLAGS = -lcodec2 -leth_ar -lm -lcrypto
dml_trx_SOURCES = $(DML_SRCS) $(TRX_SRCS) dml_trx.c alaw.c
dml_trx_LDFLAGS = -lasound -lcodec2 -leth_ar -lcrypto
dml_streamer_SOURCES = $(DML_SRCS) dml_streamer.c matroska.c ogg.c
dml_streamer_LDFLAGS = -lcrypto
dml_stream_client_SOURCES = $(DML_SRCS) dml_stream_client.c
dml_stream_client_LDFLAGS = -lcrypto
dml_httpd_SOURCES = $(DML_SRCS) dml_httpd.c
dml_httpd_LDFLAGS = -lwebsockets -lmagic -lcrypto

+ 6
- 0
bootstrap View File

@ -0,0 +1,6 @@
#! /bin/sh
libtoolize \
&& aclocal \
&& automake --gnu --add-missing \
&& autoconf

+ 0
- 98
build.mk View File

@ -1,98 +0,0 @@
# Some make rules to make output pretty....
# default ARFLAGS also has 'v', but we don't want it to be verbose.
ARFLAGS= -r
# make sure libs from /usr/local/lib are found
VPATH= /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib
LIBTOOL=libtool
OS= $(shell uname -s)
HW= $(shell uname -m)
ifneq ($(OS), FreeBSD)
FLEX=flex
else
FLEX=/usr/local/bin/flex
endif
BUILDCC:=${CC}
BUILDLIBTOOL:=${LIBTOOL}
ifdef BUILDSYS
BUILDCC:=${BUILDSYS}-gcc
BUILDLIBTOOL:=${BUILDSYS}-libtool
endif
ifdef HOSTSYS
CC=${HOSTSYS}-gcc
LIBTOOL=${HOSTSYS}-libtool
CONF_HOST=--host=${HOSTSYS}
HW=$(HOSTSYS)
endif
%.o : %.c
@echo " CC $<"
@$(CC) -MMD $(CFLAGS) -c $< -o $@
%.o : %.il2c.c
@echo "LT CCil $<"
@${LIBTOOL} --quiet --mode=compile --tag=CC $(CC) -MMD $(CFLAGS) -c $< -o $@
@sed -e "s:\.il2c.c:\.il:" -i -i $*.il2c.d
%: %.o
@echo " LD $@"
@${LIBTOOL} --quiet --mode=link --tag=CC $(LINK.o) $(filter %.o,$^) $(LOADLIBS) $(LDLIBS) $($@_LDFLAGS) -o $@
%.lo: %.c
@echo "LT CC $<"
@${LIBTOOL} --quiet --mode=compile --tag=CC $(CC) -MMD $(CFLAGS) -c $< -o $@
@cat $(dir $*).libs/$(*F).d | sed -e "s:\.libs/::" -e "s:\.o:\.lo:" > $*.d
%.lo: %.il2c.c
@echo "LT ilCC $<"
@${LIBTOOL} --quiet --mode=compile --tag=CC $(CC) -MMD $(CFLAGS) -c $<
@cat $(dir $*).libs/$(*F).d | sed -e "s:\.libs/::" -e "s:\.o:\.lo:" -e "s:\.il2c.c:\.il:" > $*.d
define LIB_LINK
@echo "LT LD $@"
@${LIBTOOL} --quiet --mode=link --tag=CC $(CC) $(filter %.lo,$^) -o $@ $(LDFLAGS) $($@_LDFLAGS) -static-libtool-libs -rpath $(abspath $(@D))
@echo "LT INST $@"
@${LIBTOOL} --quiet --mode=install install $@ $(abspath $(@D))
@sed -i -i s\|=$(CURDIR)\|$(CURDIR)\|g $@
endef
%.so:
@echo "LT soLD $@"
@${LIBTOOL} --quiet --mode=link --tag=CC $(CC) $(filter %.lo,$^) -o $@ $(LDFLAGS) $($@_LDFLAGS)
(%): %
@echo " AR $^ in $@"
@$(AR) $(ARFLAGS) $@ $^
%.tab.c %.tab.h: %.y
@echo "BISON $<"
@bison --defines=$*.tab.h $< -o $*.tab.c
%.yy.c %.yy.h: %.l %.tab.h
@echo " FLEX $<"
@$(FLEX) --header-file=$*.yy.h -o $*.yy.c $<
# il2c: instruction list 2 c 'compiler'
%.il2c.c: %.il
@echo " IL2C $<"
@$(IL2C) $<
# dot -> pdf
%.pdf: %.dot
@echo " DOT $<"
@dot $< -o $@ -Tpdf
%.dtb: %.dts
@echo " DTC $<"
@dtc -I dts $< -O dtb -o $@
%.dtbo: %.dts
@echo " DTCo $<"
@dtc -I dts $< -O dtb -o $@

+ 24
- 0
configure.ac View File

@ -0,0 +1,24 @@
AC_INIT([dml], [0.0], [jeroen@vreeken.net], [https://video.vreeken.net/~dml/])
AM_INIT_AUTOMAKE([foreign dist-xz])
AM_SILENT_RULES([yes])
LT_INIT
AC_PROG_CC
AC_CONFIG_MACRO_DIR([m4])
dnl Search for libcodec2
AC_SEARCH_LIBS([freedv_set_data_header], [codec2], [], [
AC_MSG_ERROR([unable to find the freedv data channel functions in libcodec2])
])
AC_CHECK_HEADERS([codec2/codec2.h codec2/freedv_api.h],
[codec2_found_headers=yes; break;])
AS_IF([test "x$codec2_found_headers" != "xyes"],
[AC_MSG_ERROR([Unable to find the codec2 headers])])
AC_OUTPUT([Makefile])

Loading…
Cancel
Save