add a minimal config and makefile to test watcom/os2 builds.
authorOzkan Sezer <sezeroz@gmail.com>
Sun, 14 Oct 2018 23:56:56 +0300
changeset 12329b7243b9f8fd5
parent 12328 5ff0dd9cbb69
child 12330 cf64a70ad02a
add a minimal config and makefile to test watcom/os2 builds.
OWMakefile.os2
include/SDL_config.h
include/SDL_config_os2.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/OWMakefile.os2	Sun Oct 14 23:56:56 2018 +0300
     1.3 @@ -0,0 +1,114 @@
     1.4 +# Open Watcom Makefile to build a minimal OS/2 SDL2.dll
     1.5 +
     1.6 +DLLFILE = SDL2.dll
     1.7 +IMPLIB  = SDL2.lib
     1.8 +MAPFILE = SDL2.map
     1.9 +EXPFILE = SDL2.exp
    1.10 +LNKFILE = SDL2.lnk
    1.11 +
    1.12 +INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
    1.13 +INCPATH+= -Iinclude
    1.14 +
    1.15 +CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
    1.16 +# max warnings:
    1.17 +CFLAGS+= -wx
    1.18 +# building dll:
    1.19 +CFLAGS+= -bd
    1.20 +# the include paths :
    1.21 +CFLAGS+= $(INCPATH)
    1.22 +# building SDL itself:
    1.23 +CFLAGS+= -DBUILD_SDL
    1.24 +
    1.25 +# this is so that build doesn't fail with E1112:
    1.26 +#CFLAGS+= -DSDL_POWER_DISABLED
    1.27 +CFLAGS+= -DSDL_POWER_HARDWIRED
    1.28 +
    1.29 +.extensions:
    1.30 +.extensions: .lib .dll .obj .c .asm
    1.31 +
    1.32 +.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/haptic/dummy;./src/joystick/dummy;./src/loadso/dummy;./src/filesystem/dummy;./src/thread/generic;./src/timer/dummy;./src/power;./src/power/os2;./src/atomic;./src/audio/dummy;./src/audio/disk;./src/video/dummy;./src/sensor/dummy;./src/test;
    1.33 +
    1.34 +SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
    1.35 +SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
    1.36 +SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
    1.37 +SRCS+= SDL_rwops.c SDL_power.c
    1.38 +SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
    1.39 +SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
    1.40 +       SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
    1.41 +       SDL_sensor.c SDL_touch.c
    1.42 +SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
    1.43 +SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
    1.44 +       SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
    1.45 +       SDL_render_sw.c SDL_rotate.c
    1.46 +SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
    1.47 +       SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
    1.48 +       SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
    1.49 +       SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
    1.50 +
    1.51 +SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
    1.52 +SRCS+= SDL_systimer.c
    1.53 +SRCS+= SDL_sysloadso.c
    1.54 +SRCS+= SDL_sysfilesystem.c
    1.55 +SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
    1.56 +SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
    1.57 +SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
    1.58 +SRCS+= SDL_dummysensor.c
    1.59 +
    1.60 +SRCS+= SDL_dynapi.c
    1.61 +
    1.62 +OBJS = $(SRCS:.c=.obj)
    1.63 +
    1.64 +all: $(DLLFILE) $(LIBFILE) .symbolic
    1.65 +
    1.66 +$(DLLFILE): $(OBJS) $(LNKFILE)
    1.67 +    wlink @$(LNKFILE)
    1.68 +
    1.69 +$(IMPLIB): $(DLLFILE)
    1.70 +    wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
    1.71 +
    1.72 +.c.obj:
    1.73 +    wcc386 $(CFLAGS) -fo=$^@ $<
    1.74 +
    1.75 +SDL_cpuinfo.obj: SDL_cpuinfo.c
    1.76 +    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    1.77 +
    1.78 +SDL_rwops.obj: SDL_rwops.c
    1.79 +    wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
    1.80 +
    1.81 +SDL_blendfillrect.obj: SDL_blendfillrect.c
    1.82 +    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    1.83 +
    1.84 +SDL_blendline.obj: SDL_blendline.c
    1.85 +    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    1.86 +
    1.87 +SDL_blendpoint.obj: SDL_blendpoint.c
    1.88 +    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
    1.89 +
    1.90 +SDL_RLEaccel.obj: SDL_RLEaccel.c
    1.91 +    wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
    1.92 +
    1.93 +$(LNKFILE):
    1.94 +    @%create $@
    1.95 +    @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
    1.96 +    @%append $@ NAME $(DLLFILE)
    1.97 +    @for %i in ($(OBJS)) do @%append $@ FILE %i
    1.98 +    @%append $@ OPTION QUIET
    1.99 +    @%append $@ OPTION IMPF=$(EXPFILE)
   1.100 +    @%append $@ OPTION MAP=$(MAPFILE)
   1.101 +    @%append $@ OPTION QUIET
   1.102 +    @%append $@ OPTION ELIMINATE
   1.103 +    @%append $@ OPTION MANYAUTODATA
   1.104 +    @%append $@ OPTION OSNAME='OS/2 and eComStation'
   1.105 +    @%append $@ OPTION SHOWDEAD
   1.106 +
   1.107 +clean: .SYMBOLIC
   1.108 +    @ echo * Clean: $(LIBNAME)
   1.109 +    @if exist *.obj rm *.obj
   1.110 +    @if exist *.err rm *.err
   1.111 +    @if exist $(LNKFILE) rm $(LNKFILE)
   1.112 +
   1.113 +distclean: .SYMBOLIC clean
   1.114 +    @if exist $(MAPFILE) rm $(MAPFILE)
   1.115 +    @if exist $(EXPFILE) rm $(EXPFILE)
   1.116 +    @if exist $(IMPLIB) rm $(IMPLIB)
   1.117 +    @if exist $(DLLFILE) rm $(DLLFILE)
     2.1 --- a/include/SDL_config.h	Sun Oct 14 23:55:02 2018 +0300
     2.2 +++ b/include/SDL_config.h	Sun Oct 14 23:56:56 2018 +0300
     2.3 @@ -41,8 +41,10 @@
     2.4  #include "SDL_config_android.h"
     2.5  #elif defined(__PSP__)
     2.6  #include "SDL_config_psp.h"
     2.7 +#elif defined(__OS2__)
     2.8 +#include "SDL_config_os2.h"
     2.9  #else
    2.10 -/* This is a minimal configuration just to get SDL running on new platforms */
    2.11 +/* This is a minimal configuration just to get SDL running on new platforms. */
    2.12  #include "SDL_config_minimal.h"
    2.13  #endif /* platform config */
    2.14  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/include/SDL_config_os2.h	Sun Oct 14 23:56:56 2018 +0300
     3.3 @@ -0,0 +1,169 @@
     3.4 +/*
     3.5 +  Simple DirectMedia Layer
     3.6 +  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
     3.7 +
     3.8 +  This software is provided 'as-is', without any express or implied
     3.9 +  warranty.  In no event will the authors be held liable for any damages
    3.10 +  arising from the use of this software.
    3.11 +
    3.12 +  Permission is granted to anyone to use this software for any purpose,
    3.13 +  including commercial applications, and to alter it and redistribute it
    3.14 +  freely, subject to the following restrictions:
    3.15 +
    3.16 +  1. The origin of this software must not be misrepresented; you must not
    3.17 +     claim that you wrote the original software. If you use this software
    3.18 +     in a product, an acknowledgment in the product documentation would be
    3.19 +     appreciated but is not required.
    3.20 +  2. Altered source versions must be plainly marked as such, and must not be
    3.21 +     misrepresented as being the original software.
    3.22 +  3. This notice may not be removed or altered from any source distribution.
    3.23 +*/
    3.24 +
    3.25 +#ifndef SDL_config_os2_h_
    3.26 +#define SDL_config_os2_h_
    3.27 +#define SDL_config_h_
    3.28 +
    3.29 +#include "SDL_platform.h"
    3.30 +
    3.31 +#define SDL_AUDIO_DRIVER_DUMMY 1
    3.32 +#define SDL_AUDIO_DRIVER_DISK 1
    3.33 +
    3.34 +#define SDL_JOYSTICK_DISABLED 1
    3.35 +#define SDL_HAPTIC_DISABLED 1
    3.36 +/*#undef SDL_JOYSTICK_HIDAPI */
    3.37 +
    3.38 +#define SDL_SENSOR_DUMMY 1
    3.39 +#define SDL_VIDEO_DRIVER_DUMMY 1
    3.40 +
    3.41 +/* Enable OpenGL support */
    3.42 +/* #undef SDL_VIDEO_OPENGL */
    3.43 +
    3.44 +/* Enable Vulkan support */
    3.45 +/* #undef SDL_VIDEO_VULKAN */
    3.46 +
    3.47 +#define SDL_LOADSO_DISABLED 1
    3.48 +#define SDL_THREADS_DISABLED 1
    3.49 +#define SDL_TIMERS_DISABLED 1
    3.50 +#define SDL_FILESYSTEM_DUMMY 1
    3.51 +
    3.52 +/* Enable assembly routines */
    3.53 +#define SDL_ASSEMBLY_ROUTINES 1
    3.54 +
    3.55 +/* #undef HAVE_LIBSAMPLERATE_H */
    3.56 +
    3.57 +/* Enable dynamic libsamplerate support */
    3.58 +/* #undef SDL_LIBSAMPLERATE_DYNAMIC */
    3.59 +
    3.60 +#define HAVE_LIBC 1
    3.61 +
    3.62 +#define HAVE_SYS_TYPES_H 1
    3.63 +#define HAVE_STDIO_H 1
    3.64 +#define STDC_HEADERS 1
    3.65 +#define HAVE_STDLIB_H 1
    3.66 +#define HAVE_STDARG_H 1
    3.67 +#define HAVE_STDDEF_H 1
    3.68 +#define HAVE_MALLOC_H 1
    3.69 +#define HAVE_MEMORY_H 1
    3.70 +#define HAVE_STRING_H 1
    3.71 +#define HAVE_STRINGS_H 1
    3.72 +#define HAVE_WCHAR_H 1
    3.73 +#define HAVE_INTTYPES_H 1
    3.74 +#define HAVE_STDINT_H 1
    3.75 +#define HAVE_LIMITS_H 1
    3.76 +#define HAVE_CTYPE_H 1
    3.77 +#define HAVE_MATH_H 1
    3.78 +#define HAVE_FLOAT_H 1
    3.79 +#define HAVE_SIGNAL_H 1
    3.80 +
    3.81 +#define HAVE_MALLOC 1
    3.82 +#define HAVE_CALLOC 1
    3.83 +#define HAVE_REALLOC 1
    3.84 +#define HAVE_FREE 1
    3.85 +#if defined(__WATCOMC__)
    3.86 +#define HAVE__FSEEKI64 1
    3.87 +#define HAVE__FTELLI64 1
    3.88 +#endif
    3.89 +#define HAVE_ALLOCA 1
    3.90 +#define HAVE_GETENV 1
    3.91 +#define HAVE_SETENV 1
    3.92 +#define HAVE_PUTENV 1
    3.93 +#define HAVE_QSORT 1
    3.94 +#define HAVE_ABS 1
    3.95 +#define HAVE_BCOPY 1
    3.96 +#define HAVE_MEMSET 1
    3.97 +#define HAVE_MEMCPY 1
    3.98 +#define HAVE_MEMMOVE 1
    3.99 +#define HAVE_MEMCMP 1
   3.100 +#define HAVE_WCSLEN 1
   3.101 +#define HAVE_WCSLCPY 1
   3.102 +#define HAVE_WCSLCAT 1
   3.103 +#define HAVE_WCSCMP 1
   3.104 +#define HAVE_STRLEN 1
   3.105 +#define HAVE_STRLCPY 1
   3.106 +#define HAVE_STRLCAT 1
   3.107 +#define HAVE__STRREV 1
   3.108 +#define HAVE__STRUPR 1
   3.109 +#define HAVE__STRLWR 1
   3.110 +#define HAVE_INDEX 1
   3.111 +#define HAVE_RINDEX 1
   3.112 +#define HAVE_STRCHR 1
   3.113 +#define HAVE_STRRCHR 1
   3.114 +#define HAVE_STRSTR 1
   3.115 +#define HAVE_ITOA 1
   3.116 +#define HAVE__LTOA 1
   3.117 +#define HAVE__ULTOA 1
   3.118 +#define HAVE_STRTOL 1
   3.119 +#define HAVE_STRTOUL 1
   3.120 +#define HAVE__I64TOA 1
   3.121 +#define HAVE__UI64TOA 1
   3.122 +#define HAVE_STRTOLL 1
   3.123 +#define HAVE_STRTOULL 1
   3.124 +#define HAVE_STRTOD 1
   3.125 +#define HAVE_ATOI 1
   3.126 +#define HAVE_ATOF 1
   3.127 +#define HAVE_STRCMP 1
   3.128 +#define HAVE_STRNCMP 1
   3.129 +#define HAVE_STRICMP 1
   3.130 +#define HAVE_STRCASECMP 1
   3.131 +#define HAVE_STRNCASECMP 1
   3.132 +#define HAVE_SSCANF 1
   3.133 +#define HAVE_SNPRINTF 1
   3.134 +#define HAVE_VSNPRINTF 1
   3.135 +#define HAVE_SETJMP 1
   3.136 +#define HAVE_ACOS 1
   3.137 +/* #undef HAVE_ACOSF */
   3.138 +#define HAVE_ASIN 1
   3.139 +/* #undef HAVE_ASINF */
   3.140 +#define HAVE_ATAN 1
   3.141 +#define HAVE_ATAN2 1
   3.142 +/* #undef HAVE_ATAN2F */
   3.143 +#define HAVE_CEIL 1
   3.144 +/* #undef HAVE_CEILF */
   3.145 +/* #undef HAVE_COPYSIGN */
   3.146 +/* #undef HAVE_COPYSIGNF */
   3.147 +#define HAVE_COS 1
   3.148 +/* #undef HAVE_COSF */
   3.149 +#define HAVE_EXP 1
   3.150 +/* #undef HAVE_EXPF */
   3.151 +#define HAVE_FABS 1
   3.152 +/* #undef HAVE_FABSF */
   3.153 +#define HAVE_FLOOR 1
   3.154 +/* #undef HAVE_FLOORF */
   3.155 +#define HAVE_FMOD 1
   3.156 +/* #undef HAVE_FMODF */
   3.157 +#define HAVE_LOG 1
   3.158 +/* #undef HAVE_LOGF */
   3.159 +#define HAVE_LOG10 1
   3.160 +/* #undef HAVE_LOG10F */
   3.161 +#define HAVE_POW 1
   3.162 +/* #undef HAVE_POWF */
   3.163 +#define HAVE_SIN 1
   3.164 +/* #undef HAVE_SINF */
   3.165 +/* #undef HAVE_SCALBN */
   3.166 +/* #undef HAVE_SCALBNF */
   3.167 +#define HAVE_SQRT 1
   3.168 +/* #undef HAVE_SQRTF */
   3.169 +#define HAVE_TAN 1
   3.170 +/* #undef HAVE_TANF */
   3.171 +
   3.172 +#endif /* SDL_config_os2_h_ */