Open IngwiePhoenix opened 5 years ago
Well, I got to this point here now:
Ingwie@Ingwies-Macbook-Pro.local ~/W/G/d/out $ gcc ../kernel/*.c -o dao -DDAO_WITH_NUMARRAY -DDAO_WITH_THREAD -DDAO_WITH_CONCURRENT -DDAO_WITH_RESTART -DTARGET_PLAT=\"macosx\" -DBSD=2 -DMACOSX=3 -DUNIX=1 -DDAO_USE_READLINE -DTRACING_ON -lreadline ../modules/stream/*.c ../modules/auxlib/*.c -I ../kernel/ -I ../modules/auxlib/ -undefined dynamic_lookup -fPIC
Ingwie@Ingwies-Macbook-Pro.local ~/W/G/d/out $ ./dao ../tools/filetools/archive.dao
dyld: Symbol not found: __DaoFileStream_Close
Referenced from: /Users/Ingwie/Work/Git/dao/out/./dao
Expected in: flat namespace
in /Users/Ingwie/Work/Git/dao/out/./dao
fish: './dao ../tools/filetools/archiv…' terminated by signal SIGABRT (Abort)
From what I can tell, the usage of DAO_API(...)
is causing troubble. This is a static compile, so the functions and signatures should pretty simply be defined "as normal" instead of being exported or anything. Would be nice to have that updated! :)
nm
reports this:
Ingwie@Ingwies-Macbook-Pro.local ~/W/G/d/out $ nm dao | grep DaoFileStream_Close
00000001000ee390 T _DaoFileStream_Close
U __DaoFileStream_Close
Looks like the one being needed is "undefined". I am ... rather surprised.
Oh... Using -rdynamic
helped some - didn't fix the issue, unfortunately...
gcc \
-I ../kernel/ \
-I ../modules/ \
-I ../modules/stream/ \
-I ../modules/auxlib/ \
-I ../modules/debugger/ \
-I ../modules/profiler/ \
../kernel/*.c \
../modules/stream/*.c \
../modules/debugger/*.c \
../modules/auxlib/*.c \
../modules/profiler/*.c \
-DBSD \
-DUNIX \
-DMACOSX \
-DPLAT=\"macosx\" \
-DDAO_WITH_THREAD \
-DDAO_WITH_CONCURRENT \
-DDAO_WITH_NUMARRAY \
-DDAO_USE_READLINE \
-DTRACING_ON \
-lreadline \
-DDAO_HAS_STREAM \
-DDEBUG \
-o dao \
-rdynamic
I'm... so confused on how to get this to work. :/
@IngwiePhoenix sorry for not getting back to you earlier (I'm currently moving to another country and changing my job...). I'll get back to you later.
On the first sight I can tell, that the use of daomake is the only supported way of compiling Dao. Though it should be possible to instruct daomake to compile an all-static binary IIRC.
Ahh, well that's understandable. Good luck on that! =)
Being able to disassemble the build steps so I can port it to a different build system - which is more convenient to myself - would be very nice. That is why I have been trying to compile Dao straight off the commandline with no build tool in order to reproduce how to compile Dao - without Daomake.
Once you have the time, it'd be nice to hear from you how I could achieve this. Thank you in advance :)
So, I finally found some time and thought a little bit about your effort.
First thing you shall probably know is, that Daomake is basically a standalone pure Dao interpreter but providing few built-in additional classes, objects, routines and constants useful for automated generation of system-specific, more or less POSIX-compliant Makefile
s for the make
on your system.
Daomake exists because it's super easy and extremely advantageous to leverage basically the biggest in the world mechanism for anything system-specific - which is the C compiler toolchain. This is then compiled on your platform in a form of Daomake which in turn is a super thin layer providing unified interface (used in all makefile.dao
s) and guaranteeing compatibility with your system at least on the same level as C compiler toolchain would guarantee. Therefore each makefile.dao
is just a Dao script generating a Makefile
for make
.
In this light you could proceed like this.
Makefile
s for your system with proper dependencies among them, settings and flags - use these Makefile
s as templates for writing Premake(ex.)/cmake/... files
I was trying to find out how I could compile an all-static binary, but it doesnt load
stream
now...Any idea on how I could fix this? Thanks!