forwarding a patch that uses the fetch macros to pull in acpica and build it (NicJA).
[AROS.git] / compiler / stdc / mmakefile.src
bloba893ab2b9ec6495a753cf72eabcc1f48a5f432bf
1 include $(SRCDIR)/config/aros.cfg
3 #MM- AROS : compiler-stdc compiler-stdcio
5 USER_INCLUDES += -I$(SRCDIR)/$(CURDIR)/math
7 STDC_MATH := \
8     math/bsdsrc/b_exp \
9     math/bsdsrc/b_log \
10     math/bsdsrc/b_tgamma \
11     math/e_acos \
12     math/e_acosf \
13     math/e_acosh \
14     math/e_acoshf \
15     math/e_asin \
16     math/e_asinf \
17     math/e_atan2 \
18     math/e_atan2f \
19     math/e_atanh \
20     math/e_atanhf \
21     math/e_cosh \
22     math/e_coshf \
23     math/e_exp \
24     math/e_expf \
25     math/e_fmod \
26     math/e_fmodf \
27     math/e_gamma \
28     math/e_gammaf \
29     math/e_gamma_r \
30     math/e_gammaf_r \
31     math/e_hypot \
32     math/e_hypotf \
33     math/e_j0 \
34     math/e_j0f \
35     math/e_j1 \
36     math/e_j1f \
37     math/e_jn \
38     math/e_jnf \
39     math/e_lgamma \
40     math/e_lgammaf \
41     math/e_lgamma_r \
42     math/e_lgammaf_r \
43     math/e_log \
44     math/e_logf \
45     math/e_log2 \
46     math/e_log2f \
47     math/e_log10 \
48     math/e_log10f \
49     math/e_pow \
50     math/e_powf \
51     math/e_rem_pio2 \
52     math/e_rem_pio2f \
53     math/e_remainder \
54     math/e_remainderf \
55     math/e_scalb \
56     math/e_scalbf \
57     math/e_sinh \
58     math/e_sinhf \
59     math/e_sqrt \
60     math/e_sqrtf \
61     math/k_cos \
62     math/k_cosf \
63     math/k_exp \
64     math/k_expf \
65     math/k_rem_pio2 \
66     math/k_rem_pio2f \
67     math/k_sin \
68     math/k_sinf \
69     math/k_tan \
70     math/k_tanf \
71     math/s_nan \
72     math/s_asinh \
73     math/s_asinhf \
74     math/s_atan \
75     math/s_atanf \
76     math/s_cacos \
77     math/s_cacosf \
78     math/s_cacosh \
79     math/s_cacoshf \
80     math/s_carg \
81     math/s_cargf \
82     math/s_casin \
83     math/s_casinf \
84     math/s_casinh \
85     math/s_casinhf \
86     math/s_catan \
87     math/s_catanf \
88     math/s_catanh \
89     math/s_catanhf \
90     math/s_cbrt \
91     math/s_cbrtf \
92     math/s_ccos \
93     math/s_ccosf \
94     math/s_ccosh \
95     math/s_ccoshf \
96     math/s_ceil \
97     math/s_ceilf \
98     math/s_cexp \
99     math/s_cexpf \
100     math/s_cimag \
101     math/s_cimagf \
102     math/s_conj \
103     math/s_conjf \
104     math/s_clog \
105     math/s_clogf \
106     math/s_cpow \
107     math/s_cpowf \
108     math/s_cproj \
109     math/s_cprojf \
110     math/s_creal \
111     math/s_crealf \
112     math/s_csinh \
113     math/s_csinhf \
114     math/s_csin \
115     math/s_csqrt \
116     math/s_csqrtf \
117     math/s_ctan \
118     math/s_ctanf \
119     math/s_ctanh \
120     math/s_ctanhf \
121     math/s_copysign \
122     math/s_copysignf \
123     math/s_cos \
124     math/s_cosf \
125     math/s_erf \
126     math/s_erff \
127     math/s_exp2 \
128     math/s_exp2f \
129     math/s_expm1 \
130     math/s_expm1f \
131     math/s_fabs \
132     math/s_fabsf \
133     math/s_fdim \
134     math/s_floor \
135     math/s_floorf \
136     math/s_fpclassify \
137     math/s_fma \
138     math/s_fmaf  \
139     math/s_fmax \
140     math/s_fmaxf \
141     math/s_fmaxl \
142     math/s_fmin \
143     math/s_fminf \
144     math/s_fminl \
145     math/s_frexp \
146     math/s_frexpf  \
147     math/s_ilogb \
148     math/s_ilogbf \
149     math/s_isfinite \
150     math/s_isinf \
151     math/s_isnan \
152     math/s_isnormal \
153     math/s_log1p \
154     math/s_log1pf \
155     math/s_logb \
156     math/s_logbf \
157     math/s_modf \
158     math/s_modff \
159     math/s_nearbyint \
160     math/s_nextafter \
161     math/s_nextafterf  \
162     math/s_nexttowardf \
163     math/s_remquo \
164     math/s_remquof \
165     math/s_rint \
166     math/s_rintf \
167     math/s_lrint \
168     math/s_lrintf \
169     math/s_llrint \
170     math/s_llrintf \
171     math/s_round \
172     math/s_roundf \
173     math/s_lround \
174     math/s_lroundf \
175     math/s_llround \
176     math/s_llroundf \
177     math/s_scalbln \
178     math/s_scalbn \
179     math/s_scalbnf  \
180     math/s_signbit \
181     math/s_significand \
182     math/s_significandf \
183     math/s_sin \
184     math/s_sincos \
185     math/s_sincosf \
186     math/s_sinf \
187     math/s_tan \
188     math/s_tanf \
189     math/s_tanh \
190     math/s_tanhf \
191     math/s_tgammaf \
192     math/s_trunc \
193     math/s_truncf
195 STDC_SCABS_MATH := \
196     math/s_cabs \
197     math/s_cabsf
199 STDC_WCABS_MATH := \
200     math/w_cabs \
201     math/w_cabsf
203 STDC_LONGDB_MATH := \
204     math/e_acosl \
205     math/e_asinl \
206     math/e_atan2l \
207     math/e_fmodl \
208     math/e_hypotl \
209     math/e_lgammal \
210     math/e_remainderl \
211     math/e_sqrtl \
212     math/polevll \
213     math/s_atanl \
214     math/s_cacoshl \
215     math/s_cacosl \
216     math/s_cargl \
217     math/s_casinhl \
218     math/s_casinl \
219     math/s_catanhl \
220     math/s_catanl \
221     math/s_cbrtl \
222     math/s_ccoshl \
223     math/s_ccosl \
224     math/s_ceill \
225     math/s_cexpl \
226     math/s_cimagl \
227     math/s_clogl \
228     math/s_conjl \
229     math/s_copysignl \
230     math/s_cosl \
231     math/s_cpowl \
232     math/s_cprojl \
233     math/s_creall \
234     math/s_csinhl \
235     math/s_csinl \
236     math/s_csqrtl \
237     math/s_ctanhl \
238     math/s_ctanl \
239     math/s_fabsl \
240     math/s_floorl \
241     math/s_fmal \
242     math/s_frexpl \
243     math/s_ilogbl \
244     math/s_llrintl \
245     math/s_llroundl \
246     math/s_lrintl \
247     math/s_lroundl \
248     math/s_logbl \
249     math/s_modfl \
250     math/s_nextafterl \
251     math/s_nexttoward \
252     math/s_remquol \
253     math/s_rintl \
254     math/s_roundl \
255     math/s_scalbnl \
256     math/s_sincosl \
257     math/s_sinl \
258     math/s_tanl \
259     math/s_truncl
261 # Support files for 80bit and 128bit precision long double.
263 STDC_LONGDB80_MATH := \
264     math/ld80/e_acoshl \
265     math/ld80/e_atanhl \
266     math/ld80/e_coshl \
267     math/ld80/e_expl \
268     math/ld80/e_lgammal_r \
269     math/ld80/e_log2l \
270     math/ld80/e_log10l \
271     math/ld80/e_logl \
272     math/ld80/e_powl \
273     math/ld80/e_sinhl \
274     math/ld80/e_tgammal \
275     math/ld80/invtrig \
276     math/ld80/k_cosl \
277     math/ld80/k_sinl \
278     math/ld80/k_tanl \
279     math/ld80/s_asinhl \
280     math/ld80/s_erfl \
281     math/ld80/s_exp2l \
282     math/ld80/s_expm1l \
283     math/ld80/s_log1pl \
284     math/ld80/s_nanl \
285     math/ld80/s_tanhl
287 STDC_LONGDB128_MATH := \
288     math/ld128/e_acoshl \
289     math/ld128/e_atanhl \
290     math/ld128/e_coshl \
291     math/ld128/e_expl \
292     math/ld128/e_lgammal_r \
293     math/ld128/e_log2l \
294     math/ld128/e_log10l \
295     math/ld128/e_logl \
296     math/ld128/e_powl \
297     math/ld128/e_sinhl \
298     math/ld128/e_tgammal \
299     math/ld128/invtrig \
300     math/ld128/k_cosl \
301     math/ld128/k_sinl \
302     math/ld128/k_tanl \
303     math/ld128/s_asinhl \
304     math/ld128/s_erfl \
305     math/ld128/s_exp2l \
306     math/ld128/s_expm1l \
307     math/ld128/s_log1pl \
308     math/ld128/s_nanl \
309     math/ld128/s_tanhl
312 # Add 80bit long double support on x86, x64 and m68k
314 ifneq ($(filter $(AROS_TARGET_CPU),i386 x86_64 m68k),)
315 STDC_MATH += $(STDC_LONGDB_MATH)
316 STDC_MATH += $(STDC_LONGDB80_MATH)
317 USER_INCLUDES += -I$(SRCDIR)/$(CURDIR)/math/ld80
318 STDC_SCABS_MATH += math/s_cabsl
319 STDC_WCABS_MATH += math/w_cabsl
320 else
322 # Add 128bit long double support for aarch64
324 ifneq ($(filter $(AROS_TARGET_CPU),aarch64),)
325 STDC_MATH += $(STDC_LONGDB_MATH)
326 STDC_MATH += $(STDC_LONGDB128_MATH)
327 USER_INCLUDES += -I$(SRCDIR)/$(CURDIR)/math/ld128
328 STDC_SCABS_MATH += math/s_cabsl
329 STDC_WCABS_MATH += math/w_cabsl
330 else
332 # We either don't know what long double format is required
333 # or the platform doesn't support it, so alias the double versions
334 # of necessary functions.
335 # These architectures should have
336 # LDBL_MANT_DIG == DBL_MANT_DIG (53) in float.h
338 endif
339 endif
341 STDC_MATH += $(STDC_WCABS_MATH)
343 STDC := \
344     __ctype \
345     __exitfunc \
346     __optionallibs \
347     __signal \
348     __stdc_assert \
349     __stdc_gmtoffset \
350     __stdc_ioerr2errno \
351     __stdc_startup \
352     __stdc_fpuprivate \
353     __vcformat \
354     __vcscan \
355     _exit \
356     abort \
357     abs labs llabs \
358     asctime asctime_r \
359     atexit \
360     atof \
361     atoi \
362     atol \
363     atoll \
364     bsearch \
365     calloc \
366     clock \
367     ctime ctime_r \
368     difftime \
369     div ldiv lldiv \
370     exit \
371     fenv _fenv \
372     free \
373     getc \
374     gmtime gmtime_r \
375     imaxabs \
376     imaxdiv \
377     localeconv \
378     localtime localtime_r \
379     longjmp \
380     malloc \
381     malloc_align \
382     $(STDC_MATH) \
383     mblen \
384     memchr \
385     memcmp \
386     memcpy \
387     memmove \
388     memset \
389     mktime \
390     on_exit \
391     putc \
392     qsort \
393     raise \
394     rand \
395     realloc \
396     realloc_nocopy \
397     setjmp \
398     setlocale \
399     signal \
400     snprintf \
401     sprintf \
402     sscanf \
403     stccpy \
404     stcd_l \
405     stch_l \
406     stcl_d \
407     stcl_h \
408     stcl_o \
409     stco_l \
410     stcu_d \
411     stpblk \
412     stpcpy \
413     stpsym \
414     strcasecmp \
415     strcat \
416     strchr \
417     strcmp \
418     strcoll \
419     strcpy \
420     strcspn \
421     strdup \
422     strerror \
423     strftime \
424     strlcat \
425     strlcpy \
426     strlen \
427     strnlen \
428     strlwr \
429     strncasecmp \
430     strncat \
431     strncmp \
432     strncpy \
433     strndup \
434     strpbrk \
435     strrchr \
436     strrev \
437     strsep \
438     strspn \
439     strstr \
440     strtod \
441     strtof \
442     strtoimax \
443     strtok \
444     strtok_r \
445     strtol \
446     strtold \
447     strtoll \
448     strtoul \
449     strtoull \
450     strtoumax \
451     strupr \
452     strxfrm \
453     time \
454     vsnprintf \
455     vsprintf \
456     vsscanf
458 STDC_LINKLIB := \
459     __ctype_linklib \
460     strcasestr
462 # The common files will be put both in the shared and in the static link lib
463 STDC_COMMON := \
464     __stdc_geterrnoptr \
465     __stdc_getsigngamptr \
466     __stdc_mb_cur_max \
467     math/infinity
469 STDCIO := \
470     __stdcio_assert \
471     __stdcio_init \
472     __stdio \
473     clearerr \
474     fclose \
475     feof \
476     ferror \
477     fflush \
478     fgetc \
479     fgetpos \
480     fgets \
481     fopen \
482     fprintf \
483     fputc \
484     fputs \
485     fread \
486     freopen \
487     fscanf \
488     fseek \
489     fsetpos \
490     ftell \
491     fwrite \
492     getchar \
493     getenv \
494     gets \
495     printf \
496     putchar \
497     puts \
498     remove \
499     rename \
500     rewind \
501     scanf \
502     setbuf \
503     setvbuf \
504     system \
505     tmpfile \
506     tmpnam \
507     ungetc \
508     vfprintf \
509     vfscanf \
510     vprintf \
511     vscanf
513 # The common files will be put both in the shared and in the static link lib
514 STDCIO_COMMON := \
515     __stdcio_stdstreams
517 #MM- core-linklibs : linklibs-stdc linklibs-stdcio linklibs-libm
519 STDC_LINKOBJS := $(addsuffix .o,$(addprefix $(GENDIR)/$(CURDIR)/stdc/,$(notdir $(STDC_COMMON))))
521 # Ugh. These are for the math routines, which have a number of
522 # lint issues, that should be fixed.
523 NOWARN_FLAGS := $(NOWARN_NONNULL_COMPARE) $(NOWARN_UNUSED_VARIABLE) \
524     $(NOWARN_PARENTHESES) $(NOWARN_UNINITIALIZED)
526 USER_CFLAGS := $(NOWARN_FLAGS) -noposixc -fno-builtin
527 USER_LDFLAGS := -nostdc -noposixc
528 USER_CPPFLAGS := -Dlint '-D__FBSDID(x)=' 
530 %build_module mmake=compiler-stdc \
531     modname=stdc modtype=library \
532     files="$(STDC) $(STDC_COMMON)" \
533     linklibfiles=$(STDC_LINKLIB) linklibobjs=$(STDC_LINKOBJS)
535 STDCIO_LINKOBJS := $(addsuffix .o,$(addprefix $(GENDIR)/$(CURDIR)/stdcio/,$(notdir $(STDCIO_COMMON))))
537 %build_module mmake=compiler-stdcio \
538     modname=stdcio modtype=library \
539     files="$(STDCIO) $(STDCIO_COMMON)" \
540     linklibobjs=$(STDCIO_LINKOBJS) \
541     uselibs="stdc_rel"
543 STDC_MATH_STATIC := \
544     math/e_log \
545     math/e_logf \
546     math/e_log2 \
547     math/e_log2f \
548     math/e_log10 \
549     math/e_log10f \
550     math/e_pow \
551     math/e_powf \
552     math/e_rem_pio2 \
553     math/e_sqrt \
554     math/k_cos \
555     math/k_rem_pio2 \
556     math/k_sin \
557     math/s_copysign \
558     math/s_copysignf \
559     math/s_copysignl \
560     math/s_cos \
561     math/s_fabs \
562     math/s_floor \
563     math/s_fpclassify \
564     math/s_scalbn \
565     math/s_scalbnf
567 STDC_STATIC := \
568     __ctype \
569     __vcformat \
570     __vcscan \
571     atoi \
572     atol \
573     atoll \
574     bsearch \
575     $(STDC_MATH_STATIC) \
576     memchr \
577     memcmp \
578     memcpy \
579     memmove \
580     memset \
581     qsort \
582     snprintf \
583     sprintf \
584     sscanf \
585     stccpy \
586     stpblk \
587     strcasecmp \
588     strcasestr \
589     strcat \
590     stcd_l \
591     stch_l \
592     stcl_d \
593     stcl_h \
594     stcl_o \
595     stco_l \
596     stcu_d \
597     stpcpy \
598     strchr \
599     strcmp \
600     strcpy \
601     strcspn \
602     strlcat \
603     strlcpy \
604     strlen \
605     strnlen \
606     strlwr \
607     strncasecmp \
608     strncat \
609     strncpy \
610     strncmp \
611     strpbrk \
612     strrchr \
613     strspn \
614     strstr \
615     strtod \
616     strtof \
617     strtol \
618     strtoul \
619     vsnprintf \
620     vsprintf \
621     vsscanf
623 USER_CFLAGS := $(NOWARN_FLAGS) -fno-builtin
624 USER_CPPFLAGS := -DSTDC_STATIC -Dlint
626 #MM- core-linklibs : linklibs-stdc-static
627 %build_linklib mmake=linklibs-stdc-static libname=stdc.static \
628     files="$(STDC_STATIC)" objdir=$(GENDIR)/$(CURDIR)/static
630 #MM- linklibs-romhack : compiler-stdc
631 # FIXME: The next romhack linklib is a temporary hack and has to be
632 # excommunicated in the future !
633 # setjmp()/longjmp() is used in dos.library so make it available.
634 # Plan to put stdc.library also in aros-base rom so this is not needed anymore
635 %build_linklib mmake=linklibs-romhack \
636     objdir=$(GENDIR)/$(CURDIR)/stdc libname=romhack files="setjmp longjmp"
638 CFLAGS32 := $(filter-out -mcmodel=large,$(CFLAGS))
640 # x86_64 needs a 32bit version stdc.static
641 %build_linklib mmake=linklibs-stdc-static32 \
642     libname=stdc.static files="$(STDC_STATIC)" objs=$(ROM_COMMON_OBJ32) \
643     cflags="-m32 $(CFLAGS32) -DSTDC_LIB32 -DSTDC_STATIC" \
644     objdir=$(GENDIR)/$(CURDIR)/32bit libdir=$(GENDIR)/lib32
646 # A dummy libm.a is provided so that -lm link option does not produce an error
647 # objdir is provided to avoid that arch specific files end up in libm.a
648 %build_linklib mmake=linklibs-libm \
649     libname=m files=empty objdir=$(GENDIR)/$(CURDIR)/libm