Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Build/LIBS/intel_win/make_LIBS.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ set SRCDIR=%CD%
cd ..\Build
set BUILDDIR=%CD%

:: openvr
::cd %SRCDIR%\openvr
::start %WAIT% makelib %OPTS% -copy libopenvr.lib %LIBDIR%\openvr.lib

:: ZLIB
cd %SRCDIR%\zlib131
start "building windows zlib" %WAIT% makelib %OPTS% -copy libz.lib %LIBDIR%\zlib.lib
Expand Down
85 changes: 85 additions & 0 deletions Build/gdtest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

# test makefile

SOURCE_DIR = ../../../Source/
BUILD_DIR = ../../../Build
LIB_DIR = $(BUILD_DIR)/LIBS


FILTERC =
FILTERF =

# Intel compiler definitions
include ../../scripts/intel_compiler.mak

VPATH = $(SOURCE_DIR)/gdtest
bin = .

LIB_DIR = $(BUILD_DIR)/LIBS
INTEL_WIN_LIBDIR = $(LIB_DIR)/intel_win
CLANG_WIN_LIBDIR = $(LIB_DIR)/clang_win
INTEL_LINUX_LIBDIR = $(LIB_DIR)/intel_linux
CLANG_OSX_LIBDIR = $(LIB_DIR)/clang_osx

INC_DIR = -I $(SOURCE_DIR)/gd-2.3.3 -I $(SOURCE_DIR)/jpeg-9b
INTEL_WIN_LIBS = $(INTEL_WIN_LIBDIR)\gd.lib $(INTEL_WIN_LIBDIR)\jpeg.lib
CLANG_WIN_LIBS = $(CLANG_WIN_LIBDIR)\gd.lib $(CLANG_WIN_LIBDIR)\jpeg.lib
LINUXOSX_LIBS= -lgd -ljpeg

# Definition of the object variables

srcs = main.c
obj = $(srcs:.c=.o)
objwin = $(obj:.o=.obj)

#*** General Purpose Rules ***

no_target:
@echo \******** You did not specify a make target \********
@echo Use one of targets found in the Makefile

.SUFFIXES: .c .obj .o

.c.obj:
$(CC) -c $(CFLAGS) $(FILTERC) $(INC_DIR) $<
.c.o:
$(CC) -c $(CFLAGS) $(FILTERC) $(INC_DIR) $<

# ------------- intel win ----------------

intel_win : CFLAGS = -Od /nologo -D BGDWIN32
intel_win : CC = $(I_CC)
intel_win : exe = gdtest_win.exe

intel_win : $(objwin)
$(CC) -o $(bin)/$(exe) $(objwin) $(INTEL_WIN_LIBS)

# ------------- clang win ----------------

clang_win : CFLAGS = -m64 -D BGDWIN32
clang_win : LFLAGS = -m64
clang_win : CC = clang-cl
clang_win : exe = gdtest_win.exe

clang_win : $(objwin)
$(CC) -o $(bin)/$(exe) $(LFLAGS) $(objwin) $(CLANG_WIN_LIBS)

# ------------- intel linux ----------------

intel_linux : CFLAGS = -O2 -m64
intel_linux : CC = $(I_ICC)
intel_linux : exe = gdtest_linux

intel_linux : $(obj)
$(CC) -o $(bin)/$(exe) $(obj) -L$(INTEL_LINUX_LIBDIR) $(LINUXOSX_LIBS)

# ------------- clang osx ----------------

clang_osx : CFLAGS = -O0 -m64
clang_osx : LFLAGS = -m64 -L$(CLANG_OSX_LIBDIR) $(LINUXOSX_LIBS)
clang_osx : CC = clang
clang_osx : CPP = clang++
clang_osx : exe = gdtest_osx

clang_osx : $(obj)
$(CPP) -o $(bin)/$(exe) $(obj) $(LFLAGS)
Empty file.
3 changes: 3 additions & 0 deletions Build/gdtest/clang_osx/make_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
rm -f *.o
make -f ../Makefile clang_osx
1 change: 1 addition & 0 deletions Build/gdtest/clang_win/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

15 changes: 15 additions & 0 deletions Build/gdtest/clang_win/make_gdtest.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
set arg1=%1

:: setup compiler environment
if x%arg1% == xbot goto skip1
call ..\..\..\Utilities\Scripts\setup_intel_compilers.bat
:skip1

Title Building flushcache for Windows

:: build libraries if one is missing
call ..\..\scripts\test_libs.bat ..\..\LIBS\

