I tried to send this a couple of days ago, but apparently the entire
message was too big... might have been because of forwards. Anyway,
this is how I got chicken 2.3 running with MINGW.
Patrick
=====================================================================
Building Chicken With Mingw and Msys
You probably don't need all of the packages listed, but at a minimum
you will need the mingw-runtime, gcc, w32api, and msys packages. I
installed the others.
*** You have to have sed on the path for make and gunzip on the path for
chicken-setup. Either use the unix-utils package from http://unxutils.sourceforge.net/ or install the msysDTK.
1. Extract the gz files into C:\mingw. If you put them anywhere
else you will need to adjust all paths accordingly
2. Run the msys installer. It will run a script following the install.
As the script runs you will be prompted for two items:
- Where is you mingw? Enter the correct location.
- Make fstab entries? Say yes.
3. Do whatever you decided to get sed and gunzip. Just make sure they
are on the path.
You should be done with mingw setup at this point.
======================================================================
Alternate setup using Dev-C++ Bloodshed Dev-C++
Packages - I used the package updater to get/update win32, gcc,
and binutils.
TODO - Finish this. It does work, just set different paths in the batch file.
======================================================================
Set up the path with a batch file
Set your path and start a command prompt using something like this
batch file:
REM Don't use backslashes for anything used in the make file
set MINGW_HOME=C:/mingw
set MINGW_PATH=%MINGW_HOME%/bin;C:/msys/1.0/bin
set CHICKEN_HOME=C:/working/mingw-only/chicken-2.3
set PATH=%CHICKEN_HOME%;%MINGW_PATH%;C:/WINDOWS/system32
set INCLUDE=%CHICKEN_HOME%
set CHICKEN_INCLUDE_PATH=%CHICKEN_HOME%
set CHICKEN_LIB_DIR=%CHICKEN_HOME%
set LIB=%CHICKEN_HOME%;%MINGW_HOME%/lib
REM Must use backslashes or chicken-setup will fail on windows
set CHICKEN_REPOSITORY=C:\working\mingw-only\chicken-2.3\repo
cmd.exe
Now you can just run this batch file to get a working environment.
*** Don't forget sed and gunzip.
I recommend that you eliminate all extraneous path entries. I ran into
some strange linking issues with some of my standard path entries.
======================================================================
Change these files:
*** csc.scm.in
Line 105
remove '-DHAVE_CHICKEN_CONFIG '
Line 185 should be:
(define default-library-files '("%staticlibfiles%"))
Line 529 should be:
(set! compile-options (cons* "-DC_SHARED" compile-options))
*** chicken.h
Line 80 should be
# if defined(__CYGWIN__)
======================================================================
Issues and TODO
*** The method that csc.scm uses to obtain tool locations is unusual.
It would be nice if it used environment variables instead. Maybe
I don't have the big picture on this. Some things can be passed as
arguments, but not everything. In general csc.scm.in needs to be
fixed to handle MINGW properly.
*** Update the command part of this doc to match the batch file.
*** This probably works with CYGWIN set up for MINGW building.
*** Figure out if all the MINGW packages listed are needed.
======================================================================
Makefile.mingw
======================================================================
CC = gcc
CXX = g++
# If you remove the -DPIC the build works fine. With it the dll will not link.
CFLAGS = -Os -DC_DEFAULT_TARGET_STACK_SIZE=300000 -DC_STACK_GROWS_DOWNWARD=1 \
-DNO_PIC_NO_DLL -DHAVE_LOADLIBRARY -DHAVE_GETPROCADDRESS -DHAVE_WINDOWS_H \
-Wno-unused -Wno-uninitialized -I$(CHICKEN_INCLUDE_PATH)
# Strip after linking because it is so big. Figure this out
chicken.exe: $(CHICKEN_OBJS) libchicken.dll
$(CC) -o$@ $(CHICKEN_OBJS) $(SHARED_LFLAGS) -lchicken $(WINLIBS)
strip --strip-unneeded $@
#CSC
# Added a dependency to the static lib so we can build static exes
csc.exe: $O/csc.o libchicken.a
$(CC) $(SHARED_LFLAGS) csc.o -o$@ -lchicken $(WINLIBS)