flags_to_pass = { flag= GNATMAKE ; };
flags_to_pass = { flag= GDC ; };
flags_to_pass = { flag= GDCFLAGS ; };
-flags_to_pass = { flag= GA68 ; };
-flags_to_pass = { flag= GA68FLAGS ; };
+flags_to_pass = { flag= A68 ; };
+flags_to_pass = { flag= A68FLAGS ; };
// Target tools
flags_to_pass = { flag= AR_FOR_TARGET ; };
flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
flags_to_pass = { flag= GDC_FOR_TARGET ; };
flags_to_pass = { flag= GDCFLAGS_FOR_TARGET ; };
-flags_to_pass = { flag= GA68_FOR_TARGET ; };
-flags_to_pass = { flag= GA68FLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= A68_FOR_TARGET ; };
+flags_to_pass = { flag= A68FLAGS_FOR_TARGET ; };
flags_to_pass = { flag= GM2_FOR_TARGET ; };
flags_to_pass = { flag= GM2FLAGS_FOR_TARGET ; };
flags_to_pass = { flag= LD_FOR_TARGET ; };
CXX="$(CXX_FOR_BUILD)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
- GA68="$(GA68_FOR_BUILD)"; export GA68; \
- GA68FLAGS="$(GA68FLAGS_FOR_BUILD)"; export GA68FLAGS; \
+ A68="$(A68_FOR_BUILD)"; export A68; \
+ A68FLAGS="$(A68FLAGS_FOR_BUILD)"; export A68FLAGS; \
GOC="$(GOC_FOR_BUILD)"; export GOC; \
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
GDC="$(GDC_FOR_BUILD)"; export GDC; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
- GA68="$(GA68)"; export GA68; \
+ A68="$(A68)"; export A68; \
GOC="$(GOC)"; export GOC; \
GDC="$(GDC)"; export GDC; \
GM2="$(GM2)"; export GM2; \
CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
$(POSTSTAGE1_CXX_EXPORT) \
$(LTO_EXPORTS) \
- GA68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
- -B$(build_tooldir)/bin/ $(GA68FLAGS_FOR_TARGET) \
+ A68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
+ -B$(build_tooldir)/bin/ $(A68FLAGS_FOR_TARGET) \
-B$$r/prev-$(TARGET_SUBDIR)/libga68/.libs"; \
- export GA68; \
- GA68_FOR_BUILD="$$GA68"; export GA68_FOR_BUILD; \
+ export A68; \
+ A68_FOR_BUILD="$$A68"; export A68_FOR_BUILD; \
GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-B$(build_tooldir)/bin/ $(GDCFLAGS_FOR_TARGET) \
-B$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/gcc \
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
- GA68="$(GA68_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GA68; \
+ A68="$(A68_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export A68; \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
GM2="$(GM2_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GM2; \
DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
-GA68_FOR_BUILD = @GA68_FOR_BUILD@
+A68_FOR_BUILD = @A68_FOR_BUILD@
GOC_FOR_BUILD = @GOC_FOR_BUILD@
GDC_FOR_BUILD = @GDC_FOR_BUILD@
GM2_FOR_BUILD = @GM2_FOR_BUILD@
WINDRES = @WINDRES@
WINDMC = @WINDMC@
-GA68 = @GA68@
+A68 = @A68@
GDC = @GDC@
GNATBIND = @GNATBIND@
GNATMAKE = @GNATMAKE@
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
GOCFLAGS = $(CFLAGS)
-GA68FLAGS = @GA68FLAGS@
+A68FLAGS = @A68FLAGS@
GDCFLAGS = @GDCFLAGS@
GM2FLAGS = $(CFLAGS)
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
-GA68_FOR_TARGET=$(STAGE_CC_WRAPPER) @GA68_FOR_TARGET@
+A68_FOR_TARGET=$(STAGE_CC_WRAPPER) @A68_FOR_TARGET@
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
GM2_FOR_TARGET=$(STAGE_CC_WRAPPER) @GM2_FOR_TARGET@
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
GM2FLAGS_FOR_TARGET = -O2 -g
GOCFLAGS_FOR_TARGET = -O2 -g
-GA68FLAGS_FOR_TARGET = -O2 -g
+A68FLAGS_FOR_TARGET = -O2 -g
GDCFLAGS_FOR_TARGET = -O2 -g
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
"GNATMAKE=$(GNATMAKE)" \
"GDC=$(GDC)" \
"GDCFLAGS=$(GDCFLAGS)" \
- "GA68=$(GA68)" \
- "GA68FLAGS=$(GA68FLAGS)" \
+ "A68=$(A68)" \
+ "A68FLAGS=$(A68FLAGS)" \
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
"GDCFLAGS_FOR_TARGET=$(GDCFLAGS_FOR_TARGET)" \
- "GA68_FOR_TARGET=$(GA68_FOR_TARGET)" \
- "GA68FLAGS_FOR_TARGET=$(GA68FLAGS_FOR_TARGET)" \
+ "A68_FOR_TARGET=$(A68_FOR_TARGET)" \
+ "A68FLAGS_FOR_TARGET=$(A68FLAGS_FOR_TARGET)" \
"GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
"GM2FLAGS_FOR_TARGET=$(GM2FLAGS_FOR_TARGET)" \
"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
'DSYMUTIL=$(DSYMUTIL)' \
'GFORTRAN=$(GFORTRAN)' \
'GOC=$(GOC)' \
- 'GA68=$(GA68)' \
+ 'A68=$(A68)' \
'GDC=$(GDC)' \
'GM2=$(GM2)' \
'LD=$(LD)' \
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
- GA68="$${GA68}" GA68_FOR_BUILD="$${GA68_FOR_BUILD}" \
+ A68="$${A68}" A68_FOR_BUILD="$${A68_FOR_BUILD}" \
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
GM2="$${GM2}" GM2_FOR_BUILD="$${GM2_FOR_BUILD}" \
GNATBIND="$${GNATBIND}" \
'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
- 'GA68=$$(GA68_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
- 'GA68FLAGS=$$(GA68FLAGS_FOR_TARGET)' \
+ 'A68=$$(A68_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'A68FLAGS=$$(A68FLAGS_FOR_TARGET)' \
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
'GM2=$$(GM2_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
CXX="$(CXX_FOR_BUILD)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
- GA68="$(GA68_FOR_BUILD)"; export GA68; \
- GA68FLAGS="$(GA68FLAGS_FOR_BUILD)"; export GA68FLAGS; \
+ A68="$(A68_FOR_BUILD)"; export A68; \
+ A68FLAGS="$(A68FLAGS_FOR_BUILD)"; export A68FLAGS; \
GOC="$(GOC_FOR_BUILD)"; export GOC; \
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
GDC="$(GDC_FOR_BUILD)"; export GDC; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
- GA68="$(GA68)"; export GA68; \
+ A68="$(A68)"; export A68; \
GOC="$(GOC)"; export GOC; \
GDC="$(GDC)"; export GDC; \
GM2="$(GM2)"; export GM2; \
CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
$(POSTSTAGE1_CXX_EXPORT) \
$(LTO_EXPORTS) \
- GA68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
- -B$(build_tooldir)/bin/ $(GA68FLAGS_FOR_TARGET) \
+ A68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
+ -B$(build_tooldir)/bin/ $(A68FLAGS_FOR_TARGET) \
-B$$r/prev-$(TARGET_SUBDIR)/libga68/.libs"; \
- export GA68; \
- GA68_FOR_BUILD="$$GA68"; export GA68_FOR_BUILD; \
+ export A68; \
+ A68_FOR_BUILD="$$A68"; export A68_FOR_BUILD; \
GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-B$(build_tooldir)/bin/ $(GDCFLAGS_FOR_TARGET) \
-B$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/gcc \
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
- GA68="$(GA68_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GA68; \
+ A68="$(A68_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export A68; \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
GM2="$(GM2_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GM2; \
DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
-GA68_FOR_BUILD = @GA68_FOR_BUILD@
+A68_FOR_BUILD = @A68_FOR_BUILD@
GOC_FOR_BUILD = @GOC_FOR_BUILD@
GDC_FOR_BUILD = @GDC_FOR_BUILD@
GM2_FOR_BUILD = @GM2_FOR_BUILD@
WINDRES = @WINDRES@
WINDMC = @WINDMC@
-GA68 = @GA68@
+A68 = @A68@
GDC = @GDC@
GNATBIND = @GNATBIND@
GNATMAKE = @GNATMAKE@
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
GOCFLAGS = $(CFLAGS)
-GA68FLAGS = @GA68FLAGS@
+A68FLAGS = @A68FLAGS@
GDCFLAGS = @GDCFLAGS@
GM2FLAGS = $(CFLAGS)
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
-GA68_FOR_TARGET=$(STAGE_CC_WRAPPER) @GA68_FOR_TARGET@
+A68_FOR_TARGET=$(STAGE_CC_WRAPPER) @A68_FOR_TARGET@
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
GM2_FOR_TARGET=$(STAGE_CC_WRAPPER) @GM2_FOR_TARGET@
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
GM2FLAGS_FOR_TARGET = -O2 -g
GOCFLAGS_FOR_TARGET = -O2 -g
-GA68FLAGS_FOR_TARGET = -O2 -g
+A68FLAGS_FOR_TARGET = -O2 -g
GDCFLAGS_FOR_TARGET = -O2 -g
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
'DSYMUTIL=$(DSYMUTIL)' \
'GFORTRAN=$(GFORTRAN)' \
'GOC=$(GOC)' \
- 'GA68=$(GA68)' \
+ 'A68=$(A68)' \
'GDC=$(GDC)' \
'GM2=$(GM2)' \
'LD=$(LD)' \
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
- GA68="$${GA68}" GA68_FOR_BUILD="$${GA68_FOR_BUILD}" \
+ A68="$${A68}" A68_FOR_BUILD="$${A68_FOR_BUILD}" \
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
GM2="$${GM2}" GM2_FOR_BUILD="$${GM2_FOR_BUILD}" \
GNATBIND="$${GNATBIND}" \
'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
- 'GA68=$$(GA68_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
- 'GA68FLAGS=$$(GA68FLAGS_FOR_TARGET)' \
+ 'A68=$$(A68_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'A68FLAGS=$$(A68FLAGS_FOR_TARGET)' \
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
'GM2=$$(GM2_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
exec_prefix="$(exec_prefix)" \
GOCFLAGS="$(GOCFLAGS) $${flags}" \
GDCFLAGS="$(GDCFLAGS) $${flags}" \
+ A68FLAGS="$(A68FLAGS) $${flags}" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
break
fi
done
- ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags" GDC="${GDC_}$flags"'
+ ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags" GDC="${GDC_}$flags" A68="${A68_}$flags"'
if [ "${with_target_subdir}" = "." ]; then
CC_=$CC' '
GFORTRAN_=$GFORTRAN' '
GOC_=$GOC' '
GDC_=$GDC' '
+ A68_=$A68' '
else
# Create a regular expression that matches any string as long
# as ML_POPDIR.
esac
done
+ A68_=
+ for arg in ${A68}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ A68_="${A68_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ "${ML_POPDIR}"/*)
+ A68_="${A68_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ A68_="${A68_}${arg}${multi_osdir} ${arg} " ;;
+ *)
+ A68_="${A68_}${arg} " ;;
+ esac
+ done
+
if test "x${LD_LIBRARY_PATH+set}" = xset; then
LD_LIBRARY_PATH_=
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
fi])
# Test for Algol 68
-AC_DEFUN([ACX_PROG_GA68],
+AC_DEFUN([ACX_PROG_A68],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
AC_REQUIRE([AC_PROG_CC])
-AC_CHECK_TOOL(GA68, ga68, no)])
+AC_CHECK_TOOL(A68, ga68, no)])
# Test for D.
AC_DEFUN([ACX_PROG_GDC],
GM2_FOR_TARGET
GDC_FOR_TARGET
GOC_FOR_TARGET
-GA68_FOR_TARGET
+A68_FOR_TARGET
GFORTRAN_FOR_TARGET
GCC_FOR_TARGET
CXX_FOR_TARGET
CPP
PKG_CONFIG_PATH
GDCFLAGS
-GA68FLAGS
+A68FLAGS
READELF
OTOOL
OBJDUMP
GNATMAKE_FOR_BUILD
GDC_FOR_BUILD
GOC_FOR_BUILD
-GA68_FOR_BUILD
+A68_FOR_BUILD
GFORTRAN_FOR_BUILD
DSYMUTIL_FOR_BUILD
DLLTOOL_FOR_BUILD
do_compare
CARGO
GDC
-GA68
+A68
GNATMAKE
GNATBIND
ac_ct_CXX
CXX_FOR_TARGET
GCC_FOR_TARGET
GFORTRAN_FOR_TARGET
-GA68_FOR_TARGET
+A68_FOR_TARGET
GOC_FOR_TARGET
GDC_FOR_TARGET
GM2_FOR_TARGET
GCC for the target
GFORTRAN_FOR_TARGET
GFORTRAN for the target
- GA68_FOR_TARGET
- GA68 for the target
+ A68_FOR_TARGET
+ A68 for the target
GOC_FOR_TARGET
GOC for the target
GDC_FOR_TARGET
DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil}
GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
- GA68_FOR_BUILD=${GA68_FOR_BUILD-ga68}
+ A68_FOR_BUILD=${A68_FOR_BUILD-ga68}
GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc}
GNATMAKE_FOR_BUILD=${GNATMAKE_FOR_BUILD-gnatmake}
DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)"
GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
- GA68_FOR_BUILD="\$(GA68)"
+ A68_FOR_BUILD="\$(A68)"
GOC_FOR_BUILD="\$(GOC)"
GDC_FOR_BUILD="\$(GDC)"
GNATMAKE_FOR_BUILD="\$(GNATMAKE)"
set dummy ${ac_tool_prefix}ga68; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GA68+:} false; then :
+if ${ac_cv_prog_A68+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$GA68"; then
- ac_cv_prog_GA68="$GA68" # Let the user override the test.
+ if test -n "$A68"; then
+ ac_cv_prog_A68="$A68" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GA68="${ac_tool_prefix}ga68"
+ ac_cv_prog_A68="${ac_tool_prefix}ga68"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-GA68=$ac_cv_prog_GA68
-if test -n "$GA68"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GA68" >&5
-$as_echo "$GA68" >&6; }
+A68=$ac_cv_prog_A68
+if test -n "$A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68" >&5
+$as_echo "$A68" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-if test -z "$ac_cv_prog_GA68"; then
- ac_ct_GA68=$GA68
+if test -z "$ac_cv_prog_A68"; then
+ ac_ct_A68=$A68
# Extract the first word of "ga68", so it can be a program name with args.
set dummy ga68; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_GA68+:} false; then :
+if ${ac_cv_prog_ac_ct_A68+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_GA68"; then
- ac_cv_prog_ac_ct_GA68="$ac_ct_GA68" # Let the user override the test.
+ if test -n "$ac_ct_A68"; then
+ ac_cv_prog_ac_ct_A68="$ac_ct_A68" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_GA68="ga68"
+ ac_cv_prog_ac_ct_A68="ga68"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-ac_ct_GA68=$ac_cv_prog_ac_ct_GA68
-if test -n "$ac_ct_GA68"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GA68" >&5
-$as_echo "$ac_ct_GA68" >&6; }
+ac_ct_A68=$ac_cv_prog_ac_ct_A68
+if test -n "$ac_ct_A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_A68" >&5
+$as_echo "$ac_ct_A68" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- if test "x$ac_ct_GA68" = x; then
- GA68="no"
+ if test "x$ac_ct_A68" = x; then
+ A68="no"
else
case $cross_compiling:$ac_tool_warned in
yes:)
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- GA68=$ac_ct_GA68
+ A68=$ac_ct_A68
fi
else
- GA68="$ac_cv_prog_GA68"
+ A68="$ac_cv_prog_A68"
fi
-GA68FLAGS=${GA68FLAGS-${CFLAGS}}
+A68FLAGS=${A68FLAGS-${CFLAGS}}
GDCFLAGS=${GDCFLAGS-${CFLAGS}}
-if test -n "$GA68_FOR_TARGET"; then
- ac_cv_prog_GA68_FOR_TARGET=$GA68_FOR_TARGET
-elif test -n "$ac_cv_prog_GA68_FOR_TARGET"; then
- GA68_FOR_TARGET=$ac_cv_prog_GA68_FOR_TARGET
+if test -n "$A68_FOR_TARGET"; then
+ ac_cv_prog_A68_FOR_TARGET=$A68_FOR_TARGET
+elif test -n "$ac_cv_prog_A68_FOR_TARGET"; then
+ A68_FOR_TARGET=$ac_cv_prog_A68_FOR_TARGET
fi
-if test -n "$ac_cv_prog_GA68_FOR_TARGET"; then
+if test -n "$ac_cv_prog_A68_FOR_TARGET"; then
for ncn_progname in ga68; do
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GA68_FOR_TARGET+:} false; then :
+if ${ac_cv_prog_A68_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$GA68_FOR_TARGET"; then
- ac_cv_prog_GA68_FOR_TARGET="$GA68_FOR_TARGET" # Let the user override the test.
+ if test -n "$A68_FOR_TARGET"; then
+ ac_cv_prog_A68_FOR_TARGET="$A68_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GA68_FOR_TARGET="${ncn_progname}"
+ ac_cv_prog_A68_FOR_TARGET="${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-GA68_FOR_TARGET=$ac_cv_prog_GA68_FOR_TARGET
-if test -n "$GA68_FOR_TARGET"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GA68_FOR_TARGET" >&5
-$as_echo "$GA68_FOR_TARGET" >&6; }
+A68_FOR_TARGET=$ac_cv_prog_A68_FOR_TARGET
+if test -n "$A68_FOR_TARGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68_FOR_TARGET" >&5
+$as_echo "$A68_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
done
fi
-if test -z "$ac_cv_prog_GA68_FOR_TARGET" && test -n "$with_build_time_tools"; then
+if test -z "$ac_cv_prog_A68_FOR_TARGET" && test -n "$with_build_time_tools"; then
for ncn_progname in ga68; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ncn_progname} in $with_build_time_tools" >&5
$as_echo_n "checking for ${ncn_progname} in $with_build_time_tools... " >&6; }
if test -x $with_build_time_tools/${ncn_progname}; then
- ac_cv_prog_GA68_FOR_TARGET=$with_build_time_tools/${ncn_progname}
+ ac_cv_prog_A68_FOR_TARGET=$with_build_time_tools/${ncn_progname}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
break
done
fi
-if test -z "$ac_cv_prog_GA68_FOR_TARGET"; then
+if test -z "$ac_cv_prog_A68_FOR_TARGET"; then
for ncn_progname in ga68; do
if test -n "$ncn_target_tool_prefix"; then
# Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GA68_FOR_TARGET+:} false; then :
+if ${ac_cv_prog_A68_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$GA68_FOR_TARGET"; then
- ac_cv_prog_GA68_FOR_TARGET="$GA68_FOR_TARGET" # Let the user override the test.
+ if test -n "$A68_FOR_TARGET"; then
+ ac_cv_prog_A68_FOR_TARGET="$A68_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GA68_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}"
+ ac_cv_prog_A68_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-GA68_FOR_TARGET=$ac_cv_prog_GA68_FOR_TARGET
-if test -n "$GA68_FOR_TARGET"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GA68_FOR_TARGET" >&5
-$as_echo "$GA68_FOR_TARGET" >&6; }
+A68_FOR_TARGET=$ac_cv_prog_A68_FOR_TARGET
+if test -n "$A68_FOR_TARGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68_FOR_TARGET" >&5
+$as_echo "$A68_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- if test -z "$ac_cv_prog_GA68_FOR_TARGET" && test $build = $target ; then
+ if test -z "$ac_cv_prog_A68_FOR_TARGET" && test $build = $target ; then
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GA68_FOR_TARGET+:} false; then :
+if ${ac_cv_prog_A68_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$GA68_FOR_TARGET"; then
- ac_cv_prog_GA68_FOR_TARGET="$GA68_FOR_TARGET" # Let the user override the test.
+ if test -n "$A68_FOR_TARGET"; then
+ ac_cv_prog_A68_FOR_TARGET="$A68_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GA68_FOR_TARGET="${ncn_progname}"
+ ac_cv_prog_A68_FOR_TARGET="${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-GA68_FOR_TARGET=$ac_cv_prog_GA68_FOR_TARGET
-if test -n "$GA68_FOR_TARGET"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GA68_FOR_TARGET" >&5
-$as_echo "$GA68_FOR_TARGET" >&6; }
+A68_FOR_TARGET=$ac_cv_prog_A68_FOR_TARGET
+if test -n "$A68_FOR_TARGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68_FOR_TARGET" >&5
+$as_echo "$A68_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- test -n "$ac_cv_prog_GA68_FOR_TARGET" && break
+ test -n "$ac_cv_prog_A68_FOR_TARGET" && break
done
fi
-if test -z "$ac_cv_prog_GA68_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_A68_FOR_TARGET" ; then
set dummy ga68
if test $build = $target ; then
- GA68_FOR_TARGET="$2"
+ A68_FOR_TARGET="$2"
else
- GA68_FOR_TARGET="${ncn_target_tool_prefix}$2"
+ A68_FOR_TARGET="${ncn_target_tool_prefix}$2"
fi
else
- GA68_FOR_TARGET="$ac_cv_prog_GA68_FOR_TARGET"
+ A68_FOR_TARGET="$ac_cv_prog_A68_FOR_TARGET"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ga68" >&5
$as_echo_n "checking where to find the target ga68... " >&6; }
if test "x${build}" != "x${host}" ; then
- if expr "x$GA68_FOR_TARGET" : "x/" > /dev/null; then
+ if expr "x$A68_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
- ac_dir=`dirname $GA68_FOR_TARGET`
+ ac_dir=`dirname $A68_FOR_TARGET`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
$as_echo "pre-installed in $ac_dir" >&6; }
else
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
- GA68_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/ga68 -B$$r/$(HOST_SUBDIR)/gcc/'
+ A68_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/ga68 -B$$r/$(HOST_SUBDIR)/gcc/'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
- elif expr "x$GA68_FOR_TARGET" : "x/" > /dev/null; then
+ elif expr "x$A68_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
- ac_dir=`dirname $GA68_FOR_TARGET`
+ ac_dir=`dirname $A68_FOR_TARGET`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
$as_echo "pre-installed in $ac_dir" >&6; }
elif test "x$target" = "x$host"; then
# We can use an host tool
- GA68_FOR_TARGET='$(GA68)'
+ A68_FOR_TARGET='$(A68)'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5
$as_echo "host tool" >&6; }
else
DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil}
GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
- GA68_FOR_BUILD=${GA68_FOR_BUILD-ga68}
+ A68_FOR_BUILD=${A68_FOR_BUILD-ga68}
GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc}
GNATMAKE_FOR_BUILD=${GNATMAKE_FOR_BUILD-gnatmake}
DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)"
GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
- GA68_FOR_BUILD="\$(GA68)"
+ A68_FOR_BUILD="\$(A68)"
GOC_FOR_BUILD="\$(GOC)"
GDC_FOR_BUILD="\$(GDC)"
GNATMAKE_FOR_BUILD="\$(GNATMAKE)"
fi
ACX_PROG_GNAT
-ACX_PROG_GA68
+ACX_PROG_A68
ACX_PROG_GDC
ACX_PROG_CARGO
ACX_PROG_CMP_IGNORE_INITIAL
AC_SUBST(DLLTOOL_FOR_BUILD)
AC_SUBST(DSYMUTIL_FOR_BUILD)
AC_SUBST(GFORTRAN_FOR_BUILD)
-AC_SUBST(GA68_FOR_BUILD)
+AC_SUBST(A68_FOR_BUILD)
AC_SUBST(GOC_FOR_BUILD)
AC_SUBST(GDC_FOR_BUILD)
AC_SUBST(GNATMAKE_FOR_BUILD)
AC_SUBST(CXX)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
-AC_SUBST(GA68)
-AC_SUBST(GA68FLAGS)
-GA68FLAGS=${GA68FLAGS-${CFLAGS}}
+AC_SUBST(A68)
+AC_SUBST(A68FLAGS)
+A68FLAGS=${A68FLAGS-${CFLAGS}}
AC_SUBST(GDC)
AC_SUBST(GDCFLAGS)
GDCFLAGS=${GDCFLAGS-${CFLAGS}}
NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
-NCN_STRICT_CHECK_TARGET_TOOLS(GA68_FOR_TARGET, ga68)
+NCN_STRICT_CHECK_TARGET_TOOLS(A68_FOR_TARGET, ga68)
NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
NCN_STRICT_CHECK_TARGET_TOOLS(GDC_FOR_TARGET, gdc)
NCN_STRICT_CHECK_TARGET_TOOLS(GM2_FOR_TARGET, gm2)
[gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
[gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
-GCC_TARGET_TOOL(ga68, GA68_FOR_TARGET, GA68,
+GCC_TARGET_TOOL(ga68, A68_FOR_TARGET, A68,
[gcc/ga68 -B$$r/$(HOST_SUBDIR)/gcc/], algol68)
GCC_TARGET_TOOL(gdc, GDC_FOR_TARGET, GDC,
[gcc/gdc -B$$r/$(HOST_SUBDIR)/gcc/], d)
a68_init_options (unsigned int argc ATTRIBUTE_UNUSED,
cl_decoded_option *decoded_options ATTRIBUTE_UNUSED)
{
- /* Create an empty module files map. */
+ /* Create an empty module files map and fill in some modules that are
+ provided by the run-time libga68 library. */
A68_MODULE_FILES = hash_map<nofree_string_hash,const char*>::create_ggc (16);
A68_MODULE_FILES->empty ();
+ A68_MODULE_FILES->put (ggc_strdup ("TRANSPUT"), ggc_strdup ("ga68"));
}
#undef LANG_HOOKS_INIT_OPTIONS
--- /dev/null
+access Transput
+begin int pos;
+ assert (char_in_string ("o", pos, "foo"));
+ assert (pos = 2)
+end
libga68_la_CFLAGS = $(LIBGA68_GCFLAGS) $(LIBGA68_BOEHM_GC_INCLUDES)
libga68_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
$(version_arg) $(lt_host_flags) $(extra_darwin_ldflags_libga68)
-libga68_la_DEPENDENCIES = libga68.spec $(version_dep)
-libga68_la_LIBADD = $(LIBGA68_BOEHM_GC_LIBS)
+libga68_la_DEPENDENCIES = libga68.spec $(version_dep) transput.lo
+libga68_la_LIBADD = $(LIBGA68_BOEHM_GC_LIBS) transput.lo
+
+# Rules to build the Algol 68 code in the library.
+
+LTA68COMPILE = $(LIBTOOL) --tag=A68 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(A68) $(AM_A68FLAGS)
+
+.a68.o:
+ $(A68) -o $@ $(A68FLAGS) -c $<
+
+.a68.lo:
+ $(LTA68COMPILE) $(A68FLAGS) $(MULTIFLAGS) -c -o $@ $<
+
+transput.a68 : transput.a68.in
+ $(AWK) -f $(srcdir)/sppp.awk $< > $@
+
+BUILT_SOURCES = transput.a68
# target overrides
-include $(tmake_file)
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/autoconf.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
CTAGS = ctags
CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope
+A68 = @A68@
+A68FLAGS = @A68FLAGS@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ga68-posix.c \
ga68-alloc.c \
ga68-error.c \
- ga68-standenv.c \
- ga68.h
+ ga68-standenv.c
libga68_la_LIBTOOLFLAGS =
libga68_la_CFLAGS = $(LIBGA68_GCFLAGS) $(LIBGA68_BOEHM_GC_INCLUDES)
$(version_arg) $(lt_host_flags) $(extra_darwin_ldflags_libga68)
libga68_la_DEPENDENCIES = libga68.spec $(version_dep)
-libga68_la_LIBADD = $(LIBGA68_BOEHM_GC_LIBS)
+libga68_la_LIBADD = $(LIBGA68_BOEHM_GC_LIBS) transput.lo
+
+# Rules to build the Algol 68 code in the library.
+LTA68COMPILE = $(LIBTOOL) --tag=A68 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(A68) $(AM_A68FLAGS)
+
+BUILT_SOURCES = transput.a68
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-all: config.h
+all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .a68 .c .lo .o .obj
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../multilib.am $(am__configure_deps)
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) config.h all-local
installdirs:
for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-local \
uninstall-am: uninstall-toolexeclibDATA \
uninstall-toolexeclibLTLIBRARIES
-.MAKE: all install-am install-strip
+.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
check-am clean clean-cscope clean-generic clean-libtool \
@LIBGA68_USE_SYMVER_SUN_TRUE@@LIBGA68_USE_SYMVER_TRUE@ $(libga68_la_OBJECTS) $(libga68_la_LIBADD) \
@LIBGA68_USE_SYMVER_SUN_TRUE@@LIBGA68_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
+.a68.o:
+ $(A68) -o $@ $(A68FLAGS) -c $<
+
+.a68.lo:
+ $(LTA68COMPILE) $(A68FLAGS) $(MULTIFLAGS) -c -o $@ $<
+
+transput.a68 : transput.a68.in
+ $(AWK) -f $(srcdir)/sppp.awk $< > $@
+
# target overrides
-include $(tmake_file)
+dnl Copyright (C) 2025 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+m4_include([m4/autoconf.m4])
+
dnl Check whether the target supports hidden visibility.
AC_DEFUN([LIBGA68_CHECK_ATTRIBUTE_VISIBILITY], [
AC_CACHE_CHECK([whether the target supports hidden visibility],
RANLIB
NM
AR
+A68FLAGS
+A68
am__fastdepCCAS_FALSE
am__fastdepCCAS_TRUE
CCASDEPMODE
CPP C preprocessor
CCAS assembler compiler command (defaults to CC)
CCASFLAGS assembler compiler flags (defaults to CFLAGS)
+ A68 Algol 68 compiler command
+ A68FLAGS Algol 68 compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
fi
+ac_ext=a68
+ac_compile='$A68 -c $A68FLAGS conftest.$ac_ext >&5'
+ac_link='$A68 -o conftest$ac_exeext $A68FLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=yes
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ga68", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ga68; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_A68+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$A68"; then
+ ac_cv_prog_A68="$A68" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_A68="${ac_tool_prefix}ga68"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+A68=$ac_cv_prog_A68
+if test -n "$A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68" >&5
+$as_echo "$A68" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_A68"; then
+ ac_ct_A68=$A68
+ # Extract the first word of "ga68", so it can be a program name with args.
+set dummy ga68; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_A68+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_A68"; then
+ ac_cv_prog_ac_ct_A68="$ac_ct_A68" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_A68="ga68"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_A68=$ac_cv_prog_ac_ct_A68
+if test -n "$ac_ct_A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_A68" >&5
+$as_echo "$ac_ct_A68" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_A68" = x; then
+ A68=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ A68=$ac_ct_A68
+ fi
+else
+ A68="$ac_cv_prog_A68"
+fi
+
+if test -z "$A68"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ga68", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ga68; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_A68+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$A68"; then
+ ac_cv_prog_A68="$A68" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_A68="$ac_tool_prefix}ga68"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+A68=$ac_cv_prog_A68
+if test -n "$A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68" >&5
+$as_echo "$A68" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$A68"; then
+ # Extract the first word of "ga68", so it can be a program name with args.
+set dummy ga68; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_A68+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$A68"; then
+ ac_cv_prog_A68="$A68" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "false"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_A68="ga68"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_A68
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set A68 to just the basename; use the full file name.
+ shift
+ ac_cv_prog_A68="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+A68=$ac_cv_prog_A68
+if test -n "$A68"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A68" >&5
+$as_echo "$A68" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Algol 68 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ { ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler --version >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+A68FLAGS="-g -O2"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12604 "configure"
+#line 12832 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12710 "configure"
+#line 12938 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
m4_define([_AC_ARG_VAR_PRECIOUS],[])
AC_PROG_CC
AM_PROG_AS
+AC_PROG_A68
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
AC_SUBST(CFLAGS)
--- /dev/null
+#
+# Minimal autoconf support for the Algol 68 language.
+# Adapted from the Algol 68 language support files.
+#
+
+# ------------------- #
+# Language selection.
+# ------------------- #
+
+# AC_LANG(A68)
+# ------------
+AC_LANG_DEFINE([Algol 68], [a68], [A68], [A68], [],
+[ac_ext=a68
+ac_compile='$A68 -c $A68FLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
+ac_link='$A68 -o conftest$ac_exeext $A68FLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
+ac_compiler_gnu=yes
+])
+
+# AC_LANG_A68
+# -----------
+AU_DEFUN([AC_LANG_A68], [AC_LANG(Algol 68)])
+
+# ------------------- #
+# Producing programs.
+# ------------------- #
+
+# AC_LANG_PROGRAM(Algol 68)([PROLOGUE], [BODY])
+# ---------------------------------------------
+m4_define([AC_LANG_PROGRAM(Algol 68)],
+[$1
+begin $2 m4_ifnblank([$2],[;])
+ skip
+end])
+
+# _AC_LANG_IO_PROGRAM(Algol 68)
+# -----------------------------
+# Produce source that performs I/O.
+m4_define([_AC_LANG_IO_PROGRAM(Algol 68)],
+[AC_LANG_PROGRAM([],
+[if int fd = fcreate ("conftest.out", 8r0777); fd = -1
+ then perror ("error creating conftest.out")
+ elif fclose (fd) = -1 then perror ("error closing conftest.out")
+ fi
+])])
+
+# AC_LANG_CALL(Algol 68)(PROLOGUE, FUNCTION)
+# ------------------------------------------
+# Avoid conflicting decl of main.
+m4_define([AC_LANG_CALL(Algol 68)],
+[AC_LANG_PROGRAM([],[])])
+
+# AC_LANG_FUNC_LINK_TRY(Algol 68)(FUNCTION)
+# -----------------------------------------
+# Try to link a program which calls FUNCTION.
+m4_define([AC_LANG_FUNC_LINK_TRY(Algol 68)],
+[AC_LANG_PROGRAM([],[])])
+
+# AC_LANG_BOOL_COMPILE_TRY(Algol 68)(PROLOGUE, EXPRESSION)
+# --------------------------------------------------------
+# Return a program which is valid if EXPRESSION is nonzero.
+m4_define([AC_LANG_BOOL_COMPILE_TRY(Algol 68)],
+[AC_LANG_PROGRAM([], [@<:@$2@:>@INT test multiple;
+ 0])])
+
+# AC_LANG_INT_SAVE(Algol 68)(PROLOGUE, EXPRESSION)
+# ------------------------------------------------
+m4_define([AC_LANG_INT_SAVE(Algol 68)],
+[AC_LANG_PROGRAM([
+proc itoa = (int i) string:
+ begin if i = 0
+ then "0"
+ else int n := ABS i;
+ string res;
+ while n /= 0
+ do int rem = n %* 10;
+ res := (REPR (rem > 9 | (rem - 10) + ABS "a"
+ | rem + ABS "0")
+ + res);
+ n %:= 10
+ od;
+ (i < 0 | "-" + res | res)
+ fi
+ end;
+
+int ret := 0;
+int fd = fopen ("conftest.val", file o wronly)/
+(fd = -1 | ret := 1; stop);
+(fputs (fd, itoa ($2)) = 0 | ret := 1; stop)
+])])
+
+# ---------------------- #
+# Looking for compilers. #
+# ---------------------- #
+
+# AC_LANG_COMPILER(Algol 68)
+# --------------------------
+AC_DEFUN([AC_LANG_COMPILER(Algol 68)],
+[AC_REQUIRE([AC_PROG_A68])])
+
+# AC_PROG_A68
+# ------------
+AN_MAKEVAR([A68], [AC_PROG_A68])
+AN_PROGRAM([ga68], [AC_PROG_A68])
+AC_DEFUN([AC_PROG_A68],
+[AC_LANG_PUSH(Algol 68)dnl
+AC_ARG_VAR([A68], [Algol 68 compiler command])dnl
+AC_ARG_VAR([A68FLAGS], [Algol 68 compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(A68, [$1])],
+[AC_CHECK_TOOL(A68, ga68)
+if test -z "$A68"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(A68, [${ac_tool_prefix}ga68], [$ac_tool_prefix}ga68])
+ fi
+fi
+if test -z "$A68"; then
+ AC_CHECK_PROG(A68, ga68, ga68, , , false)
+fi
+])
+
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+set X $ac_compile
+ac_compiler=$[2]
+_AC_DO_LIMIT([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+A68FLAGS="-g -O2"
+AC_LANG_POP(Algol 68)dnl
+])# AC_PROG_A68
--- /dev/null
+# sppp - the Standard Prelude Pre-Processor
+#
+# Copyright (C) 2025 Jose E. Marchesi
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+function error(msg)
+{
+ print FILENAME ":" msg | "cat 1>&2"
+ exit (1)
+}
+
+BEGIN {
+ num_alternatives = 0
+ in_iter = 0
+ template = ""
+}
+
+/^[ \t]*\{ Process this file/ {
+ print "{ This is auto-generated from " FILENAME ". Do not edit. }"
+ next
+}
+
+/^[ \t]*\{[ \t]*iter[ \t]+/ {
+ if (match ($0, /[ \t]*\{[ \t]*iter[ \t]+([a-zA-Z_]+)[\t ]*(\{.*\}[ \t]*){1,}[ \t]*\}/, matches) == 0)
+ error(FNR ": invalid iter")
+
+ iter_name = matches[1]
+ iter_alts = matches[2]
+
+ # Count and collect alternatives. #
+ iter_num_alternatives = 0
+ while (match (iter_alts, /[ \t]*\{([^\}]*)\}/, matches) > 0)
+ {
+ iter_num_alternatives++
+ iter_alts = substr (iter_alts, RSTART + RLENGTH)
+ iter_names[iter_name] = 1
+ iterators[iter_name,iter_num_alternatives] = matches[1]
+ }
+
+ if (in_iter == 1)
+ {
+ if (iter_num_alternatives != num_alternatives)
+ error(FNR ": invalid number of alternatives in iterator")
+ }
+
+ num_alternatives = iter_num_alternatives
+ in_iter = 1
+ next
+}
+
+/^[ \t]*\{[ \t]*reti/ {
+ separator = ""
+ if (match ($0, /[ \t]*\{[ \t]*reti[ \t]+\{([^\}]*)\}/, matches) > 0)
+ separator = matches[1]
+
+ for (nalt = 1; nalt <= num_alternatives; nalt++)
+ {
+ output = template
+ for (iter_name in iter_names)
+ {
+ while (sub ("\\{" iter_name "\\}", iterators[iter_name,nalt], output)) {}
+ }
+ printf "%s%s\n", substr (output, 0, length(output) - 1), nalt < num_alternatives ? separator : ""
+ }
+
+ for (key in iter_names) delete iter_names[key]
+ for (key in iterators) delete iterators[key]
+ in_iter = 0;
+ template = ""
+ num_alternatives = 0
+ next
+}
+
+in_iter == 1 {
+ template = template $0 "\n"
+ next
+}
+
+{
+ print $0
+}
--- /dev/null
+{ Process this file with sppp.awk }
+
+{ transput.a68.in - Standard transput.
+
+ Copyright (C) 2025 Jose E. Marchesi
+
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License
+ and a copy of the GCC Runtime Library Exception along with this
+ program; see the files COPYING3 and COPYING.RUNTIME respectively.
+ If not, see <http://www.gnu.org/licenses/>. }
+
+module Transput =
+def
+ { 10.3.2.1. Conversion routines. }
+
+ mode Number = union (
+ {iter L {short short} {short} {} {long} {long long}}
+ {L} int
+ {reti {,}}
+ ,
+ {iter L {} {long} {long long}}
+ {L} real
+ {reti {,}}
+ );
+
+ pub proc whole = (Number v, int width) string:
+ case v in
+ {iter L {short short} {short} {} {long} {long long}}
+ {iter L_ {short_short_} {short_} {} {long_} {long_long_}}
+ ({L} int x):
+ (int length := ABS width - (x < {L} 0 OR width > 0 | 1 | 0),
+ {L} int n := ABS x;
+ if width = 0
+ then {L} int m := n; length := 0;
+ while m %:= {L} 10; length +:= 1; m /= {L} 0
+ do ~ od
+ fi;
+ string s := subwhole (n, length);
+ if length = 0 OR char_in_string (errorchar, loc int, s)
+ then ABS width * errorchar
+ else (x < {L} 0 | "-" |: width > 0 | "+" | "") +=: s;
+ (width /= 0 | (ABS width - UPB s) * " " +=: s);
+ s
+ fi),
+ ({L} real x): fixed (x, width, 0)
+ {reti {,}}
+ esac;
+
+ pub proc fixed = (Number v, int width, after) string:
+ case v in
+ {iter L {} {long} {long long}}
+ ({L} real x):
+ if int length := ABS width - (x < {L} 0 OR width > 0 | 1 | 0);
+ after >= 0 AND (length > after OR width = 0)
+ then {L} real y = ABS x;
+ if width = 0
+ then length := (after = 0 | 1 | 0);
+ while y + {L} .5 * {L} .1 ** after >= {L} 10 ** length
+ do length +:= 1 od;
+ length +:= (after = 0 | 0 | after + 1)
+ fi;
+ string s := subfixed (y, length, after);
+ if ~char_in_string (errorchar, loc int, s)
+ then (length > UPB s AND y < {L} 1.0 | "0" +=: s);
+ (x < {L} 0 | "-" |: width > 0 | "+" | "") +=: s;
+ (width /= 0 | (ABS width - UPB s) * " " +=: s);
+ s
+ elif after > 0
+ then fixed (v, width, after - 1)
+ else ABS width * errorchar
+ fi
+ else { XXX undefined } skip; ABS width * errorchar
+ fi,
+ ({L} int x): fixed ({L} real (x), width, after)
+ {reti {,}}
+ esac;
+
+ pub proc float = (Number v, int width, after, exp) string:
+ case v in
+ {iter L {} {long} {long long}}
+ {iter L_ {} {long_} {long_long_}}
+ ({L} real x):
+ if int before = ABS width - ABS exp - (after /= 0 | after+1 | 0) - 2;
+ SIGN before + SIGN after > 0
+ then string s, {L} real y := ABS x, int p := 0;
+ {L_}standardize (y, before, after, p);
+ s := fixed (SIGN (x * y), SIGN width * (ABS width - ABS exp - 1),
+ after) + "*^" + whole (p, exp);
+ if exp = 0 OR char_in_string (errorchar, loc int, s)
+ then float (x, width, (after /= 0 | after-1 | 0),
+ (exp > 0 | exp+1 | exp-1))
+ else s
+ fi
+ else { XXX undefined } skip; ABS width * errorchar
+ fi,
+ ({L} int x): float ({L} real (x), width, after, exp)
+ {reti {,}}
+ esac;
+
+ { Returns a string of maximum length `width' containing a decimal
+ representation of the positive integer `v'. }
+
+ proc subwhole = (Number v, int width) string:
+ case v in
+ {iter L {short short} {short} {} {long} {long long}}
+ {iter S {LENG LENG} {LENG} {} {SHORTEN} {SHORTEN SHORTEN}}
+ ({L} int x):
+ begin string s, {L} int n := x;
+ while dig_char ({S} (n MOD {L} 10)) +=: s;
+ n %:= {L} 10; n /= {L} 0
+ do ~ od;
+ (UPB s > width | width * errorchar | s)
+ end
+ {reti {,}}
+ esac;
+
+ { Returns a string of maximum length `width' containing a rounded
+ decimal representation of the positive real number `v'; if
+ `after' is greater than zero, this string contains a decimal
+ point followed by `after' digits. }
+
+ proc subfixed = (Number v, int width, after) string:
+ case v in
+ {iter L {} {long} {long long}}
+ {iter K {} {LENG} {LENG LENG}}
+ {iter S {} {SHORTEN} {SHORTEN SHORTEN}}
+ ({L} real x):
+ begin string s, int before := 0;
+ {L} real y := x + {L} .5 * {L} .1 ** after;
+ proc choosedig = (ref {L} real y) char:
+ dig_char ((int c := {S} ENTIER (y *:= {L} 10.0); (c > 9 | c := 9);
+ y -:= {K} c; c));
+ while y >= {L} 10.0 ** before do before +:= 1 od;
+ y /:= {L} 10.0 ** before;
+ to before do s +:= choosedig (y) od;
+ (after > 0 | s +:= ".");
+ to after do s +:= choosedig (y) od;
+ (UPB s > width | width * errorchar | s)
+ end
+ {reti {,}}
+ esac;
+
+ { Adjusts the value of `y' so that it may be transput according to
+ the format $ n(before)d, n(after)d $; `p' is set so that y * 10
+ ** p is equal to the original value of `y'. }
+
+ {iter L {} {long} {long long}}
+ {iter L_ {} {long_} {long_long_}}
+ proc {L_}standardize = (ref {L} real y, int before, after, ref int p) void:
+ begin
+ {L} real g = {L} 10.0 ** before; {L} real h = g * {L} .1;
+ while y >= g do y *:= {L} .1; p +:= 1 od;
+ (y /= {L} 0.0 | while y < h do y *:= {L} 10.0; p -:= 1 od);
+ (y + {L} .5 * {L} .1 ** after >= g | y := h; p +:= 1)
+ end;
+ {reti}
+
+ proc dig_char = (int x) char: "0123456789abcdef"[x+1];
+
+ { Returns true if the absolute value of the result is
+ <= L max int }
+
+ {iter L {short short} {short} {} {long} {long long}}
+ {iter K {SHORTEN SHORTEN} {SHORTEN} {} {LENG} {LENG LENG}}
+ {iter L_ {short_short_} {short_} {} {long_} {long_long_}}
+ proc string_to_{L_}int = (string s, int radix, ref {L} int i) bool:
+ begin
+ {L} int lr = {K} radix; bool safe := true;
+ {L} int n := {L} 0, {L} int m = {L_}max_int % lr;
+ {L} int m1 = {L_}max_int - m * lr;
+ for i from 2 to UPB s
+ while {L} int dig = {K} char_dig (s[i]);
+ safe := n < m OR n = m AND dig <= m1
+ do n := n * lr + dig od;
+ if safe then i := (s[1] = "+" | n | -n); true else false fi
+ end;
+ {reti}
+
+ { Returns true if the absolute value of the result is <= L max
+ real. }
+
+ {iter L {} {long} {long long}}
+ {iter K {} {LENG} {LENG LENG}}
+ {iter S {} {SHORTEN} {SHORTEN SHORTEN}}
+ {iter L_ {} {long_} {long_long_}}
+ pub proc string_to_{L_}real = (string s, ref {L} real r) bool:
+ begin
+ int e := UPB s + 1;
+ char_in_string ("^" { XXX unicode 10^ }, e, s);
+ int p := e; char_in_string (".", p, s);
+ int j := 1, length := 0, {L} real x := {L} 0.0;
+ { Skip leading zeroes: }
+ for i from 2 to e - 1
+ while s[i] = "0" OR s[i] = "." OR s[i] = "_."
+ do j := i od;
+ for i from j + 1 to e - 1 while length < {L_}real_width
+ do
+ if s[i] /= "."
+ then x := x * {L} 10.0 + {K} char_dig (s[j:=i]); length +:= 1
+ fi { all significant digits converted. }
+ od;
+ { Set preliminary exponent: }
+ int exp := (p > j | p - j - 1 | p - j), expart := 0;
+ { Convert exponent part: }
+ bool safe := if e < UPB s
+ then {L} int tmp := {K} expart;
+ bool b = string_to_{L_}int (s[e+1:], 10, tmp);
+ expart = {S} tmp;
+ b
+ else true
+ fi;
+ { Prepare a representation of L max real to compare with the L
+ real value to be delivered: }
+ {L} real max_stag := {L_}max_real, int max_exp := 0;
+ {L_}standardize (max_stag, length, 0, max_exp); exp +:= expart;
+ if ~safe OR (exp > max_exp OR exp = max_exp AND x > max_stag)
+ then false
+ else r := (s[1] = "+" | x | -x) * {L} 10.0 ** exp; true
+ fi
+ end;
+ {reti}
+
+ proc char_dig = (char x) int:
+ (x = "." | 0 | int i; char_in_string (x,i,"0123456789abcdef"); i-1);
+
+ pub proc char_in_string = (char c, ref int i, string s) bool:
+ begin bool found := false;
+ for k from LWB s to UPB s while ~found
+ do (c = s[k] | i := k; found := true) od;
+ found
+ end;
+
+ { The smallest integral value such that `L max int' may be
+ converted without error using the pattern n(L int width)d }
+
+ {iter L {} {long} {long long}}
+ {iter L_ {} {long_} {long_long_}}
+ pub int {L_}int_width =
+ (int c := 1; while {L} 10 ** (c - 1) < {L} .1 * {L_}max_int do c +:= 1 od;
+ c);
+ {reti}
+
+ { The smallest integral value such that different string are
+ produced by conversion of `1.0' and of `1.0 + L small real'
+ using the pattern d .n(L real width - 1)d }
+
+ {iter L {} {long} {long long}}
+ {iter L_ {} {long_} {long_long_}}
+ {iter S {} {SHORTEN} {SHORTEN SHORTEN}}
+ pub int {L_}real_width = 1 - {S} ENTIER ({L_}ln ({L_}small_real) / {L_}ln ({L} 10));
+ {reti}
+
+ { The smallest integral value such that `L max real' may be
+ converted without error using the pattern
+ d .n(L real width - 1)d e n(L exp with)d }
+
+ {iter L {} {long} {long long}}
+ {iter L_ {} {long_} {long_long_}}
+ {iter S {} {SHORTEN} {SHORTEN SHORTEN}}
+ pub int {L_}exp_width =
+ 1 + {S} ENTIER ({L_}ln ({L_}ln ({L_}max_real) / {L_}ln ({L} 10)) / {L_}ln ({L} 10));
+ {reti}
+
+ skip
+fed