From feea21aca4d53e411fbd959c7531b7b66b3bf154 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sun, 14 Sep 2014 11:20:23 +0200 Subject: [PATCH] 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 --- cpp/tests/Makefile.am | 3 +-- test/Makefile.am | 8 ++++---- utils/.gitignore | 2 ++ utils/Makefile.am | 42 ++++++++++++++++++------------------------ 4 files changed, 25 insertions(+), 30 deletions(-) diff --git a/cpp/tests/Makefile.am b/cpp/tests/Makefile.am index 137a1f0..901c4a6 100644 --- a/cpp/tests/Makefile.am +++ b/cpp/tests/Makefile.am @@ -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 diff --git a/test/Makefile.am b/test/Makefile.am index 8d7b923..16f2b1a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 = \ diff --git a/utils/.gitignore b/utils/.gitignore index 3be3139..093d3cf 100644 --- a/utils/.gitignore +++ b/utils/.gitignore @@ -1,5 +1,7 @@ .deps .libs +*.la +*.lo Makefile Makefile.in pdfseparate diff --git a/utils/Makefile.am b/utils/Makefile.am index be6aa6d..dede2f6 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -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. -- 1.9.1