Skip to content

Commit

Permalink
Simplify ijl15 static linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Aug 1, 2024
1 parent 4b561bf commit 4d097fa
Show file tree
Hide file tree
Showing 44 changed files with 50 additions and 194 deletions.
37 changes: 1 addition & 36 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,7 @@ the Intel JPEG Product License Agreement:

* [third_party/ijl/ijl.h](./third_party/ijl/ijl.h)
* [third_party/ijl/ijl15.lib](./third_party/ijl/ijl15.lib)
* [third_party/ijl/aan_fdct1.obj](./third_party/ijl/aan_fdct1.obj)
* [third_party/ijl/aan_fdct.obj](./third_party/ijl/aan_fdct.obj)
* [third_party/ijl/aan_idct1.obj](./third_party/ijl/aan_idct1.obj)
* [third_party/ijl/aan_idct.obj](./third_party/ijl/aan_idct.obj)
* [third_party/ijl/cc_ss_decoder1.obj](./third_party/ijl/cc_ss_decoder1.obj)
* [third_party/ijl/cc_ss_decoder.obj](./third_party/ijl/cc_ss_decoder.obj)
* [third_party/ijl/cc_ss_encoder1.obj](./third_party/ijl/cc_ss_encoder1.obj)
* [third_party/ijl/cc_ss_encoder.obj](./third_party/ijl/cc_ss_encoder.obj)
* [third_party/ijl/cpuid1.obj](./third_party/ijl/cpuid1.obj)
* [third_party/ijl/cpuid.obj](./third_party/ijl/cpuid.obj)
* [third_party/ijl/decode_buffer.obj](./third_party/ijl/decode_buffer.obj)
* [third_party/ijl/decoder_parser.obj](./third_party/ijl/decoder_parser.obj)
* [third_party/ijl/encode_buffer1.obj](./third_party/ijl/encode_buffer1.obj)
* [third_party/ijl/encode_buffer.obj](./third_party/ijl/encode_buffer.obj)
* [third_party/ijl/encoder_parser.obj](./third_party/ijl/encoder_parser.obj)
* [third_party/ijl/fileio.obj](./third_party/ijl/fileio.obj)
* [third_party/ijl/frame_decoder.obj](./third_party/ijl/frame_decoder.obj)
* [third_party/ijl/frame_encoder.obj](./third_party/ijl/frame_encoder.obj)
* [third_party/ijl/globals.obj](./third_party/ijl/globals.obj)
* [third_party/ijl/huff_decode.obj](./third_party/ijl/huff_decode.obj)
* [third_party/ijl/huff_encode1.obj](./third_party/ijl/huff_encode1.obj)
* [third_party/ijl/huff_encode.obj](./third_party/ijl/huff_encode.obj)
* [third_party/ijl/init.obj](./third_party/ijl/init.obj)
* [third_party/ijl/ipp_fdct1.obj](./third_party/ijl/ipp_fdct1.obj)
* [third_party/ijl/ipp_fdct.obj](./third_party/ijl/ipp_fdct.obj)
* [third_party/ijl/ipp_idct1.obj](./third_party/ijl/ipp_idct1.obj)
* [third_party/ijl/ipp_idct.obj](./third_party/ijl/ipp_idct.obj)
* [third_party/ijl/jpgintfc.obj](./third_party/ijl/jpgintfc.obj)
* [third_party/ijl/mdecode.obj](./third_party/ijl/mdecode.obj)
* [third_party/ijl/precomp.obj](./third_party/ijl/precomp.obj)
* [third_party/ijl/scan_decoder.obj](./third_party/ijl/scan_decoder.obj)
* [third_party/ijl/scan_encoder.obj](./third_party/ijl/scan_encoder.obj)
* [third_party/ijl/tables.obj](./third_party/ijl/tables.obj)
* [third_party/ijl/timing.obj](./third_party/ijl/timing.obj)
* [third_party/ijl/trace.obj](./third_party/ijl/trace.obj)
* [third_party/ijl/versionl.obj](./third_party/ijl/versionl.obj)
* [third_party/ijl/ijl15l.lib](./third_party/ijl/ijl15l.lib)

