make-rules/shared-macros.mk
changeset 200 936900594dba
parent 186 3adedf0f9f4d
child 206 a4474882bf60
equal deleted inserted replaced
199:b87534be1a76 200:936900594dba
   285 # popen (3C) and system (3C) to invoke the standards-conforming
   285 # popen (3C) and system (3C) to invoke the standards-conforming
   286 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh.  Add studio_XPG6MODE to
   286 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh.  Add studio_XPG6MODE to
   287 # CFLAGS instead of using this directly
   287 # CFLAGS instead of using this directly
   288 CPP_XPG6MODE=	-D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6
   288 CPP_XPG6MODE=	-D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6
   289 
   289 
       
   290 # XPG5 mode. These options are specific for C++, where _XPG6,
       
   291 # _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
       
   292 CPP_XPG5MODE=   -D_XOPEN_SOURCE=500 -D__EXTENSIONS__=1 -D_XPG5
   290 
   293 
   291 #
   294 #
   292 # Studio C compiler flag sets to ease feature selection.  Add the required
   295 # Studio C compiler flag sets to ease feature selection.  Add the required
   293 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
   296 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
   294 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
   297 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
   318 studio_C99_DISABLE =	-xc99=none
   321 studio_C99_DISABLE =	-xc99=none
   319 
   322 
   320 # Use the compiler default 'xc99=all,no_lib'
   323 # Use the compiler default 'xc99=all,no_lib'
   321 studio_C99MODE =
   324 studio_C99MODE =
   322 
   325 
       
   326 # For C++, compatibility with C99 (which is technically illegal) is
       
   327 # enabled in a different way. So, we must use a different macro for it.
       
   328 studio_cplusplus_C99_ENABLE = 	-xlang=c99
       
   329 
       
   330 # Turn it off.
       
   331 studio_cplusplus_C99_DISABLE =
       
   332 
       
   333 # And this is the macro you should actually use
       
   334 studio_cplusplus_C99MODE = 
       
   335 
   323 # Allow zero-sized struct/union declarations and void functions with return
   336 # Allow zero-sized struct/union declarations and void functions with return
   324 # statements.
   337 # statements.
   325 studio_FEATURES_EXTENSIONS =	-features=extensions
   338 studio_FEATURES_EXTENSIONS =	-features=extensions
   326 
   339 
   327 # CC requires -norunpath to avoid linking in its RUNPATH to C++ applications.
   340 # CC requires -norunpath to avoid linking in its RUNPATH to C++ applications.
   368 studio_MT =		-mt
   381 studio_MT =		-mt
   369 
   382 
   370 # See CPP_XPG6MODE comment above.
   383 # See CPP_XPG6MODE comment above.
   371 studio_XPG6MODE =	$(studio_C99MODE) $(CPP_XPG6MODE)
   384 studio_XPG6MODE =	$(studio_C99MODE) $(CPP_XPG6MODE)
   372 XPG6MODE =		$(studio_XPG6MODE)
   385 XPG6MODE =		$(studio_XPG6MODE)
       
   386 
       
   387 # See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
       
   388 studio_XPG5MODE =	$(studio_cplusplus_C99MODE) $(CPP_XPG5MODE)
       
   389 XPG5MODE =		$(studio_XPG5MODE)
   373 
   390 
   374 # Default Studio C compiler flags.  Add the required feature to your Makefile
   391 # Default Studio C compiler flags.  Add the required feature to your Makefile
   375 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
   392 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
   376 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.  In most cases, it
   393 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.  In most cases, it
   377 # should not be necessary to add CFLAGS to any environment other than the
   394 # should not be necessary to add CFLAGS to any environment other than the