Merci, j'ai conpris ...
J'ai mis a jour WVS (fichier make-makefile.py)
Ce que fait le makefile:
- Il décompacte le script make_makefile (écrit en python) qui crée des fichiers headers très potables à partir de fichiers sources
- il crée le fichier include.c qui est identique à index.c à part qu'au lieu d'inclure les fichiers .c à la fin, il inclus les fichiers .h
- Il crée les fichiers source-bis.c à partir de la liste des #include de index.c. La seule modification est qu'il inclus include.c au début
- Il compile un à un ces fichiers .c
- si ca marche, il crée la bibliothèque
Pour le moment, ca coince sur la comoilation séparée des fichiers objets. Peut-être pourras tu maider.
Voici l'erreur:
Code:
gcc raydium/background-bis.c -o raydium/background.o -Wall -L/usr/X11R6/lib/ -Iode/include/ -Iphp/ -Iphp/include -Iphp/main/ -Iphp/Zend -Iphp/TSRM
raydium/php.c.h:108: attention : « sapi_raydium_send_headers » utilisé mais n'a jamais été défini
raydium/php.c.h:109: attention : « sapi_raydium_send_header » utilisé mais n'a jamais été défini
raydium/php.c.h:110: attention : « php_dummy » utilisé mais n'a jamais été défini
raydium/php.c.h:113: attention : `raydium_sapi_module' defined but not used
[edit] J'ai modifié makefile_header pour que le mot chef "static" au début des lignes disparaissent. Ce problème n'existe plus.
Reste le problème suivant:
Code:
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:98: undefined reference to `main'
/tmp/ccSXtIAd.o(.text+0x27): In function `raydium_background_color_change':
: undefined reference to `raydium_clear_color_update'
/tmp/ccSXtIAd.o(.text+0x2c): In function `raydium_background_color_change':
: undefined reference to `raydium_fog_color_update'
/tmp/ccSXtIAd.o(.data+0xe8): undefined reference to `php_dummy'
/tmp/ccSXtIAd.o(.data+0xec): undefined reference to `php_dummy'
/tmp/ccSXtIAd.o(.data+0xf8): undefined reference to `raydium_php_uwrite'
/tmp/ccSXtIAd.o(.data+0x108): undefined reference to `raydium_php_error'
/tmp/ccSXtIAd.o(.data+0x110): undefined reference to `sapi_raydium_send_headers'
/tmp/ccSXtIAd.o(.data+0x114): undefined reference to `sapi_raydium_send_header'
collect2: ld a retourné 1 code d'état d'exécution
make: *** [raydium/background.o] Erreur 1
et le fichier raydium/php.c.h généré par le script python "make_header":
Code:
$ grep -n "" raydium/php.c.h
1:#ifndef _PHP_C_H
2:#define _PHP_C_H
3:
4:// PHP support for Raydium
5:/* #include "php_wrappers.c" */
6:// C prototype to PHP function wrappers:
7:// PHP_ReturnType_Arg1TypeArg2Type...(function to wrap)
8:// v stands for: void
9:// i stands for: int
10:// f stands for: float
11:// s stands for: char *
12:// svaria stands for: (char *, ...)
13:// Don't forget to register your functions, too ! (see register.c or docs)
14:// void f(void)
15:#define PHP_v_v(fname)\
16:ZEND_FUNCTION(fname)\
17:{\
18:fname();\
19:}
20:// void f(int)
21:#define PHP_v_i(fname)\
22:ZEND_FUNCTION(fname)\
23:{\
24:int a;\
25:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
26: "l", &a) == FAILURE) return;\
27:fname(a);\
28:}
29:// int f(int)
30:#define PHP_i_i(fname)\
31:ZEND_FUNCTION(fname)\
32:{\
33:int a;\
34:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
35: "l", &a) == FAILURE) return;\
36:RETURN_LONG(fname(a));\
37:}
38:// int f(int, int)
39:#define PHP_i_ii(fname)\
40:ZEND_FUNCTION(fname)\
41:{\
42:int a,b;\
43:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
44: "ll", &a, &b) == FAILURE) return;\
45:RETURN_LONG(fname(a,b));\
46:}
47:// int f(int,float)
48:#define PHP_i_if(fname)\
49:ZEND_FUNCTION(fname)\
50:{\
51:int a;\
52:double b;\
53:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
54: "ld", &a, &b) == FAILURE) return;\
55:RETURN_LONG(fname(a,b));\
56:}
57:// void f(float, float, float) - double, too
58:#define PHP_v_fff(fname)\
59:ZEND_FUNCTION(fname)\
60:{\
61:double a,b,c;\
62:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
63: "ddd", &a, &b, &c) == FAILURE) return;\
64:fname(a,b,c);\
65:}
66:// int f(char *)
67:#define PHP_i_s(fname)\
68:ZEND_FUNCTION(fname)\
69:{\
70:char *a;\
71:int s_len;\
72:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
73: "s", &a, &s_len) == FAILURE) return;\
74:RETURN_LONG(fname(a));\
75:}
76:// void f(char *)
77:#define PHP_v_s(fname)\
78:ZEND_FUNCTION(fname)\
79:{\
80:char *a;\
81:int s_len;\
82:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
83: "s", &a, &s_len) == FAILURE) return;\
84:fname(a);\
85:}
86:// void f(char *, ...) - (printf style)
87:#define PHP_v_svaria(fname)\
88:ZEND_FUNCTION(fname)\
89:{\
90:char *a;\
91:int s_len;\
92:if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\
93: "s", &a, &s_len) == FAILURE) return;\
94:fname("%s",a);\
95:}
96:/* END #include "php_wrappers.c" */
97:// use this macro when registering your functions
98:#define C2PHP ZEND_FN
99:// Dirty globals... (needed for WIN32 PHP support)
100:#ifdef ZTS
101:zend_compiler_globals *compiler_globals;
102:zend_executor_globals *executor_globals;
103:php_core_globals *core_globals;
104:sapi_globals_struct *sapi_globals;
105:void ***tsrm_ls;
106:#endif
107:int raydium_init_cli_option (char *option, char *value);
108:static int sapi_raydium_send_headers (sapi_headers_struct * sapi_headers TSRMLS_DC);
109:static void sapi_raydium_send_header (sapi_header_struct * sapi_header, void *server_context TSRMLS_DC);
110:static int php_dummy (sapi_module_struct * sapi_module);
111:void raydium_php_error (int type, const char *msg, ...);
112:int raydium_php_uwrite (const char *str, uint str_length TSRMLS_DC);
113:static sapi_module_struct raydium_sapi_module = {
114: "RayHandler", /* name */
115: "Raydium PHP Handler", /* pretty name */
116: // Since PHP@Win32 is dirty... :
117: php_dummy, /* startup */
118: php_dummy, /* shutdown */
119: NULL, /* activate */
120: NULL, /* deactivate */
121: raydium_php_uwrite, /* unbuffered write */
122: NULL, /* flush */
123: NULL, /* get uid */
124: NULL, /* getenv */
125: raydium_php_error, /* error handler */
126: NULL, /* header handler */
127: sapi_raydium_send_headers, /* send headers handler */
128: sapi_raydium_send_header, /* send header handler */
129: NULL, /* read POST data */
130: NULL, /* read Cookies */
131: NULL,
132: NULL, /* register server variables */
133: NULL, /* Log message */
134: NULL, /* Block interruptions */
135: NULL, /* Unblock interruptions */
136: STANDARD_SAPI_MODULE_PROPERTIES
137:};
138:void raydium_php_init_request (char *filename);
139:int raydium_php_exec (char *name);
140:void raydium_php_close (void);
141:void raydium_php_init (void);
142:
143:#endif