#
# PGI Compiler Configurations for C and Fortran
#

#switch Mnobuiltin= -Mx,122,0x80 
#switch Mbuiltin= -My,122,0x80 
#Meaningless for fortran.
# Keep .pgccrc -Mstandard up to date with -Mnobuiltin.
switch Mnobuiltin=-D_PGI_NOBUILTINS
switch Mbuiltin=-U_PGI_NOBUILTINS
switch Msafe_lastval= -Mx,34,0x800
switch byteswapio=-Mx,125,2
switch Mbyteswapio=-Mx,125,2
switch Ml3f=-Mx,124,0x2000
switch Mchkstk=-Mx,121,0x8000000
switch Mchkfpstk=-Mx,80,0x20000
switch Mnomain
switch Munix
switch Mrecursive=-W0,-recursive -Wh,-recursive
switch Mnorecursive=-W0,-norecursive -Wh,-norecursive
switch Mnoopenmp=-Mx,69,1 -Wh,-x,69,1
switch Mnosgimp=-Mx,69,2 -Wh,-x,69,2
switch c9x=-Mx,123,0x80000000
switch Mcache_align=-Mx,119,0x10000000 -Mquad

# The following only applies to ftn/f90/hpf90 for the x86; pghpfrc overrides
# the definitions.
switch Munderscoring=-My,119,0x01000000
switch Mnounderscoring=-Mx,119,0x01000000
switch Msecond_underscore=-Mx,119,0x2000000
switch Mnosecond_underscore=-My,119,0x2000000
# applicable to all ftn products
switch Mref_externals=-Mx,124,0x1000 -Wh,-x,124,0x1000
switch Mnoref_externals=-My,124,0x1000 -Wh,-y,124,0x1000

ifndef SYSTEM_DEFINE	set SYSTEM_DEFINE=$SYSTEM
ifndef COMP_C		set COMP_C=pgc
ifndef EXTRACTOR_C	if DOS \
				set EXTRACTOR_C=pgcex \
			 else \
				set EXTRACTOR_C=pgc_ex

set DRIVER_ARGS_C="$HOST_ARGS_C $EXTRA_DRIVER_ARGS_C"
set DRIVER_ARGS_FTN="$HOST_ARGS_FTN $EXTRA_DRIVER_ARGS_FTN"

set COMP_ARGS_C="$TARGET_ARGS_C $EXTRA_ARGS_C"
ifndef COMP_ARGS_FTN set COMP_ARGS_FTN="$TARGET_ARGS_FTN $EXTRA_ARGS_FTN"

ifndef COMP_FTN		set COMP_FTN=pgftn
ifndef EXTRACTOR_FTN	if DOS \
				set EXTRACTOR_FTN=pgftnex \
			else \
				set EXTRACTOR_FTN=pgftn_ex


ifn -Msignextend \
  ifn -Mnosignextend \
    set COMP_ARGS_FTN = "$(COMP_ARGS_FTN) -x 124 1"

ifndef COMP_ARGS_LAST	set COMP_ARGS_LAST=""


#set INCDIR="$(CPLUSINC)$(PGI)/$(SYSTEM)/include:/usr/include"


ifn -Mnostddef		set PREDEFS="$(PREDEFS) -D$SYSTEM_DEFINE -D$OS"
if I860 \
    ifndef PREPREDS \
	set PREPREDS="#machine($MACHINE) #lint(off) #system($OS) #cpu($SYSTEM)"


if PGF77 \
    ifndef LPGFTNRTL \
	set LPGFTNRTL="-lpgftnrtl" \
    if -mslibs set LPGFTNRTL="\"$(PGIDIR)/libpgftnrtl.a\"" \
    endif \
    ifndef PGFMAIN \
	ifn -Mnomain \
	    ifn -shared \
		ifn -G \
		    set PGFMAIN="\"$(PGIDIR)/pgfmain.o\""  \
		endif \
	    endif \
	endif \
    endif \
endif

