From: Michael D. Lowis Date: Sat, 26 Jul 2014 01:04:03 +0000 (-0400) Subject: Fixed cross-platform issues on OSX and Linux, cygwin still up in the air X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=e860a41584f549b2a847f75fbaa664fdfc0014c8;p=archive%2Fafm.git Fixed cross-platform issues on OSX and Linux, cygwin still up in the air --- diff --git a/Rakefile b/Rakefile index 24413c2..f3d8e46 100644 --- a/Rakefile +++ b/Rakefile @@ -20,11 +20,28 @@ end # Build Environment #------------------------------------------------------------------------------ Env = Rscons::Environment.new do |env| + env.build_dir('source','build/obj/source') + env.build_dir('modules','build/obj/modules') + env['LIBS'] = ['ncurses'] env['CPPPATH'] += Dir['modules/data-structures/source/**/'] #env['CFLAGS'] += ['-Wall'] - env['CFLAGS'] += ['-Werror', '-pedantic', '--std=gnu99'] - #env['CFLAGS'] += ['-D_GNU_SOURCE', '-D_XOPEN_SOURCE=700'] - env['LIBS'] = ['ncurses'] + env['CFLAGS'] += ['-Werror', '-pedantic', '--std=c99'] + + # Platform-specific Defines + # ------------------------- + if RUBY_PLATFORM =~ /linux/ + env['CFLAGS'] += [ + '-D_GNU_SOURCE', + '-D_XOPEN_SOURCE=700' + ] + elsif RUBY_PLATFORM =~ /cygwin/ + # TODO + elsif RUBY_PLATFORM =~ /darwin/ + env['CFLAGS'] += [ + '-D_DARWIN_C_SOURCE', + '-D__DARWIN_C_LEVEL=199506L' + ] + end end at_exit { Env.process } diff --git a/source/main.c b/source/main.c index 665f9a7..23b1cf1 100644 --- a/source/main.c +++ b/source/main.c @@ -13,14 +13,13 @@ #include "workdir.h" void handle_signal(int sig) { - //signal(SIGWINCH, handle_signal); state_set_screen_dirty(true); state_set_screen_resized(true); } int main(int argc, char** argv) { /* Handle terminal resizing */ - //signal(SIGWINCH, handle_signal); + signal(SIGWINCH, handle_signal); /* Initialize ncurses and user input settings */ initscr(); raw();