diff --git a/acinclude.m4 b/acinclude.m4 index ef5f957e1..25f3d68dc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -565,7 +565,7 @@ AC_DEFUN([GB_SHARED_LIBRARY_EXT], case "${host}" in *-*-cygwin* ) SHLIBEXT="la" - AC_DEFINE(SHARED_LIBRARY_EXT, "la", [Shared library extension is '.la']) + AC_DEFINE(SHARED_LIBRARY_EXT, "dll", [Shared library extension is '.dll']) ;; *-*-darwin* ) SHLIBEXT="dylib" diff --git a/app/src/gambas3/.src/Welcome/FSystemInfo.class b/app/src/gambas3/.src/Welcome/FSystemInfo.class index 07780a5c6..3153012f9 100644 --- a/app/src/gambas3/.src/Welcome/FSystemInfo.class +++ b/app/src/gambas3/.src/Welcome/FSystemInfo.class @@ -76,10 +76,14 @@ Static Private Sub GetDistribution() As String Next - sDistro = File.Load("/etc/issue") - If sDistro Then - iPos = InStr(sDistro, "\\") - If iPos Then sDistro = Left(sDistro, iPos - 1) + If Exist("/etc/issue") Then + sDistro = File.Load("/etc/issue") + If sDistro Then + iPos = InStr(sDistro, "\\") + If iPos Then sDistro = Left(sDistro, iPos - 1) + Endif + Else + Exec ["uname", "-s"] To sDistro Endif Return Trim(sDistro) @@ -129,9 +133,13 @@ Static Public Sub GetInfo() As String[] Try sTemp = Format(CInt(sTemp) / 1024, "0") & "M" If Not Error Then aText.Add("Memory=" & sTemp) Endif - - cSearch = ["Qt4": "libQtCore.so.*.*.*", "GTK+": "libgtk-x11-2*.so.*.*.*", "GTK+3": "libgtk-3*.so.*.*.*", "SDL": "libSDL-1.*.so.*.*.*", "GStreamer": "libgstreamer-*.so.*.*.*", "Poppler": "libpoppler.so.*.*.*", "Curl": "libcurl.so.*.*.*", - "OpenGL": "libGL.so.*.*.*", "Cairo": "libcairo.so.*.*.*", "DBus": "libdbus-[0-9].so.*.*.*"] + If System.Family = "Cygwin" Then + cSearch = ["Qt4": "libQtCore.dll.a", "GTK+": "libgtk-x11-2*.dll.a", "SDL": "libSDL*.dll.a", "GStreamer": "libgstreamer-*.dll.a", "Poppler": "libpoppler.dll.a", "Curl": "libcurl.dll.a", "OpenGL": "libGL.dll.a", + "Cairo": "libcairo.dll.a", "DBus": "libdbus-[0-9].dll.a"] + Else + cSearch = ["Qt4": "libQtCore.so.*.*.*", "GTK+": "libgtk-x11-2*.so.*.*.*", "GTK+3": "libgtk-3*.so.*.*.*", "SDL": "libSDL-1.*.so.*.*.*", "GStreamer": "libgstreamer-*.so.*.*.*", "Poppler": "libpoppler.so.*.*.*", "Curl": "libcurl.so.*.*.*", + "OpenGL": "libGL.so.*.*.*", "Cairo": "libcairo.so.*.*.*", "DBus": "libdbus-[0-9].so.*.*.*"] + EndIf cFile = New Collection aText.Add("[Libraries]") diff --git a/gb.jit/src/Makefile.am b/gb.jit/src/Makefile.am index 77fcf7c43..fda4d4ae6 100644 --- a/gb.jit/src/Makefile.am +++ b/gb.jit/src/Makefile.am @@ -8,4 +8,4 @@ gb_jit_la_LDFLAGS = -module @LD_FLAGS@ @JIT_LDFLAGS@ gb_jit_la_CPPFLAGS = @JIT_INC@ gb_jit_la_CXXFLAGS = $(AM_CXXFLAGS) -std=gnu++0x -fno-exceptions -gb_jit_la_SOURCES = gb.jit.h jit_api.cpp jit_codegen_conv.h jit_codegen.cpp jit_compile.cpp jit_conv.cpp jit_expressions.cpp jit.h jit_read.cpp jit_runtime.c jit_runtime.h jit_gambas_pass.cpp jit_gambas_pass.h jit_gambas_pass_dummy.cpp main.cpp main.h +gb_jit_la_SOURCES = gb.jit.h jit_api.cpp jit_codegen_conv.h jit_codegen.cpp jit_compile.cpp jit_conv.cpp jit_expressions.cpp jit.h jit_read.cpp jit_runtime.c jit_runtime.h jit_gambas_pass.cpp jit_gambas_pass.h main.cpp main.h diff --git a/gb.jit/src/jit_codegen.cpp b/gb.jit/src/jit_codegen.cpp index 35e1f9942..b2a70985f 100644 --- a/gb.jit/src/jit_codegen.cpp +++ b/gb.jit/src/jit_codegen.cpp @@ -65,6 +65,12 @@ extern "C" { #define LONG_TYPE (TARGET_BITS == 64 ? llvmType(getInt64Ty) : llvmType(getInt32Ty)) +#ifdef __CYGWIN__ +#define __finite finite +#define __isnan __isnand +#define __isinf __isinfd +#endif + const size_t TYPE_sizeof_memory_tab[16] = { 0, 1, 1, 2, 4, 8, 4, 8, 8, sizeof(void *), sizeof(void *), sizeof(void *), sizeof(VARIANT), 0, 0, 0 }; ///DEBUG diff --git a/gb.jit/src/jit_codegen_conv.h b/gb.jit/src/jit_codegen_conv.h index 14023b8c5..09e30f6ff 100644 --- a/gb.jit/src/jit_codegen_conv.h +++ b/gb.jit/src/jit_codegen_conv.h @@ -31,6 +31,10 @@ extern "C" { #include "gb_common_buffer.h" } +#ifdef __CYGWIN__ +#define __finite finite +#endif + llvm::Value* JIT_conv_to_variant(Expression* value, llvm::Value* val, bool on_stack, bool* no_ref_variant){ llvm::Value* ret; if (TYPE_is_string(value->type)){ diff --git a/gb.jit/src/jit_gambas_pass.cpp b/gb.jit/src/jit_gambas_pass.cpp index 181489eb5..ab73edf41 100644 --- a/gb.jit/src/jit_gambas_pass.cpp +++ b/gb.jit/src/jit_gambas_pass.cpp @@ -38,6 +38,14 @@ #include "main.h" +#ifdef __CYGWIN__ +#define __finite finite +#define __isnan __isnand +#define __isinf __isinfd +#endif +#define FUNCTION_NAME(s) _FN(s) +#define _FN(s) #s + using namespace llvm; namespace { @@ -94,7 +102,7 @@ bool GambasPass::runOnFunction(Function &F){ CI->eraseFromParent(); changed = true; - } else if (name == "__finite"){ + } else if (name == FUNCTION_NAME(__finite)){ ConstantFP* op = dyn_cast(CI->getArgOperand(0)); if (!op) continue; @@ -104,7 +112,7 @@ bool GambasPass::runOnFunction(Function &F){ CI->replaceAllUsesWith(res); CI->eraseFromParent(); changed = true; - } else if (name == "__isnan"){ + } else if (name == FUNCTION_NAME(__isnan)){ ConstantFP* op = dyn_cast(CI->getArgOperand(0)); if (!op) continue; @@ -114,7 +122,7 @@ bool GambasPass::runOnFunction(Function &F){ CI->replaceAllUsesWith(res); CI->eraseFromParent(); changed = true; - } else if (name == "__isinf"){ + } else if (name == FUNCTION_NAME(__isinf)){ ConstantFP* op = dyn_cast(CI->getArgOperand(0)); if (!op) continue; diff --git a/gb.jit/src/jit_gambas_pass_dummy.cpp b/gb.jit/src/jit_gambas_pass_dummy.cpp deleted file mode 100644 index 922b2f421..000000000 --- a/gb.jit/src/jit_gambas_pass_dummy.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// I found no easy way to compile jit_gambas_pass.cpp with -no-rtti as CXXFLAGS while still -// have rtti enabled for jit_codegen.cpp ... - -extern "C" { - void* _ZTIN4llvm12FunctionPassE; -} diff --git a/gb.net/src/CSerialPort.c b/gb.net/src/CSerialPort.c index 5f4035cb1..f8ac59dc6 100644 --- a/gb.net/src/CSerialPort.c +++ b/gb.net/src/CSerialPort.c @@ -34,6 +34,8 @@ #ifdef __CYGWIN__ /* Cygwin defines FIONREAD in . */ #include +/* TIOCOUTQ is not implemented on Cygwin */ +#define TIOCOUTQ ((unsigned int) -1) #endif /* __CYGWIN__ */ #include "main.h" diff --git a/gb.sdl.sound/configure.ac b/gb.sdl.sound/configure.ac index 1b1b3516c..e332cad83 100644 --- a/gb.sdl.sound/configure.ac +++ b/gb.sdl.sound/configure.ac @@ -15,7 +15,7 @@ GB_COMPONENT( sdlsound, SDLSOUND, gb.sdl.sound, [src], [GB_FIND(SDL_mixer.h SDL_cdrom.h, `sdl-config --prefix`, include/SDL)], [GB_FIND(libSDL_mixer.$SHLIBEXT, /usr /usr/local `sdl-config --prefix`, lib)], - [-lSDL_mixer], + [-lSDL_mixer -lSDL], [$SDL_CFLAGS]) AC_OUTPUT( \ diff --git a/main/gbx/gbx_c_task.c b/main/gbx/gbx_c_task.c index e63bf28f0..2a871aea1 100644 --- a/main/gbx/gbx_c_task.c +++ b/main/gbx/gbx_c_task.c @@ -46,6 +46,9 @@ #include "gbx_c_task.h" //#define DEBUG_ME 1 +#ifdef __CYGWIN__ +#define FIONREAD TIOCINQ +#endif DECLARE_EVENT(EVENT_Read); DECLARE_EVENT(EVENT_Error); diff --git a/main/share/gambas.h b/main/share/gambas.h index d589349a4..456fb9017 100644 --- a/main/share/gambas.h +++ b/main/share/gambas.h @@ -24,6 +24,10 @@ #ifndef __GAMBAS_H #define __GAMBAS_H +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include #include diff --git a/main/share/gb_common_case.h b/main/share/gb_common_case.h index d1d2d094f..136b9624b 100644 --- a/main/share/gb_common_case.h +++ b/main/share/gb_common_case.h @@ -24,6 +24,10 @@ #ifndef __GB_COMMON_CASE_H #define __GB_COMMON_CASE_H +#ifdef __CYGWIN__ +#include +#endif + #include #include