fi
-add_arg_to_tcflags() {
+add_arg_to_cflags() {
- local i=1
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAG $1" >&5
$as_echo_n "checking for CFLAG $1... " >&6; }
CFLAGS_ORI=$CFLAGS
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- TCFLAGS="$TCFLAGS $1";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };i=0
+ CFLAGS="$CFLAGS_ORI $1";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };return 0
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
CFLAGS=$CFLAGS_ORI
- return $i
+ return 1
}
-assert_arg_to_tcflags() {
- if ! add_arg_to_tcflags $1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot add $1 to CFLAGS" >&5
+assert_arg_to_cflags() {
+ if ! add_arg_to_cflags $1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot add $1 to CFLAGS" >&5
$as_echo "cannot add $1 to CFLAGS" >&6; }; exit 1 ; fi
return 0
}
-add_args_to_tcflags() {
+add_args_to_cflags() {
while test "$#" -ge 1 ; do
- add_arg_to_tcflags $1
+ add_arg_to_cflags $1
shift
done
}
-add_arg_to_tldflags() {
+add_arg_to_ldflags() {
- local i=1
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAG $1" >&5
$as_echo_n "checking for LDFLAG $1... " >&6; }
LDFLAGS_ORI=$LDFLAGS
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
- TLDFLAGS="$TLDFLAGS $1";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };i=0
+ LDFLAGS="$LDFLAGS_ORI $1";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };return 0
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
LDFLAGS=$LDFLAGS_ORI
- return $i
+ return 1
}
-assert_arg_to_tldflags() {
- if ! add_arg_to_tldflags $1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot add $1 to LDFLAGS" >&5
+assert_arg_to_ldflags() {
+ if ! add_arg_to_ldflags $1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot add $1 to LDFLAGS" >&5
$as_echo "cannot add $1 to LDFLAGS" >&6; }; exit 1 ; fi
return 0
}
-add_args_to_tldflags() {
+add_args_to_ldflags() {
while test "$#" -ge 1 ; do
- add_arg_to_tldflags $1
+ add_arg_to_ldflags $1
shift
done
}
}
-TCFLAGS=""
-add_args_to_tcflags -fsigned-char -pipe \
+add_args_to_cflags -fsigned-char -pipe \
-fno-builtin-malloc -fno-builtin-free \
-fno-PIE -fno-pie -fno-PIC -fno-pic \
-Wall \
-Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-Wno-unused-but-set-variable -Wno-misleading-indentation
-TLDFLAGS=""
-add_args_to_tldflags -Wl,-no_pie -no-pie -Wl,-z,lazy
+add_args_to_ldflags -Wl,-no_pie -no-pie -Wl,-z,lazy
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5
$as_echo_n "checking for clang... " >&6; }
case $use in
*mingw*)
- assert_arg_to_tcflags -fno-zero-initialized-in-bss
- assert_arg_to_tcflags -mms-bitfields;;
+ assert_arg_to_cflags -fno-zero-initialized-in-bss
+ assert_arg_to_cflags -mms-bitfields;;
*gnuwin*)
- assert_arg_to_tcflags -fno-zero-initialized-in-bss
- assert_arg_to_tcflags -mms-bitfields
- assert_arg_to_tldflags -Wl,--stack,8000000;;
+ assert_arg_to_cflags -fno-zero-initialized-in-bss
+ assert_arg_to_cflags -mms-bitfields
+ assert_arg_to_ldflags -Wl,--stack,8000000;;
386-macosx)
- assert_arg_to_tldflags -Wl,-no_pie
+ assert_arg_to_ldflags -Wl,-no_pie
if test "$build_cpu" = "x86_64" ; then
- assert_arg_to_tcflags -m64
- assert_arg_to_tldflags -m64
- assert_arg_to_tldflags -Wl,-headerpad,72
+ assert_arg_to_cflags -m64
+ assert_arg_to_ldflags -m64
+ assert_arg_to_ldflags -Wl,-headerpad,72
else
- assert_arg_to_tcflags -m32
- assert_arg_to_tldflags -m32
- assert_arg_to_tldflags -Wl,-headerpad,56
+ assert_arg_to_cflags -m32
+ assert_arg_to_ldflags -m32
+ assert_arg_to_ldflags -Wl,-headerpad,56
fi;;
- FreeBSD) assert_arg_to_tldflags -Z;;
+ FreeBSD) assert_arg_to_ldflags -Z;;
esac
if test "$enable_static" = "yes" ; then
- assert_arg_to_tldflags -static
- assert_arg_to_tldflags -Wl,-zmuldefs
+ assert_arg_to_ldflags -static
+ assert_arg_to_ldflags -Wl,-zmuldefs
$as_echo "#define STATIC_LINKING 1" >>confdefs.h
#define GCL_GPROF_START $GCL_GPROF_START
_ACEOF
- assert_arg_to_tcflags -pg
+ assert_arg_to_cflags -pg
case $use in
s390*) ;; # relocation truncation bug in gcc
*) TLIBS="$TLIBS -pg";;
if test "$enable_debug" = "yes" ; then
- assert_arg_to_tcflags -g
+ assert_arg_to_cflags -g
# for subconfigurations
CFLAGS="$CFLAGS -g"
else
# gcc on ppc cannot compile our new_init.c with full opts --CM
TONIFLAGS=""
case $use in
- powerpc*macosx) assert_arg_to_tcflags -mlongcall;;
+ powerpc*macosx) assert_arg_to_cflags -mlongcall;;
*linux)
case $use in
alpha*)
- assert_arg_to_tcflags -mieee
+ assert_arg_to_cflags -mieee
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
;;
aarch64*)
TLIBS="$TLIBS -lgcc_s";;
hppa*)
- assert_arg_to_tcflags -mlong-calls
+ assert_arg_to_cflags -mlong-calls
TLIBS="$TLIBS -lgcc_s" # workaround hppa __moddi3 local func symbols with default linker flags
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O2" ; TFPFLAG=""; fi #FIXME needed asof gcc 4.8.1
;;
mips*)
case $canonical in
mips64*linux*)
- assert_arg_to_tldflags -Wl,-z,now;;
+ assert_arg_to_ldflags -Wl,-z,now;;
esac
;;
ia64*)
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.8.1
;;
arm*)
- assert_arg_to_tcflags -mlong-calls
- assert_arg_to_tcflags -fdollars-in-identifiers
- assert_arg_to_tcflags -g #?
+ assert_arg_to_cflags -mlong-calls
+ assert_arg_to_cflags -fdollars-in-identifiers
+ assert_arg_to_cflags -g #?
;;
powerpc*)
- assert_arg_to_tcflags -mlongcall
+ assert_arg_to_cflags -mlongcall
;;
esac;;
esac
if test "$enable_pic" = "yes" ; then
- assert_arg_to_tcflags -fPIC
+ assert_arg_to_cflags -fPIC
fi
TLIBS="$TLIBS -ldl -rdynamic"
- assert_arg_to_tcflags -fPIC
+ assert_arg_to_cflags -fPIC
$as_echo "#define USE_DLOPEN 1" >>confdefs.h
if test "$XDR_LIB" != " "; then
TLIBS="$TLIBS -l$XDR_LIB"
- add_arg_to_tcflags -I/usr/include/$XDR_LIB
+ add_arg_to_cflags -I/usr/include/$XDR_LIB
fi
fi
fi
$as_echo_n "checking finding default linker script... " >&6; }
touch unixport/gcl.script
echo "int main() {return 0;}" >foo.c
- $CC $TLDFLAGS -Wl,--verbose foo.c -o foo 2>&1 | \
+ $CC $LDFLAGS -Wl,--verbose foo.c -o foo 2>&1 | \
$AWK '/\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=/ {i=1-i;next} {if (i) print}' >gcl.script
rm -rf foo.c foo
cat gcl.script.def | $AWK '/SIZEOF_HEADERS/ {gsub("0x[0-9]*","0x" j,$0);} {print}' j=$j >gcl.script
# diff -u gcl.script.def gcl.script
echo "int main() {return 0;}" >foo.c
- if ( $CC $TLDFLAGS -Wl,-T gcl.script foo.c -o foo && ./foo ) >/dev/null 2>&1 ; then
+ if ( $CC $LDFLAGS -Wl,-T gcl.script foo.c -o foo && ./foo ) >/dev/null 2>&1 ; then
if test $n -lt $min ; then min=$n; fi;
if test $n -gt $max; then max=$n; fi;
elif test $max -gt 0 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
$as_echo "done" >&6; }
rm -f gcl.script.def
- LDFLAGS="$LDFLAGS -Wl,-T gcl.script "
+ assert_arg_to_ldflags -Wl,-T,gcl.script
cp gcl.script unixport
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none found or not needed" >&5
-LDFLAGS="`echo $LDFLAGS | sed 's,gcl.script,../unixport/gcl.script,g'` $TLDFLAGS"
+LDFLAGS="`echo $LDFLAGS | sed 's,gcl.script,../unixport/gcl.script,g'`"
LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS $TLIBS"
-FINAL_CFLAGS="$CFLAGS $CPPFLAGS $X_CFLAGS $TCFLAGS"
+FINAL_CFLAGS="$CFLAGS $CPPFLAGS $X_CFLAGS"
# Work around bug with gcc on ppc -- CM
-NIFLAGS="$CFLAGS $CPPFLAGS $TCFLAGS $TONIFLAGS -I\$(GCLDIR)/o"
+NIFLAGS="$CFLAGS $CPPFLAGS $TONIFLAGS -I\$(GCLDIR)/o"
-CFLAGS="$CFLAGS $CPPFLAGS $TCFLAGS $TO3FLAGS -I\$(GCLDIR)/o"
+CFLAGS="$CFLAGS $CPPFLAGS $TO3FLAGS -I\$(GCLDIR)/o"
O3FLAGS=$TO3FLAGS
fi
AC_SUBST(GCL_CC)
-add_arg_to_tcflags() {
+add_arg_to_cflags() {
- local i=1
AC_MSG_CHECKING([for CFLAG $1])
CFLAGS_ORI=$CFLAGS
CFLAGS="$CFLAGS -Werror $1 `echo $1|sed 's,-Wno-,-W,1'`"
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[]],[[]])],
- [TCFLAGS="$TCFLAGS $1";AC_MSG_RESULT([yes]);i=0],
+ [CFLAGS="$CFLAGS_ORI $1";AC_MSG_RESULT([yes]);return 0],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([no])])
CFLAGS=$CFLAGS_ORI
- return $i
+ return 1
}
-assert_arg_to_tcflags() {
- if ! add_arg_to_tcflags $1 ; then AC_MSG_RESULT([cannot add $1 to CFLAGS]); exit 1 ; fi
+assert_arg_to_cflags() {
+ if ! add_arg_to_cflags $1 ; then AC_MSG_RESULT([cannot add $1 to CFLAGS]); exit 1 ; fi
return 0
}
-add_args_to_tcflags() {
+add_args_to_cflags() {
while test "$#" -ge 1 ; do
- add_arg_to_tcflags $1
+ add_arg_to_cflags $1
shift
done
}
-add_arg_to_tldflags() {
+add_arg_to_ldflags() {
- local i=1
AC_MSG_CHECKING([for LDFLAG $1])
LDFLAGS_ORI=$LDFLAGS
LDFLAGS="$LDFLAGS -Werror $1"
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[]],[[]])],
- [TLDFLAGS="$TLDFLAGS $1";AC_MSG_RESULT([yes]);i=0],
+ [LDFLAGS="$LDFLAGS_ORI $1";AC_MSG_RESULT([yes]);return 0],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([no])])
LDFLAGS=$LDFLAGS_ORI
- return $i
+ return 1
}
-assert_arg_to_tldflags() {
- if ! add_arg_to_tldflags $1 ; then AC_MSG_RESULT([cannot add $1 to LDFLAGS]); exit 1 ; fi
+assert_arg_to_ldflags() {
+ if ! add_arg_to_ldflags $1 ; then AC_MSG_RESULT([cannot add $1 to LDFLAGS]); exit 1 ; fi
return 0
}
-add_args_to_tldflags() {
+add_args_to_ldflags() {
while test "$#" -ge 1 ; do
- add_arg_to_tldflags $1
+ add_arg_to_ldflags $1
shift
done
}
}
-TCFLAGS=""
-add_args_to_tcflags -fsigned-char -pipe \
+add_args_to_cflags -fsigned-char -pipe \
-fno-builtin-malloc -fno-builtin-free \
-fno-PIE -fno-pie -fno-PIC -fno-pic \
-Wall \
-Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-Wno-unused-but-set-variable -Wno-misleading-indentation
-TLDFLAGS=""
-add_args_to_tldflags -Wl,-no_pie -no-pie -Wl,-z,lazy
+add_args_to_ldflags -Wl,-no_pie -no-pie -Wl,-z,lazy
AC_MSG_CHECKING([for clang])
AC_RUN_IFELSE(
case $use in
*mingw*)
- assert_arg_to_tcflags -fno-zero-initialized-in-bss
- assert_arg_to_tcflags -mms-bitfields;;
+ assert_arg_to_cflags -fno-zero-initialized-in-bss
+ assert_arg_to_cflags -mms-bitfields;;
*gnuwin*)
- assert_arg_to_tcflags -fno-zero-initialized-in-bss
- assert_arg_to_tcflags -mms-bitfields
- assert_arg_to_tldflags -Wl,--stack,8000000;;
+ assert_arg_to_cflags -fno-zero-initialized-in-bss
+ assert_arg_to_cflags -mms-bitfields
+ assert_arg_to_ldflags -Wl,--stack,8000000;;
386-macosx)
- assert_arg_to_tldflags -Wl,-no_pie
+ assert_arg_to_ldflags -Wl,-no_pie
if test "$build_cpu" = "x86_64" ; then
- assert_arg_to_tcflags -m64
- assert_arg_to_tldflags -m64
- assert_arg_to_tldflags -Wl,-headerpad,72
+ assert_arg_to_cflags -m64
+ assert_arg_to_ldflags -m64
+ assert_arg_to_ldflags -Wl,-headerpad,72
else
- assert_arg_to_tcflags -m32
- assert_arg_to_tldflags -m32
- assert_arg_to_tldflags -Wl,-headerpad,56
+ assert_arg_to_cflags -m32
+ assert_arg_to_ldflags -m32
+ assert_arg_to_ldflags -Wl,-headerpad,56
fi;;
- FreeBSD) assert_arg_to_tldflags -Z;;
+ FreeBSD) assert_arg_to_ldflags -Z;;
esac
if test "$enable_static" = "yes" ; then
- assert_arg_to_tldflags -static
- assert_arg_to_tldflags -Wl,-zmuldefs
+ assert_arg_to_ldflags -static
+ assert_arg_to_ldflags -Wl,-zmuldefs
AC_DEFINE(STATIC_LINKING,1,[staticly linked images])
fi
if test "$GCL_GPROF_START" != "" ; then
AC_MSG_RESULT($GCL_GPROF_START)
AC_DEFINE_UNQUOTED(GCL_GPROF_START,$GCL_GPROF_START,[starting address for gprof])
- assert_arg_to_tcflags -pg
+ assert_arg_to_cflags -pg
case $use in
s390*) ;; # relocation truncation bug in gcc
*) TLIBS="$TLIBS -pg";;
fi])
if test "$enable_debug" = "yes" ; then
- assert_arg_to_tcflags -g
+ assert_arg_to_cflags -g
# for subconfigurations
CFLAGS="$CFLAGS -g"
else
# gcc on ppc cannot compile our new_init.c with full opts --CM
TONIFLAGS=""
case $use in
- powerpc*macosx) assert_arg_to_tcflags -mlongcall;;
+ powerpc*macosx) assert_arg_to_cflags -mlongcall;;
*linux)
case $use in
alpha*)
- assert_arg_to_tcflags -mieee
+ assert_arg_to_cflags -mieee
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
;;
aarch64*)
TLIBS="$TLIBS -lgcc_s";;
hppa*)
- assert_arg_to_tcflags -mlong-calls
+ assert_arg_to_cflags -mlong-calls
TLIBS="$TLIBS -lgcc_s" # workaround hppa __moddi3 local func symbols with default linker flags
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O2" ; TFPFLAG=""; fi #FIXME needed asof gcc 4.8.1
;;
mips*)
case $canonical in
mips64*linux*)
- assert_arg_to_tldflags -Wl,-z,now;;
+ assert_arg_to_ldflags -Wl,-z,now;;
esac
;;
ia64*)
if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.8.1
;;
arm*)
- assert_arg_to_tcflags -mlong-calls
- assert_arg_to_tcflags -fdollars-in-identifiers
- assert_arg_to_tcflags -g #?
+ assert_arg_to_cflags -mlong-calls
+ assert_arg_to_cflags -fdollars-in-identifiers
+ assert_arg_to_cflags -g #?
;;
powerpc*)
- assert_arg_to_tcflags -mlongcall
+ assert_arg_to_cflags -mlongcall
;;
esac;;
esac
if test "$enable_pic" = "yes" ; then
- assert_arg_to_tcflags -fPIC
+ assert_arg_to_cflags -fPIC
fi
AC_CHECK_LIB([dl],[dlopen],,AC_MSG_ERROR([Cannot find dlopen]))
TLIBS="$TLIBS -ldl -rdynamic"
- assert_arg_to_tcflags -fPIC
+ assert_arg_to_cflags -fPIC
AC_DEFINE(USE_DLOPEN,1,[link compiled objects via libdl])
fi
AC_DEFINE(HAVE_XDR,1,[have xdr extensions])
if test "$XDR_LIB" != " "; then
TLIBS="$TLIBS -l$XDR_LIB"
- add_arg_to_tcflags -I/usr/include/$XDR_LIB
+ add_arg_to_cflags -I/usr/include/$XDR_LIB
fi
fi
fi
AC_MSG_CHECKING([finding default linker script])
touch unixport/gcl.script
echo "int main() {return 0;}" >foo.c
- $CC $TLDFLAGS -Wl,--verbose foo.c -o foo 2>&1 | \
+ $CC $LDFLAGS -Wl,--verbose foo.c -o foo 2>&1 | \
$AWK '/\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=/ {i=1-i;next} {if (i) print}' >gcl.script
rm -rf foo.c foo
cat gcl.script.def | $AWK '/SIZEOF_HEADERS/ {gsub("0x[[0-9]]*","0x" j,$0);} {print}' j=$j >gcl.script
# diff -u gcl.script.def gcl.script
echo "int main() {return 0;}" >foo.c
- if ( $CC $TLDFLAGS -Wl,-T gcl.script foo.c -o foo && ./foo ) >/dev/null 2>&1 ; then
+ if ( $CC $LDFLAGS -Wl,-T gcl.script foo.c -o foo && ./foo ) >/dev/null 2>&1 ; then
if test $n -lt $min ; then min=$n; fi;
if test $n -gt $max; then max=$n; fi;
elif test $max -gt 0 ; then
cat gcl.script.def | $AWK '/SIZEOF_HEADERS/ {gsub("0x[[0-9]]*","0x" j,$0);} {print}' j=$j >gcl.script
AC_MSG_RESULT([done])
rm -f gcl.script.def
- LDFLAGS="$LDFLAGS -Wl,-T gcl.script "
+ assert_arg_to_ldflags -Wl,-T,gcl.script
cp gcl.script unixport
else
AC_MSG_RESULT([none found or not needed])
AC_FUNC_ALLOCA
-LDFLAGS="`echo $LDFLAGS | sed 's,gcl.script,../unixport/gcl.script,g'` $TLDFLAGS"
+LDFLAGS="`echo $LDFLAGS | sed 's,gcl.script,../unixport/gcl.script,g'`"
AC_SUBST(LDFLAGS)
LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS $TLIBS"
AC_SUBST(LIBS)
-FINAL_CFLAGS="$CFLAGS $CPPFLAGS $X_CFLAGS $TCFLAGS"
+FINAL_CFLAGS="$CFLAGS $CPPFLAGS $X_CFLAGS"
AC_SUBST(FINAL_CFLAGS)
# Work around bug with gcc on ppc -- CM
-NIFLAGS="$CFLAGS $CPPFLAGS $TCFLAGS $TONIFLAGS -I\$(GCLDIR)/o"
+NIFLAGS="$CFLAGS $CPPFLAGS $TONIFLAGS -I\$(GCLDIR)/o"
AC_SUBST(NIFLAGS)
-CFLAGS="$CFLAGS $CPPFLAGS $TCFLAGS $TO3FLAGS -I\$(GCLDIR)/o"
+CFLAGS="$CFLAGS $CPPFLAGS $TO3FLAGS -I\$(GCLDIR)/o"
AC_SUBST(CFLAGS)
O3FLAGS=$TO3FLAGS
AC_SUBST(O3FLAGS)