2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
5 Function to write module_autoinit.c. Part of genmodule.
9 void writeautoinit(struct config
*cfg
)
12 char line
[256], *banner
;
14 snprintf(line
, 255, "%s/%s_autoinit.c", cfg
->gendir
, cfg
->modulename
);
15 out
= fopen(line
, "w");
23 banner
= getBanner(cfg
);
27 "#include <proto/%s.h>\n"
28 "#include <aros/symbolsets.h>\n"
30 "ADD2LIBS((CONST_STRPTR)\"%s.library\",%u, %s, %s);\n",
31 banner
, cfg
->modulename
,
32 cfg
->modulename
, cfg
->majorversion
, cfg
->libbasetypeptrextern
, cfg
->libbase
36 if (cfg
->forcelist
!=NULL
)
38 struct stringlist
* forcelistit
;
41 for (forcelistit
= cfg
->forcelist
;
43 forcelistit
= forcelistit
->next
46 fprintf(out
, "extern struct Library *%s;\n", forcelistit
->s
);
48 fprintf(out
, "\nvoid __%s_forcelibs(void)\n{\n", cfg
->modulename
);
49 for (forcelistit
= cfg
->forcelist
;
51 forcelistit
= forcelistit
->next
54 fprintf(out
, " %s = NULL;\n", forcelistit
->s
);