Put the openjpeg include directory first, so that includes $LOCALBASE/include/openjpeg-2.3/openjpeg.h instead of $LOCALBASE/include/openjpeg.h --- ext/openjpeg/Makefile.in.orig 2018-09-16 22:05:02.688860000 +0300 +++ ext/openjpeg/Makefile.in 2018-09-16 22:05:11.316104000 +0300 @@ -861,21 +861,21 @@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libgstopenjpeg_la-gstopenjpegdec.lo: gstopenjpegdec.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpegdec.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpegdec.Tpo -c -o libgstopenjpeg_la-gstopenjpegdec.lo `test -f 'gstopenjpegdec.c' || echo '$(srcdir)/'`gstopenjpegdec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(OPENJPEG_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpegdec.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpegdec.Tpo -c -o libgstopenjpeg_la-gstopenjpegdec.lo `test -f 'gstopenjpegdec.c' || echo '$(srcdir)/'`gstopenjpegdec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstopenjpeg_la-gstopenjpegdec.Tpo $(DEPDIR)/libgstopenjpeg_la-gstopenjpegdec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstopenjpegdec.c' object='libgstopenjpeg_la-gstopenjpegdec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -c -o libgstopenjpeg_la-gstopenjpegdec.lo `test -f 'gstopenjpegdec.c' || echo '$(srcdir)/'`gstopenjpegdec.c libgstopenjpeg_la-gstopenjpegenc.lo: gstopenjpegenc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpegenc.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpegenc.Tpo -c -o libgstopenjpeg_la-gstopenjpegenc.lo `test -f 'gstopenjpegenc.c' || echo '$(srcdir)/'`gstopenjpegenc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(OPENJPEG_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpegenc.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpegenc.Tpo -c -o libgstopenjpeg_la-gstopenjpegenc.lo `test -f 'gstopenjpegenc.c' || echo '$(srcdir)/'`gstopenjpegenc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstopenjpeg_la-gstopenjpegenc.Tpo $(DEPDIR)/libgstopenjpeg_la-gstopenjpegenc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstopenjpegenc.c' object='libgstopenjpeg_la-gstopenjpegenc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -c -o libgstopenjpeg_la-gstopenjpegenc.lo `test -f 'gstopenjpegenc.c' || echo '$(srcdir)/'`gstopenjpegenc.c libgstopenjpeg_la-gstopenjpeg.lo: gstopenjpeg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpeg.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpeg.Tpo -c -o libgstopenjpeg_la-gstopenjpeg.lo `test -f 'gstopenjpeg.c' || echo '$(srcdir)/'`gstopenjpeg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(OPENJPEG_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstopenjpeg_la_CFLAGS) $(CFLAGS) -MT libgstopenjpeg_la-gstopenjpeg.lo -MD -MP -MF $(DEPDIR)/libgstopenjpeg_la-gstopenjpeg.Tpo -c -o libgstopenjpeg_la-gstopenjpeg.lo `test -f 'gstopenjpeg.c' || echo '$(srcdir)/'`gstopenjpeg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstopenjpeg_la-gstopenjpeg.Tpo $(DEPDIR)/libgstopenjpeg_la-gstopenjpeg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstopenjpeg.c' object='libgstopenjpeg_la-gstopenjpeg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@