# Copyright (c) 2008 jerome DOT laurens AT u-bourgogne DOT fr
#
# This file is part of the SyncTeX package.
#
# License:
# --------
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE
#
# Except as contained in this notice, the name of the copyright holder  
# shall not be used in advertising or otherwise to promote the sale,  
# use or other dealings in this Software without prior written  
# authorization from the copyright holder.
#
# Acknowledgments:
# ----------------
# The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
# and significant help from XeTeX developer Jonathan Kew
# 
# Nota Bene:
# ----------
# If you include or use a significant part of the synctex package into a software,
# I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
# 
# Version 1
# Thu Jun 19 09:39:21 UTC 2008

How to INSTALL synctex support in web2c.

First you need a recent convert tool (as of march 2008)

Modify your .mk file to mimic what was done for pdftex

In synctex.mk
-------------
### SyncTeX support in pdftex
# list of change files
synctex-pdftex_ch_srcs_mem_only = \
  $(synctex_dir)/synctex-mem.ch0 \
  $(synctex_dir)/synctex-mem.ch1 \
  $(synctex_dir)/synctex-e-mem.ch0 \
  $(synctex_dir)/synctex-e-mem.ch1
synctex-pdftex_ch_srcs_on = \
  $(synctex-pdftex_ch_srcs_mem_only) \
  $(synctex_dir)/synctex-rec.ch0 \
  $(synctex_dir)/synctex-rec.ch1 \
  $(synctex_dir)/synctex-e-rec.ch0 \
  $(synctex_dir)/synctex-e-rec.ch1 \
  $(synctex_dir)/synctex-pdf-rec.ch2
synctex-pdftex_ch_srcs_off =
# The C sources and headers
synctex-pdftex_o = synctex-pdf.o
synctex-pdf.h: $(synctex_dir)/synctex.h
	cat $(synctex_dir)/synctex.h >$@
synctex-pdftex.h: $(synctex_dir)/$@
	cat $(synctex_dir)/$@ >$@
synctex-pdf.c: pdftexd.h $(synctex_dir)/synctex.c synctex-pdftex.h
	sed s/TEX-OR-MF-OR-MP/pdftex/ $(synctex_dir)/synctex.c >$@
synctex_pdftexd_on = \
	if test -z "`grep __SyncTeX__ pdftexd.h`";\
	then\
		$(synctex_all_texd);\
		sed -f synctex_sed_command.txt pdftexd.h > synctex_pdftexd.h;\
		mv synctex_pdftexd.h pdftexd.h;\
		rm -f synctex_sed_command.txt;\
	fi
synctex_pdftexd_off =
# switchers: _on to enable full synctex support, _off to completely disable synctex, _mem_only to only implement memory management.
synctex-pdftex_ch_srcs = $(synctex-pdftex_ch_srcs_on)
# _on to enable -synctex command line option, _off to disable
synctex_pdftexd = $(synctex_pdftexd_on)

In pdftex.mk
------------
# The C sources.
pdftex_c = pdftexini.c pdftex0.c pdftex1.c pdftex2.c pdftex3.c
pdftex_o = pdftexini.o pdftex0.o pdftex1.o pdftex2.o pdftex3.o pdftexextra.o loadpdftexpool.o $(synctex-pdftex_o)

# C file dependencies.
$(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h
	$(web2c) pdftex
	$(synctex_pdftexd)

#   Sources for pdftex.ch:
pdftex_ch_srcs = $(srcdir)/$(pdftexdir)/pdftex.web \
  $(srcdir)/$(pdftexdir)/tex.ch0 \
  $(srcdir)/tex.ch \
  $(synctex-pdftex_ch_srcs) \
  $(srcdir)/$(pdftexdir)/pdftex.ch