erase *.obj *.exe
make SHELL="%ComSpec%" -f ..\Makefile clang_win
Empty file.
3 changes: 3 additions & 0 deletions Build/gdtest/intel_linux/make_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
rm -f *.o
make -f ../Makefile intel_linux
Empty file.
15 changes: 15 additions & 0 deletions Build/gdtest/intel_win/make_gdtest.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
set arg1=%1

:: setup compiler environment
if x%arg1% == xbot goto skip1
call ..\..\..\Utilities\Scripts\setup_intel_compilers.bat
:skip1

Title Building flushcache for Windows

:: build libraries if one is missing
call ..\..\scripts\test_libs.bat ..\..\LIBS\

erase *.obj *.exe
make SHELL="%ComSpec%" -f ..\Makefile intel_win
2 changes: 1 addition & 1 deletion Source/gd-2.3.3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#for your system.
AR=ar

CFLAGS=-g -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG -DHAVE_LIBX11
CFLAGS=-DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG -DHAVE_LIBX11

INCLUDEDIRS=-I. -I../png-1.6.48 -I../jpeg-9b -I../zlib131

Expand Down
2 changes: 2 additions & 0 deletions Source/gd-2.3.3/gd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,8 @@ BGD_DECLARE(void *) gdImageWBMPPtr (gdImagePtr im, int *size, int fg);

/* 100 is highest quality (there is always a little loss with JPEG).
0 is lowest. 10 is about the lowest useful setting. */

BGD_DECLARE(void) gdJpegTest(void);
BGD_DECLARE(void) gdImageJpeg (gdImagePtr im, FILE * out, int quality);
BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtxPtr out, int quality);

Expand Down
8 changes: 8 additions & 0 deletions Source/gd-2.3.3/gd_jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ static int _gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality);
(end code)
*/

BGD_DECLARE(void) gdJpegTest(void){
int size1;

size1 = sizeof(struct jpeg_compress_struct);
printf("in gd: %i:\n",size1);
JpegTest("from gd");
}

BGD_DECLARE(void) gdImageJpeg(gdImagePtr im, FILE *outFile, int quality)
{
gdIOCtx *out = gdNewFileCtx(outFile);
Expand Down
4 changes: 2 additions & 2 deletions Source/gd-2.3.3/makelib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ erase *.o *.obj libgd.a libgd.lib
set target=libgd.lib
if %COMPILER% == gcc set target=libgd.a
if exist finished erase finished
@REM make CFLAGS="-g -DHAVE_BOOLEAN -DBGDWIN32 -DWIN32 -DNONDLL -DENABLE_FREETYPE=OFF -DBUILD_SHARED_LIBS=OFF -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG " COMPILER=%COMPILER% LIB=%LIB% SIZE=%SIZE% RM=erase -f ./makefile %target%
make CFLAGS="-g -DHAVE_BOOLEAN -DBGDWIN32 -DWIN32 -DENABLE_FREETYPE=OFF -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG " COMPILER=%COMPILER% LIB=%LIB% SIZE=%SIZE% RM=erase -f ./makefile %target%
@REM make CFLAGS="-DHAVE_BOOLEAN -DBGDWIN32 -DWIN32 -DNONDLL -DENABLE_FREETYPE=OFF -DBUILD_SHARED_LIBS=OFF -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG " COMPILER=%COMPILER% LIB=%LIB% SIZE=%SIZE% RM=erase -f ./makefile %target%
make CFLAGS="-DHAVE_BOOLEAN -DBGDWIN32 -DWIN32 -DENABLE_FREETYPE=OFF -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG " COMPILER=%COMPILER% LIB=%LIB% SIZE=%SIZE% RM=erase -f ./makefile %target%
if %COPYLIB% == 1 copy %FROMLIB% %TOLIB%
echo finished > finished
if "x%EXIT_SCRIPT%" == "x" goto skip1
Expand Down
18 changes: 18 additions & 0 deletions Source/gdtest/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jpeglib.h"
#include "gd.h"

/* ------------------ main ------------------------ */

int main(int argc, char **argv){
int size1;

size1 = sizeof(struct jpeg_compress_struct);

printf("in gdtest/main: %i:\n",size1);
gdJpegTest();
JpegTest("from main");
}
8 changes: 8 additions & 0 deletions Source/jpeg-9b/jerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,11 @@ jpeg_std_error (struct jpeg_error_mgr * err)

return err;
}

void JpegTest(char *message){
int size1;

size1 = sizeof(struct jpeg_compress_struct);
printf("in jpeg %s: %i\n", message, size1);
}

2 changes: 2 additions & 0 deletions Source/jpeg-9b/jpeglib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,8 @@ EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
JDIMENSION max_lines));
EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));

EXTERN(void) JpegTest(char *message);

/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
JSAMPIMAGE data,
Expand Down