2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
5 Function to write module_autoinit.c. Part of genmodule.
10 void writeautoinit(struct config
*cfg
, int is_rel
)
13 char line
[256], *banner
;
14 struct stringlist
*linelistit
;
16 snprintf(line
, 255, "%s/%s_%sautoinit.c", cfg
->gendir
, cfg
->modulename
, is_rel
? "rel" : "");
17 out
= fopen(line
, "w");
25 /* Write the code to be added to startup provided in the config file */
27 for (linelistit
= cfg
->startuplines
; linelistit
!= NULL
; linelistit
= linelistit
->next
)
29 fprintf(out
, "%s\n", linelistit
->s
);
33 banner
= getBanner(cfg
);
34 fprintf(out
, "%s\n", banner
);
37 if (!(cfg
->options
& OPTION_NOINCLUDES
))
38 fprintf(out
, "#include <proto/%s.h>\n", cfg
->includename
);
40 "#include <aros/symbolsets.h>\n"
42 "AROS_%sLIBSET(\"%s.%s\", %s, %s)\n",
44 cfg
->includename
, cfg
->suffix
,
45 cfg
->libbasetypeptrextern
, cfg
->libbase
49 "AROS_IMPORT_ASM_SYM(int, dummy, __include%slibrarieshandling);\n",
53 if (cfg
->forcelist
!=NULL
)
55 struct stringlist
* forcelistit
;
58 for (forcelistit
= cfg
->forcelist
;
60 forcelistit
= forcelistit
->next
63 /* By bringing in __aros_getbase_XXXBase() we assure parent will open
67 "AROS_IMPORT_ASM_SYM(void *, __dummy_%s, __aros_getbase_%s);\n",
68 forcelistit
->s
, forcelistit
->s