Skip to content

Commit

Permalink
Remove Autotools build of src/xtractprotos to fix DanBloomberg#179
Browse files Browse the repository at this point in the history
The allheaders target now triggers a build of xtractprotos in the prog
directory. I'm not sure if this is the proper way to do it but it's
good enough to have the following work as expected.

 ./configure
 cd src
 make allheaders

I have assumed that allheaders.h should be written to the source
directory rather than the build directory. Changing this would be
difficult.

It doesn't work when building outside of the source tree but this was
already broken. cpp, as invoked by xtractprotos, needs to locate
endianness.h and this is written to the build directory. Perhaps
xtractprotos should accept -I arguments or even pass all additional
arguments to cpp.
  • Loading branch information
chewi committed Apr 21, 2016
1 parent 6f52a4d commit 4122fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
makefile
Makefile
Makefile.in
xtractprotos
/aclocal.m4
/autom4te.cache
/config/
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ pkginclude_HEADERS = allheaders.h alltypes.h \
readbarcode.h recog.h regutils.h stack.h \
stringcode.h sudoku.h watershed.h

noinst_PROGRAMS = xtractprotos
LDADD = liblept.la

EXTRA_DIST = arrayaccess.h.vc \
Expand All @@ -82,7 +81,8 @@ EXTRA_DIST = arrayaccess.h.vc \
morphtemplate1.txt morphtemplate2.txt \
stringtemplate1.txt stringtemplate2.txt

allheaders: $(liblept_la_SOURCES)
@test -x xtractprotos || echo "First run 'make xtractprotos'"
./xtractprotos -prestring=LEPT_DLL -protos=inline $(liblept_la_SOURCES)
$(top_builddir)/prog/xtractprotos$(EXEEXT): liblept.la
$(MAKE) -C $(top_builddir)/prog xtractprotos$(EXEEXT)

allheaders: $(top_builddir)/prog/xtractprotos$(EXEEXT) $(liblept_la_SOURCES)
cd $(srcdir) && $(abs_top_builddir)/prog/xtractprotos$(EXEEXT) -prestring=LEPT_DLL -protos=inline $(liblept_la_SOURCES)

0 comments on commit 4122fbf

Please sign in to comment.