: coherency check
echo " "
echo "Checking your choice of C compiler and flags for coherency..." >&4
-set X $cc $optimize $ccflags $ldflags -o try try.c $libs
+set X $cc $optimize $ccflags -o try $ldflags try.c $libs
shift
$cat >try.msg <<EOM
I've tried to compile and run a simple program with:
ccflags="$ccflags -DEBCDIC"
val="$define"
else
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin. Or UTF-8." >&4
val="$undef"
fi
rm -f tebcdic.c tebcdic
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
$ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
- $cc $ccflags $ldflags $cccdlflags $ccdlflags -o fred fred.c $libs > /dev/null 2>&1; then
+ $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
1) echo "Test program failed using dlopen." >&4
#include <sys/types.h>
#$i_niin I_NETINET_IN
#$i_sysin I_SYS_IN
-#$i_arpainet I_ARPA_INET
+#$i_arpa_inet I_ARPA_INET
#ifdef I_NETINET_IN
#include <netinet/in.h>
#endif
case "$ebcdic" in
$define)
- if test -d ebcdic; then
- echo "This is an EBCDIC system, moving the right parser files in place." >&4
- # Try to save the ASCII versions, just in case.
- test -f perly.c.ascii || mv perly.c perly.c.ascii
- test -f perly.h.ascii || mv perly.h perly.h.ascii
-
- cp -pf ebcdic/perly.c perly.c
- cp -pf ebcdic/perly.h perly.h
-
- test -f x2p/a2p.c.ascii || mv x2p/a2p.c x2p/a2p.c.ascii
-
- cp -pf ebcdic/a2p.c x2p/a2p.c
+ xxx=''
+ echo "This is an EBCDIC system, checking if any parser files may need regenerating." >&4
+ rm -f y.tab.c y.tab.h
+ yacc -d perly.y >/dev/null 2>&1
+ if cmp -s y.tab.c perly.c; then
+ rm -f y.tab.c
+ else
+ echo "perly.y -> perly.c" >&4
+ mv -f y.tab.c perly.c
+ chmod u+w perly.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
+ xxx="$xxx perly.c"
+ fi
+ if cmp -s y.tab.h perly.h; then
+ rm -f y.tab.h
else
- echo "This is an EBCDIC system but there's no ebcdic directory." >&4
- echo "This will not do." >&4
- exit 1
+ echo "perly.y -> perly.h" >&4
+ mv -f y.tab.h perly.h
+ xxx="$xxx perly.h"
fi
+ echo "x2p/a2p.y" >&4
+ cd x2p
+ rm -f y.tab.c y.tab.h
+ yacc -d a2p.y >/dev/null 2>&1
+ if cmp -s y.tab.c a2p.c
+ then
+ rm -f y.tab.c
+ else
+ echo "a2p.y -> a2p.c" >&4
+ mv -f y.tab.c a2p.c
+ chmod u+w a2p.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
+ xxx="$xxx a2p.c"
+ fi
+ if cmp -s y.tab.h a2p.h
+ then
+ rm -f y.tab.h
+ else
+ echo "a2p.h -> a2p.h" >&4
+ mv -f y.tab.h a2p.h
+ xxx="$xxx a2p.h"
+ fi
+ cd ..
+ case "$xxx" in
+ '') echo "No parser files were regenerated. That's okay." >&4 ;;
+ esac
;;
esac