Please see the respective [LICENSE.md](third_party/ijl/LICENSE.md) for the full
redistributable license.
Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ VERSION ?= $(shell git describe --tags --always --dirty)

CFLAGS := -DSTRSAFE_NO_DEPRECATE

LDFLAGS := -nodefaultlibs -nostartfiles -lws2_32 -lkernel32 -luser32 third_party/msvcrt/msvcrt.lib third_party/msvcrt/rtsyms.o -Wl,--enable-stdcall-fixup -s
LDFLAGS := \
-nodefaultlibs \
-nostartfiles \
third_party/ijl/ijl15l.lib \
-lws2_32 \
-lkernel32 \
-luser32 \
third_party/msvcrt/msvcrt.lib \
third_party/msvcrt/rtsyms.o \
-Wl,--enable-stdcall-fixup \
-s

OBJS := \
obj/dll/rugburn/main.o \
Expand All @@ -22,12 +32,11 @@ OBJS := \
obj/common.o \
obj/config.o \
obj/hex.o \
obj/ijl15.o \
obj/json.o \
obj/patch.o \
obj/regex.o

IJL15OBJS := $(wildcard third_party/ijl/*.obj)

TESTOBJS := \
$(OBJS) \
obj/exe/test/main.o
Expand All @@ -49,7 +58,7 @@ $(OBJDIR)%.o: $(SRCDIR)%.c
$(CC) -c $(CFLAGS) "$<" -o "$@"
$(OUT): $(OBJS)
@mkdir -p "$(dir $@)"
$(CC) $(OBJS) $(IJL15OBJS) $(LDFLAGS) -shared -o "$@" export.def -Wl,-e_DllMain
$(CC) $(OBJS) $(LDFLAGS) -shared -o "$@" export.def -Wl,-e_DllMain
$(TESTOUT): $(TESTOBJS)
@mkdir -p "$(dir $@)"
$(CC) $(TESTOBJS) $(LDFLAGS) -o "$@" -Wl,-e_start
Expand Down
12 changes: 6 additions & 6 deletions export.def
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
LIBRARY IJL15
EXPORTS
ijlGetLibVersion @1
ijlInit @2
ijlFree @3
ijlRead @4
ijlWrite @5
ijlErrorStr @6
ijlGetLibVersion = ijlGetLibVersionWrapper @1
ijlInit = ijlInitWrapper @2
ijlFree = ijlFreeWrapper @3
ijlRead = ijlReadWrapper @4
ijlWrite = ijlWriteWrapper @5
ijlErrorStr = ijlErrorStrWrapper @6
40 changes: 2 additions & 38 deletions rugburn.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<ModuleDefinitionFile>export.def</ModuleDefinitionFile>
<EntryPointSymbol>DllMain</EntryPointSymbol>
<AdditionalDependencies>kernel32.lib;user32.lib;shlwapi.lib;ws2_32.lib;$(ProjectDir)\third_party\msvcrt\msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>kernel32.lib;user32.lib;shlwapi.lib;ws2_32.lib;$(ProjectDir)\third_party\msvcrt\msvcrt.lib;$(ProjectDir)\third_party\ijl\ijl15l.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -188,6 +188,7 @@
<ClCompile Include="src\config.c" />
<ClCompile Include="src\dll\rugburn\main.c" />
<ClCompile Include="src\hex.c" />
<ClCompile Include="src\ijl15.c" />
<ClCompile Include="src\hooks\comctl32\dynamic_patch.c" />
<ClCompile Include="src\hooks\hooks.c" />
<ClCompile Include="src\hooks\kernel32\inject.c" />
Expand All @@ -205,45 +206,8 @@
<None Include="export.def" />
<None Include="LICENSE.md" />
<None Include="README.md" />
<None Include="src\third_party\lend\COPYING" />
</ItemGroup>
<ItemGroup>
<Object Include="third_party\ijl\aan_fdct.obj" />
<Object Include="third_party\ijl\aan_fdct1.obj" />
<Object Include="third_party\ijl\aan_idct.obj" />
<Object Include="third_party\ijl\aan_idct1.obj" />
<Object Include="third_party\ijl\cc_ss_decoder.obj" />
<Object Include="third_party\ijl\cc_ss_decoder1.obj" />
<Object Include="third_party\ijl\cc_ss_encoder.obj" />
<Object Include="third_party\ijl\cc_ss_encoder1.obj" />
<Object Include="third_party\ijl\cpuid.obj" />
<Object Include="third_party\ijl\cpuid1.obj" />
<Object Include="third_party\ijl\decoder_parser.obj" />
<Object Include="third_party\ijl\decode_buffer.obj" />
<Object Include="third_party\ijl\encoder_parser.obj" />
<Object Include="third_party\ijl\encode_buffer.obj" />
<Object Include="third_party\ijl\encode_buffer1.obj" />
<Object Include="third_party\ijl\fileio.obj" />
<Object Include="third_party\ijl\frame_decoder.obj" />
<Object Include="third_party\ijl\frame_encoder.obj" />
<Object Include="third_party\ijl\globals.obj" />
<Object Include="third_party\ijl\huff_decode.obj" />
<Object Include="third_party\ijl\huff_encode.obj" />
<Object Include="third_party\ijl\huff_encode1.obj" />
<Object Include="third_party\ijl\init.obj" />
<Object Include="third_party\ijl\ipp_fdct.obj" />
<Object Include="third_party\ijl\ipp_fdct1.obj" />
<Object Include="third_party\ijl\ipp_idct.obj" />
<Object Include="third_party\ijl\ipp_idct1.obj" />
<Object Include="third_party\ijl\jpgintfc.obj" />
<Object Include="third_party\ijl\mdecode.obj" />
<Object Include="third_party\ijl\precomp.obj" />
<Object Include="third_party\ijl\scan_decoder.obj" />
<Object Include="third_party\ijl\scan_encoder.obj" />
<Object Include="third_party\ijl\tables.obj" />
<Object Include="third_party\ijl\timing.obj" />
<Object Include="third_party\ijl\trace.obj" />
<Object Include="third_party\ijl\versionl.obj" />
<Object Include="third_party\msvcrt\rtsyms.o" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
110 changes: 1 addition & 109 deletions rugburn.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -33,116 +33,8 @@
</Filter>
</ItemGroup>
<ItemGroup>
<Object Include="third_party\ijl\aan_fdct.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\aan_fdct1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\aan_idct.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\aan_idct1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cc_ss_decoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cc_ss_decoder1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cc_ss_encoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cc_ss_encoder1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cpuid.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\cpuid1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\decode_buffer.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\decoder_parser.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\encode_buffer.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\encode_buffer1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\encoder_parser.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\fileio.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\frame_decoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\frame_encoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\globals.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\huff_decode.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\huff_encode.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\huff_encode1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\init.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\ipp_fdct.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\ipp_fdct1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\ipp_idct.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\ipp_idct1.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\jpgintfc.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\mdecode.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\precomp.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\scan_decoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\scan_encoder.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\tables.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\timing.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\trace.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\ijl\versionl.obj">
<Filter>ijl15</Filter>
</Object>
<Object Include="third_party\msvcrt\rtsyms.o">
<Filter>msvcrt</Filter>
</Object>
</ItemGroup>
</Project>
</Project>
26 changes: 26 additions & 0 deletions src/ijl15.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <windows.h>
#include "../third_party/ijl/ijl.h"

const IJLibVersion *__stdcall ijlGetLibVersionWrapper() {
return ijlGetLibVersion();
}

IJLERR __stdcall ijlInitWrapper(JPEG_CORE_PROPERTIES *jcprops) {
return ijlInit(jcprops);
}

IJLERR __stdcall ijlFreeWrapper(JPEG_CORE_PROPERTIES *jcprops) {
return ijlFree(jcprops);
}

IJLERR __stdcall ijlReadWrapper(JPEG_CORE_PROPERTIES *jcprops, IJLIOTYPE iotype) {
return ijlRead(jcprops, iotype);
}

IJLERR __stdcall ijlWriteWrapper(JPEG_CORE_PROPERTIES *jcprops, IJLIOTYPE iotype) {
return ijlWrite(jcprops, iotype);
}

const char *__stdcall ijlErrorStrWrapper(IJLERR code) {
return ijlErrorStr(code);
}
2 changes: 1 addition & 1 deletion third_party/ijl/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ By copying, installing, or otherwise using the Materials, you agree to be bound
by the terms of this Agreement. If you do not agree to the terms of this
Agreement, do not copy, install, or use the Materials.

# Intel® JPEG Library 1.51 Product License Agreement
# Intel® JPEG Library 1.51 Product License Agreement

LICENSE GRANT: Subject to the License Restrictions below, Intel Corporation
("Intel") grants to you the following non-exclusive, non-assignable royalty-free
Expand Down
Binary file removed third_party/ijl/aan_fdct.obj
Binary file not shown.
Binary file removed third_party/ijl/aan_fdct1.obj
Binary file not shown.
Binary file removed third_party/ijl/aan_idct.obj
Binary file not shown.
Binary file removed third_party/ijl/aan_idct1.obj
Binary file not shown.
Binary file removed third_party/ijl/cc_ss_decoder.obj
Binary file not shown.
Binary file removed third_party/ijl/cc_ss_decoder1.obj
Binary file not shown.
Binary file removed third_party/ijl/cc_ss_encoder.obj
Binary file not shown.
Binary file removed third_party/ijl/cc_ss_encoder1.obj
Binary file not shown.
Binary file removed third_party/ijl/cpuid.obj
Binary file not shown.
Binary file removed third_party/ijl/cpuid1.obj
Binary file not shown.
Binary file removed third_party/ijl/decode_buffer.obj
Binary file not shown.
Binary file removed third_party/ijl/decoder_parser.obj
Binary file not shown.
Binary file removed third_party/ijl/encode_buffer.obj
Binary file not shown.
Binary file removed third_party/ijl/encode_buffer1.obj
Binary file not shown.
Binary file removed third_party/ijl/encoder_parser.obj
Binary file not shown.
Binary file removed third_party/ijl/fileio.obj
Binary file not shown.
Binary file removed third_party/ijl/frame_decoder.obj
Binary file not shown.
Binary file removed third_party/ijl/frame_encoder.obj
Binary file not shown.
Binary file removed third_party/ijl/globals.obj
Binary file not shown.
Binary file removed third_party/ijl/huff_decode.obj
Binary file not shown.
Binary file removed third_party/ijl/huff_encode.obj
Binary file not shown.
Binary file removed third_party/ijl/huff_encode1.obj
Binary file not shown.
Binary file added third_party/ijl/ijl15l.lib
Binary file not shown.
Binary file removed third_party/ijl/init.obj
Binary file not shown.
Binary file removed third_party/ijl/ipp_fdct.obj
Binary file not shown.
Binary file removed third_party/ijl/ipp_fdct1.obj
Binary file not shown.
Binary file removed third_party/ijl/ipp_idct.obj
Binary file not shown.
Binary file removed third_party/ijl/ipp_idct1.obj
Binary file not shown.
Binary file removed third_party/ijl/jpgintfc.obj
Binary file not shown.
Binary file removed third_party/ijl/mdecode.obj
Binary file not shown.
Binary file removed third_party/ijl/precomp.obj
Binary file not shown.
Binary file removed third_party/ijl/scan_decoder.obj
Binary file not shown.
Binary file removed third_party/ijl/scan_encoder.obj
Binary file not shown.
Binary file removed third_party/ijl/tables.obj
Binary file not shown.
Binary file removed third_party/ijl/timing.obj
Binary file not shown.
Binary file removed third_party/ijl/trace.obj
Binary file not shown.
Binary file removed third_party/ijl/versionl.obj
Binary file not shown.

0 comments on commit 4d097fa

Please sign in to comment.