[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] -DC_INSTALL_LIB_HOME and -DC_INSTALL_HOME
From: |
Hans Bulfone |
Subject: |
[Chicken-users] -DC_INSTALL_LIB_HOME and -DC_INSTALL_HOME |
Date: |
Mon, 28 Aug 2006 16:41:12 +0200 |
User-agent: |
Mutt/1.5.9i |
hi,
i just came across the following problem using chicken 2.41 on a linux system:
address@hidden:~/test$ cat test.scm
(define-foreign-variable installation-home c-string "C_INSTALL_HOME")
(printf "C_INSTALL_HOME = ~s\n" installation-home)
address@hidden:~/test$ csc -v test.scm
/usr/local/bin/chicken test.scm -output-file test.c -quiet
gcc test.c -o test.o -c -DHAVE_CHICKEN_CONFIG_H -Os -fomit-frame-pointer
-fno-strict-aliasing -Wall -Wno-unused -Wno-uninitialized -DHAVE_ALLOCA_H
-DC_ENABLE_PTABLES -DC_STACK_GROWS_DOWNWARD=1
-DC_INSTALL_LIB_HOME="/usr/local/lib/chicken/1"
-DC_INSTALL_HOME="/usr/local/share/chicken" -DC_USE_C_DEFAULTS -DC_NO_PIC_NO_DLL
test.c: In function `f_18':
test.c:122: error: syntax error before '/' token
test.c:122: error: too many arguments to function `C_mpointer'
test.c:122: error: syntax error before ';' token
*** Shell command terminated with exit status 1: gcc test.c -o test.o -c
-DHAVE_CHICKEN_CONFIG_H -Os -fomit-frame-pointer -fno-strict-aliasing -Wall
-Wno-unused -Wno-uninitialized -DHAVE_ALLOCA_H -DC_ENABLE_PTABLES
-DC_STACK_GROWS_DOWNWARD=1 -DC_INSTALL_LIB_HOME="/usr/local/lib/chicken/1"
-DC_INSTALL_HOME="/usr/local/share/chicken" -DC_USE_C_DEFAULTS -DC_NO_PIC_NO_DLL
address@hidden:~/test$
the problem are missing quotes around C_INSTALL_LIB_HOME and C_INSTALL_HOME.
the quotes that are there are taken by the shell but additional ones are
needed by the c compiler:
address@hidden:~/test$ gcc test.c -o test.o -c -DHAVE_CHICKEN_CONFIG_H -Os
-fomit-frame-pointer -fno-strict-aliasing -Wall -Wno-unused -Wno-uninitialized
-DHAVE_ALLOCA_H -DC_ENABLE_PTABLES -DC_STACK_GROWS_DOWNWARD=1
-DC_INSTALL_LIB_HOME="\"/usr/local/lib/chicken/1\""
-DC_INSTALL_HOME="\"/usr/local/share/chicken\"" -DC_USE_C_DEFAULTS
-DC_NO_PIC_NO_DLL
address@hidden:~/test$ csc -v -o test test.o
gcc test.o -lchicken -o test -L/usr/local/lib -Wl,-R/usr/local/lib -ldl -lpcre
-lffi -lm -ldl -lpcre -lffi -lchicken
address@hidden:~/test$ ./test
C_INSTALL_HOME = "/usr/local/share/chicken"
address@hidden:~/test$
i don't know if this bug has already been fixed in the current darcs version
(as there has been some discussion about quotes on the list lately),
i just wanted to report it in case it isn't.
bye,
hans.
- [Chicken-users] -DC_INSTALL_LIB_HOME and -DC_INSTALL_HOME,
Hans Bulfone <=