src: use a custom Makefile

We are bound to one toolchain and most results of the
config-time checks were ignored anyway. This is more
concise and doesn't require a configuration step.

Cherry-picked from: 25bd9261ab
This commit is contained in:
Oneric 2022-04-04 19:02:45 +02:00 committed by Dmitry Lyzo
parent f8ea6aaafa
commit 6f3e5c322c
5 changed files with 26 additions and 56 deletions

13
.gitignore vendored
View File

@ -3,21 +3,8 @@ a.out.wasm
a.out.js.mem
a.out
a.wasm
src/.deps/
src/WebIDLGrammar.pkl
src/parser.out
src/Makefile
src/Makefile.in
src/aclocal.m4
src/autom4te.cache/
src/compile
src/config.log
src/config.status
src/configure
src/configure~
src/depcomp
src/install-sh
src/missing
lib/expat/xmlwf/xmlwf
dist
.libs/

View File

@ -255,21 +255,11 @@ OCTP_DEPS = \
$(DIST_DIR)/lib/libfontconfig.a \
$(DIST_DIR)/lib/libass.a
# Require a patch to fix some errors
src/SubOctpInterface.cpp: src/SubtitleOctopus.idl
cd src && \
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface
src/Makefile: src/SubOctpInterface.cpp
cd src && \
autoreconf -fi && \
EM_PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
emconfigure ./configure --host=x86-none-linux --build=x86_64 CFLAGS="$(GLOBAL_CFLAGS)"
src/subtitles-octopus-worker.bc: $(OCTP_DEPS) src/Makefile src/SubtitleOctopus.cpp src/SubOctpInterface.cpp
cd src && \
emmake make -j8 && \
mv subtitlesoctopus.bc subtitles-octopus-worker.bc
src/subtitles-octopus-worker.bc: $(OCTP_DEPS) all-src
.PHONY: all-src
all-src:
PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
$(MAKE) -C src all
# Dist Files
EMCC_COMMON_ARGS = \

21
src/Makefile Normal file
View File

@ -0,0 +1,21 @@
# If needed, override the following variables via `make VARNAME=VAL ...`
CXX = em++ -r
CXXFLAGS = -O3 -g4
LIBASS_CXXFLAGS = $(shell pkg-config --static --cflags "libass >= 0.14.0")
LOCAL_CXXFLAGS = -Wall -Wno-deprecated $(LIBASS_CXXFLAGS)
all: subtitles-octopus-worker.bc
SubOctpInterface.cpp: SubtitleOctopus.idl ../build/webidl_binder.py
@# Our version of WebIDL contains JSO-specific patches
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface
subtitles-octopus-worker.bc: SubtitleOctopus.cpp libass.cpp SubOctpInterface.cpp
@# All later dependencies are already included into the first by CPP
$(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) -o $@ $<
clean:
rm -f subtitles-octopus-worker.bc
rm -f SubOctpInterface.cpp WebIDLGrammar.pkl parser.out
.PHONY: all clean

View File

@ -1,8 +0,0 @@
AM_CXXFLAGS = -Wall -Wno-deprecated
# Fix for Emscripten 2 build llvm bitcode instead of js
AM_LDFLAGS = -r
EXEEXT = .bc
noinst_PROGRAMS = subtitlesoctopus
subtitlesoctopus_SOURCES = SubtitleOctopus.cpp

View File

@ -1,20 +0,0 @@
AC_INIT([subtitlesoctopus], [1.1])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_FILES([Makefile])
AC_PROG_CXX
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([stdint.h unistd.h iconv.h])
PKG_CHECK_MODULES([LIBASS], libass >= 0.9.1,[],[
AC_MSG_WARN([libass not found via pkg-config])
#LIBASS_LIBS="-lass"
])
pkg_requires="libass >= 0.9.1"
AC_SUBST([LIBASS_CXXFLAGS])
AC_SUBST([LIBASS_LIBS])
AC_OUTPUT