Commit 21b5fd65 authored by Hib Eris's avatar Hib Eris Committed by Albert Astals Cid

Refactor Makefiles to build a noinst library for parsing args

Prevents this automake warning about possible forward-incompatibility:

$ ./autogen.sh
...
cpp/tests/Makefile.am:16: warning: source file '$(top_srcdir)/utils/parseargs.cc' is in a subdirectory,
cpp/tests/Makefile.am:16: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
cpp/tests/Makefile.am:20: warning: source file '$(top_srcdir)/utils/parseargs.cc' is in a subdirectory,
cpp/tests/Makefile.am:20: but option 'subdir-objects' is disabled
parallel-tests: installing './test-driver'
test/Makefile.am:58: warning: source file '../utils/parseargs.cc' is in a subdirectory,
test/Makefile.am:58: but option 'subdir-objects' is disabled

$ automake --version
automake (GNU automake) 1.14.1
...

https://bugs.freedesktop.org/show_bug.cgi?id=83839
parent 70a851b0
......@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/cpp
LDADD = \
$(top_builddir)/utils/libparseargs.la \
$(top_builddir)/poppler/libpoppler.la \
$(top_builddir)/cpp/libpoppler-cpp.la
......@@ -14,9 +15,7 @@ noinst_PROGRAMS = \
poppler-render
poppler_dump_SOURCES = \
$(top_srcdir)/utils/parseargs.cc \
poppler-dump.cpp
poppler_render_SOURCES = \
$(top_srcdir)/utils/parseargs.cc \
poppler-render.cpp
......@@ -55,11 +55,11 @@ perf_test_LDADD = \
$(FREETYPE_LIBS) \
$(X_EXTRA_LIBS)
pdf_fullrewrite_SOURCES = \
pdf-fullrewrite.cc \
../utils/parseargs.cc
pdf_fullrewrite_SOURCES = \
pdf-fullrewrite.cc
pdf_fullrewrite_LDADD = \
pdf_fullrewrite_LDADD = \
$(top_builddir)/utils/libparseargs.la \
$(top_builddir)/poppler/libpoppler.la
EXTRA_DIST = \
......
.deps
.libs
*.la
*.lo
Makefile
Makefile.in
pdfseparate
......
......@@ -8,6 +8,7 @@ AM_CPPFLAGS = \
$(UTILS_CFLAGS)
LDADD = \
libparseargs.la \
$(top_builddir)/poppler/libpoppler.la \
$(UTILS_LIBS)
......@@ -49,41 +50,33 @@ if BUILD_CAIRO_OUTPUT
dist_man1_MANS += pdftocairo.1
endif
common = parseargs.cc parseargs.h
pdfdetach_SOURCES = \
pdfdetach.cc \
$(common)
pdfdetach.cc
pdffonts_SOURCES = \
pdffonts.cc \
$(common)
pdffonts.cc
pdfimages_SOURCES = \
pdfimages.cc \
ImageOutputDev.cc \
ImageOutputDev.h \
JSInfo.cc \
JSInfo.h \
$(common)
JSInfo.h
pdfinfo_SOURCES = \
pdfinfo.cc \
printencodings.cc \
printencodings.h \
JSInfo.cc \
JSInfo.h \
$(common)
JSInfo.h
pdftops_SOURCES = \
pdftops.cc \
$(common)
pdftops.cc
pdftotext_SOURCES = \
pdftotext.cc \
printencodings.cc \
printencodings.h \
$(common)
printencodings.h
pdftohtml_SOURCES = \
pdftohtml.cc \
......@@ -93,8 +86,7 @@ pdftohtml_SOURCES = \
HtmlLinks.h \
HtmlOutputDev.cc \
HtmlOutputDev.h \
HtmlUtils.h \
$(common)
HtmlUtils.h
# HtmlOutputDev uses goo/PNGWriter.h that may depend on libpng header
if BUILD_LIBPNG
......@@ -102,20 +94,16 @@ pdftohtml_CXXFLAGS = $(AM_CXXFLAGS) $(LIBPNG_CFLAGS)
endif
pdfseparate_SOURCES = \
pdfseparate.cc \
$(common)
pdfseparate.cc
pdfunite_SOURCES = \
pdfunite.cc \
$(common)
pdfunite.cc
pdftoppm_SOURCES = \
pdftoppm.cc \
$(common)
pdftoppm.cc
pdftocairo_SOURCES = \
pdftocairo.cc \
$(common)
pdftocairo.cc
if BUILD_CAIRO_OUTPUT
if USE_CMS
......@@ -134,6 +122,12 @@ pdftocairo_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(PDFTOCAIRO_CFLAGS)
noinst_LTLIBRARIES = libparseargs.la
libparseargs_la_SOURCES = \
parseargs.cc \
parseargs.h
# Yay, automake! It should be able to figure out that it has to dist
# pdftoppm.1, but nooo. So we just add it here.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment