# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Sat Feb 20 15:44:46 EET 1999 [metaconfig 3.0 PL70]
+# Generated on Mon Feb 22 10:45:25 EET 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
cppminus=''
cpprun=''
cppstdin=''
+crosscompile=''
d_access=''
d_accessx=''
d_alarm=''
small=''
split=''
modetype=''
+multiarch=''
mydomain=''
myhostname=''
phostname=''
. ./usethreads.cbu
fi
case "$osname" in
- aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|openbsd|os2|solaris|vmesa)
+ aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
# Known thread-capable platforms.
;;
*)
The installation process will also create a directory for
site-specific extensions and modules. Some users find it convenient
-to place all local files in this directory rather than in the main
-distribution directory.
+to place all site-specific files in this directory rather than in the
+main distribution directory.
EOM
fn=d~+
RCSfile='$RCSfile'
Revision='$Revision'
+case "$crosscompile" in
+''|[nN]*) crosscompile="$undef" ;;
+esac
+
+case "$multiarch" in
+''|[nN]*) multiarch="$undef" ;;
+esac
+
: check for alignment requirements
echo " "
-case "$alignbytes" in
-'') echo "Checking alignment constraints..." >&4
- $cat >try.c <<'EOCP'
+case "$crosscompile$multiarch" in
+*$define*)
+You seem to be cross-compiling, skipping the memory alignment check.
+
+EOM
+ case "$alignbytes" in
+ '') alignbytes=8 ;;
+ esac
+ ;;
+*)
+ case "$alignbytes" in
+ '') echo "Checking alignment constraints..." >&4
+ $cat >try.c <<'EOCP'
struct foobar {
char foo;
double bar;
printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
}
EOCP
- set try
- if eval $compile_ok; then
- dflt=`./try`
- else
- dflt='8'
- echo "(I can't seem to compile the test program...)"
- fi
- ;;
-*) dflt="$alignbytes"
+ set try
+ if eval $compile_ok; then
+ dflt=`./try`
+ else
+ dflt='8'
+ echo "(I can't seem to compile the test program...)"
+ fi
+ ;;
+ *) dflt="$alignbytes"
+ ;;
+ esac
+ rp="Doubles must be aligned on a how-many-byte boundary?"
+ . ./myread
+ alignbytes="$ans"
+ $rm -f try.c try
;;
esac
-rp="Doubles must be aligned on a how-many-byte boundary?"
-. ./myread
-alignbytes="$ans"
-$rm -f try.c try
+
: check for ordering of bytes in a long
-case "$byteorder" in
-'')
- $cat <<'EOM'
-
+echo " "
+case "$crosscompile$multiarch" in
+*$define*)
+ $cat <<EOM
+You seem to be cross-compiling, I'm skipping the byteorder check.
+
+EOM
+ ;;
+*)
+ case "$byteorder" in
+ '')
+ $cat <<'EOM'
In the following, larger digits indicate more significance. A big-endian
machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
the test program works the default is probably right.
I'm now running the test program...
EOM
- $cat >try.c <<'EOCP'
+ $cat >try.c <<'EOCP'
#include <stdio.h>
int main()
{
exit(0);
}
EOCP
- xxx_prompt=y
- set try
- if eval $compile && ./try > /dev/null; then
- dflt=`./try`
- case "$dflt" in
- [1-4][1-4][1-4][1-4]|12345678|87654321)
- echo "(The test program ran ok.)"
- echo "byteorder=$dflt"
- xxx_prompt=n
+ xxx_prompt=y
+ set try
+ if eval $compile && ./try > /dev/null; then
+ dflt=`./try`
+ case "$dflt" in
+ [1-4][1-4][1-4][1-4]|12345678|87654321)
+ echo "(The test program ran ok.)"
+ echo "byteorder=$dflt"
+ xxx_prompt=n
;;
- ????|????????) echo "(The test program ran ok.)" ;;
- *) echo "(The test program didn't run right for some reason.)" ;;
- esac
- else
- dflt='4321'
- cat <<'EOM'
+ ????|????????) echo "(The test program ran ok.)" ;;
+ *) echo "(The test program didn't run right for some reason.)" ;;
+ esac
+ else
+ dflt='4321'
+ cat <<'EOM'
(I can't seem to compile the test program. Guessing big-endian...)
EOM
- fi
- case "$xxx_prompt" in
- y)
- rp="What is the order of bytes in a long?"
- . ./myread
- byteorder="$ans"
- ;;
- *) byteorder=$dflt
+ fi
+ case "$xxx_prompt" in
+ y)
+ rp="What is the order of bytes in a long?"
+ . ./myread
+ byteorder="$ans"
+ ;;
+ *) byteorder=$dflt
+ ;;
+ esac
;;
esac
+ $rm -f try.c try
;;
esac
-$rm -f try.c try
+
: how do we catenate cpp tokens here?
echo " "
cpprun='$cpprun'
cppstdin='$cppstdin'
cppsymbols='$cppsymbols'
+crosscompile='$crosscompile'
cryptlib='$cryptlib'
csh='$csh'
d_Gconvert='$d_Gconvert'
models='$models'
modetype='$modetype'
more='$more'
+multiarch='$multiarch'
mv='$mv'
myarchname='$myarchname'
mydomain='$mydomain'
#$i_syssecrt I_SYS_SECURITY /**/
/* MEM_ALIGNBYTES:
- * This symbol contains the number of bytes required to align a
- * double. Usual values are 2, 4 and 8.
- * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture
- * Binaries (MAB) for targets with varying alignment. This only matters
- * for perl, where the config.h can be generated and installed on one
- * system, and used by a different architecture to build an extension.
- * The default is eight, for safety.
+ * This symbol contains the number of bytes required to align a
+ * double. Usual values are 2, 4 and 8. The default is eight,
+ * for safety.
*/
-#define MEM_ALIGNBYTES $alignbytes /**/
+#if defined(CROSSCOMPILE) || defined(MULTIARCH)
+# define MEM_ALIGNBYTES 8
+#else
+#define MEM_ALIGNBYTES $alignbytes
+#endif
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
* i.e. 0x1234 or 0x4321, etc...
+ * If the compiler supports cross-compiling or multiple-architecture
+ * binaries (eg. on NeXT systems), use compiler-defined macros to
+ * determine the byte order.
* On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture
* Binaries (MAB) on either big endian or little endian machines.
* The endian-ness is available at compile-time. This only matters
* so the default case (for NeXT) is big endian to catch them.
* This might matter for NeXT 3.0.
*/
-#ifndef NeXT
+#if defined(CROSSCOMPILE) || defined(MULTIARCH)
+# ifdef __LITTLE_ENDIAN__
+# if LONGSIZE == 4
+# define BYTEORDER 0x1234
+# else
+# if LONGSIZE == 8
+# define BYTEORDER 0x12345678
+# endif
+# endif
+# else
+# ifdef __BIG_ENDIAN__
+# if LONGSIZE == 4
+# define BYTEORDER 0x4321
+# else
+# if LONGSIZE == 8
+# define BYTEORDER 0x87654321
+# endif
+# endif
+# endif
+# endif
+# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__))
+# define BYTEORDER 0x4321
+# endif
+#else
#define BYTEORDER 0x$byteorder /* large digits for MSB */
-#else /* NeXT */
-#ifdef __LITTLE_ENDIAN__
-#define BYTEORDER 0x1234
-#else /* __BIG_ENDIAN__ */
-#define BYTEORDER 0x4321
-#endif /* ENDIAN CHECK */
#endif /* NeXT */
/* CASTI32:
* The standard distribution will put nothing in this directory.
* Individual sites may place their own extensions and modules in
* this directory.
+ * This differs from LOCALARCH in that SITEARCH is often
+ * a shared network directory while LOCALARCH is
+ * at a local disk, because of policy/administrative issues
+ * like for example caching (performance), licensing, or security.
*/
/* SITEARCH_EXP:
* This symbol contains the ~name expanded version of SITEARCH, to be used
* The standard distribution will put nothing in this directory.
* Individual sites may place their own extensions and modules in
* this directory.
+ * This differs from LOCALLIB in that SITELIB is often
+ * a shared network directory while LOCALLIB is
+ * at a local disk, because of policy/administrative issues
+ * like for example caching (performance), licensing, or security.
*/
/* SITELIB_EXP:
* This symbol contains the ~name expanded version of SITELIB, to be used