3

I want to build MiKTeX (pdflatex specifically) to resolve this privacy issue with pdflatex by applying this change.

I followed this howto.

On a new Windows 7 SP1 (32-bit) install I installed:

  • CMake (cmake-2.8.12.2-win32-x86.exe)
  • Visual Studio C++ 2008 with SP1 (VS2008ExpressWithSP1ENUX1504728.iso)
  • Cygwin (default with bison, flex and diffutil)
  • ActivePerl (ActivePerl-5.20.1.2000-MSWin32-x86-64int-298557.msi)
  • libxslt (libxslt-1.1.26.win32.zip)
  • MiKTeX basic with 'install missing packages on-the-fly' (basic-miktex-2.9.5105.exe)
  • HTML Help Workshop
  • Windows SDK for Windows Server 2008 (6.0.6001.18000.367-KRMSDK_EN.iso)
    • with only the Windows Headers and Libraries and Windows Development Tools selected
  • ImageMagick (ImageMagick-6.9.0-0-Q16-x86-dll.exe)

To Windows' PATH I appended:

;C:\cygwin\bin;C:\libxslt-1.1.26.win32\bin;C:\Program Files\HTML Help Workshop

I extracted the MiKTeX source (miktex-2.9.4106.tar.bz2) to C:\miktex

In C:\miktex\CMakeLists.txt I set NO_GUI = TRUE

I launched the Visual Studio 2008 Command Prompt and entered the following:

cd \miktex
cmake -G "NMake Makefiles"
nmake

Building stopped with the following:

[ 15%] Building C object Libraries/3rd/obsdcompat/CMakeFiles/MiKTeX209-obsdcompat.dir/bsd-asprintf.c.obj
bsd-asprintf.c
c:\miktex\libraries\3rd\obsdcompat\defines.h(91) : error C2061: syntax error : identifier 'u_int8_t'
c:\miktex\libraries\3rd\obsdcompat\defines.h(91) : error C2059: syntax error : ';'
c:\miktex\libraries\3rd\obsdcompat\defines.h(92) : error C2061: syntax error : identifier 'u_int16_t'
c:\miktex\libraries\3rd\obsdcompat\defines.h(92) : error C2059: syntax error : ';'
c:\miktex\libraries\3rd\obsdcompat\defines.h(93) : error C2061: syntax error : identifier 'u_int32_t'
c:\miktex\libraries\3rd\obsdcompat\defines.h(93) : error C2059: syntax error : ';'
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

I was able to work around this and subsequent errors, but after each workaround building again stopped with further errors unrelated to the workarounds. I eventually gave up suspecting there must be something wrong with my build environment or the way I was using it (hence the detail), but I have no idea what the problem is.

  • 2
    I think 'ask Christian Schenk' might be the only realistic answer here: it's hard to imagine that anyone else builds MiKTeX from the sources. – Joseph Wright Dec 10 '14 at 19:06
  • Doesn't pdfTeX now include that patch? (Although I can't figure out how to use \pdfsuppressptexinfo...) – cfr Dec 11 '14 at 2:41
  • @cfr: As far as I can tell, the patch is in 1.50, but is not in 1.40.x. MiKTeX still uses 1.40.x. The patch is described here. Also, compare (in the repository) pdftoepdf.cc in trunk to that in the stable branch and those with the 1.40.x tags. – zxaveb Dec 11 '14 at 6:18
2

I had more success by making the following changes to the procedure described in the question:

  • Using Visual Studio 2010 (non-Express) or later
    • Instead of Visual Studio 2008 Express plus Windows SDK for Windows Server 2008
  • Building from MiKTeX branch 2.9, revision 2476
  • Prepending the Windows SDK bin directory to the system PATH prior to building
    • set PATH=C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin;%PATH%

I am still unable to build all of MiKTeX, but I can build pdftex, which is all I need:

cd \miktex
cmake -G "NMake Makefiles"
cd Programs\TeXAndFriends\pdftex
nmake

Patching pdftex.web and pdftoepdf.cc in Programs\TeXAndFriends\pdftex as necessary (for example, search those files for .Fullbanner and .FileName respectively) prior to building will result in MiKTeX pdftex binaries that do not add PDF metadata/properties not explicitly specified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.