esseks / monicelli

An esoteric programming language, come se fosse antani.
GNU General Public License v3.0
1.32k stars 52 forks source link

OSX support, requires bison from brew #8

Closed gsora closed 9 years ago

esseks commented 9 years ago

Could you please give the cmake branch a try and see if it works without extra configuration? Your command line should look like:

CMAKE_PREFIX_PATH=/usr/local/opt/bison cmake path/to/repo
make

find_program is used under the hood to locate bison, so refer to the docs for a full list of environment variables that can be used to force certain paths. I might also consider adding something like:

# Homebrew compat for Mac OS X
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/bison)

in the script, if it works.

The rationale behind having a plain Makefile was keeping things simple. However, if it has to grow into a full fledged script, maybe switching to CMake (i.e. merging into master) could be worth it.

massix commented 9 years ago

Hello, I can confirm it is working properly using the cmake branch

~/developer/monicelli/build [cmake] $ CMAKE_PREFIX_PATH=/usr/local/Cellar/bison/3.0.2/bin/ cmake ..
-- The C compiler identification is AppleClang 6.0.0.6000056
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found BISON: /usr/local/Cellar/bison/3.0.2/bin/bison (found version "3.0.2") 
-- Found FLEX: /usr/bin/flex (found version "2.5.35") 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/massi/Developer/monicelli/build
~/developer/monicelli/build [cmake] $ make
[ 16%] [FLEX][Scanner] Building scanner with flex 2.5.35
[ 33%] [BISON][Parser] Building parser with bison 3.0.2
Scanning dependencies of target mcc
[ 50%] Building CXX object CMakeFiles/mcc.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/mcc.dir/Nodes.cpp.o
[ 83%] Building CXX object CMakeFiles/mcc.dir/Parser.cpp.o
[100%] Building CXX object CMakeFiles/mcc.dir/Lexer.cpp.o
Linking CXX executable mcc
[100%] Built target mcc
~/developer/monicelli/build [cmake] $ 

:+1:

esseks commented 9 years ago

At this point, merging the CMake branch appears to be the best option. We also get free Visual Studio/XCode support.

@peppelakappa @massix any comment?

massix commented 9 years ago

IMHO the Cmake branch brings a lot of added values:

On the other hand, I'm not that unhappy with the current Makefile, on OS X it is enough to just issue the make with a modified PATH, i.e.:

$ PATH=/ousr/local/opt/bison/bin make

I'm at work right now and I cannot access my personal laptop so you just have to believe my words when I say that it works properly. On Ubuntu it works just fine.

All things considered, I'd merge the cmake branch, but the final decision is up to you.

esseks commented 9 years ago

My opinion is that CMake offers several advantages over a plain Makefile, which is why I bothered to mantain a cmake branch in the first place. Also, CMake is quite stable and widely adopted (cfr. the KDE software compilation).

However, it adds an extra build requirement. That's why I wanted to poll fellow developers and take into account different opinions wrt such a change before merging.

esseks commented 9 years ago

20 addresses this issue for the new CMake-based build system. Closing.