I want to build mupdf (with poudriere) on FreeBSD but I ran into the following error: cc -O2 -pipe -I/wrkdirs/usr/ports/graphics/mupdf/work/mupdf-1.9a-source/include/mupdf -I/wrkdirs/usr/ports/graphics/mupdf/work/mupdf-1.9a-source/thirdparty/mujs -fstack-protector -fno-strict-aliasing -Wall -DNDEBUG -fomit-frame-pointer -DHAVE_PTHREADS -Iinclude -Igenerated -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -DSHARE_JPEG -I/usr/local/include/openjpeg-2.1 -o build/release/fonts/DroidSansFallback.o -c generated/DroidSansFallback.c -O0 <inline asm>:3:37: error: unexpected token in '.type' directive .type fz_font_DroidSansFallback_ttc STT_OBJECT ^ 1 error generated. gmake[1]: *** [Makefile:178: build/release/fonts/DroidSansFallback.o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... <inline asm>:3:41: error: unexpected token in '.type' directive .type fz_font_DroidSansFallbackFull_ttc STT_OBJECT ^ 1 error generated. gmake[1]: *** [Makefile:178: build/release/fonts/DroidSansFallbackFull.o] Error 1 gmake[1]: Leaving directory '/wrkdirs/usr/ports/graphics/mupdf/work/mupdf-1.9a-source' The full log can found here: http://freebsd.uzsolt.hu/logs/mupdf/mupdf-1.9%2C1-unexpected_token.log Thanks for you work!
We have some #ifdef logic in the code generated by fontdump that goes: #ifndef __STRICT_ANSI__ #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) #if !defined(__ICC) #define HAVE_INCBIN #endif #endif #endif That is enabling HAVE_INCBIN for FreeBSD builds, but your toolset does not support it. Remove the #define HAVE_INCBIN line (or better, edit fontdump.c to avoid outputting that line), and you should be Ok. Please let us know how you get on.
It causes many other "undefinied reference to..." errors: http://freebsd.uzsolt.hu/logs/mupdf/mupdf-1.9a%2C1-undefinied_reference.log The applied patch: http://freebsd.uzsolt.hu/diff/patch-scripts_fontdump.c
The problem is with freebsd's packaging and with javascript stuff being missed. Use the latest version from our git, and you'll be fine.
Ooops, you've right. It was my fault. It seems the attached patch works. Thank for your help!