Please send any problems or suggested changes to perlbug@perl.com.
-Hint file naming convention: Each hint file name should have only
+=head1 Hint file naming convention.
+
+Each hint file name should have only
one '.'. (This is for portability to non-unix file systems.) Names
should also fit in <= 14 characters, for portability to older SVR3
systems. File names are of the form $osname_$osvers.sh, with all '.'
A glossary of config.sh variables is in the file Porting/Glossary.
+=head1 Setting variables
+
+=head2 Optimizer
+
+If you want to set a variable, try to allow for Configure command-line
+overrides. For example, suppose you think the default optimizer
+setting to be -O2 for a particular platform. You should allow for
+command line overrides with something like
+
+ case "$optimize" in
+ '') optimize='-O2' ;;
+ esac
+
+or, if your system has a decent test(1) command,
+
+ test -z "$optimize" && optimize='-O2'
+
+This allows the user to select a different optimization level, e.g.
+-O6 or -g.
+
+=head2 Compiler and Linker flags
+
+If you want to set $ccflags or $ldflags, you should append to the existing
+value to allow Configure command-line settings, e.g. use
+
+ ccflags="$ccflags -DANOTHER_OPTION_I_NEED"
+
+so that the user can do something like
+
+ sh Configure -Dccflags='FIX_NEGATIVE_ZERO'
+
+and have the FIX_NEGATIVE_ZERO value preserved by the hints file.
+
+=head2 Libraries
+
+Configure will attempt to use the libraries listed in the variable
+$libswanted. If necessary, you should remove broken libraries from
+that list, or add additional libraries to that list. You should
+*not* simply set $libs -- that ignores the possibilities of local
+variations. For example, a setting of libs='-lgdbm -lm -lc' would
+fail if another user were to try to compile Perl on a system without
+GDBM but with Berkeley DB. See hints/dec_osf.sh and hints/solaris_2.sh
+for examples.
+
+=head2 Other
+
+In general, try to avoid hard-wiring something that Configure will
+figure out anyway. Also try to allow for Configure command-line
+overrides.
+
=head1 Hint file tricks
=head2 Printing critical messages
Have the appropriate amount of fun :-)
- Andy Dougherty doughera@lafcol.lafayette.edu
+ Andy Dougherty doughera@lafayette.edu
glibpth="$libpth"
xlibpth="$libpth"
+# This should remove unwanted libraries instead of limiting the set
+# to just these few. E.g. what about Berkeley DB?
libswanted='gdbm m dld'
so=' '
# compiler & linker flags
+# Respect command-line values.
-ccflags='-DAMIGAOS -mstackextend'
-ldflags=''
-optimize='-O2 -fomit-frame-pointer'
+ccflags="$ccflags -DAMIGAOS -mstackextend"
+case "$optimize" in
+'') optimize='-O2 -fomit-frame-pointer';;
+esac
dlext='o'
+# Are these two different from the defaults?
cccdlflags='none'
ccdlflags='none'
lddlflags='-oformat a.out-amiga -r'
#! /bin/sh
# cygwin.sh - hints for building perl using the Cygwin environment for Win32
#
+# Many of these inflexible settings should be changed to allow command-
+# line overrides and allow for variations in local set-ups.
+# I have made first guesses at some of these, but would welcome
+# corrections from someone actually using Cygwin.
+# Andy Dougherty <doughera@lafayette.edu> Tue Sep 28 12:39:38 EDT 1999
_exe='.exe'
exe_ext='.exe'
startsh='#!/bin/sh'
archname='cygwin'
-cc='gcc'
+test -z "$cc" && cc='gcc'
libpth='/usr/i586-cygwin32/lib /usr/lib /usr/local/lib'
so='dll'
libs='-lcygwin -lm -lkernel32'
#optimize='-g'
-ccflags='-DCYGWIN -I/usr/include -I/usr/local/include'
-ldflags='-L/usr/i586-cygwin32/lib -L/usr/lib -L/usr/local/lib'
-usemymalloc='n'
+# Is -I/usr/include *really* needed?
+# Is -I/usr/local/include *really* needed? I thought gcc always looked there.
+ccflags="$ccflags -DCYGWIN -I/usr/include -I/usr/local/include"
+# Is -L/usr/lib *really* needed?
+ldflags="$ldflags -L/usr/i586-cygwin32/lib -L/usr/lib -L/usr/local/lib"
+test -z "$usemymalloc" && usemymalloc='n'
dlsrc='dl_cygwin.xs'
cccdlflags=' '
ld='ld2'
-lddlflags='-L/usr/local/lib'
+# Is -L/usr/local/lib *really* needed?
+lddlflags="$lddlflags -L/usr/local/lib"
useshrplib='true'
libperl='libperl.a'
dlext='dll'
dynamic_ext=' '
-man1dir=/usr/local/man/man1
-man3dir=/usr/local/man/man3
+# What if they aren't using $prefix=/usr/local ??
+# Why is this needed at all? Doesn't Configure suggest this?
+test -z "$man1dir" && man1dir=/usr/local/man/man1
+test -z "$man3dir" && man3dir=/usr/local/man/man3
case "$ldlibpthname" in
'') ldlibpthname=PATH ;;
# for performance, apparently this makes a huge difference (~krader)
d_vfork='define'
-optimize='-Wc,-O3 -W0,-xstring'
+case "$optimize" in
+'') optimize='-Wc,-O3 -W0,-xstring' ;;
+esac
# We override d_socket because it's very hard for Configure to get it right
# in Dynix/Ptx, for several reasons.
d_sockpair='define'
;;
4.2*) # on ptx/TCP 4.2, we can use BSD sockets, but they're not the default.
- cppflags='-Wc,+bsd-socket'
- ccflags='-Wc,+bsd-socket'
- ldflags='-Wc,+bsd-socket'
+ cppflags="$cppflags -Wc,+bsd-socket"
+ ccflags="$ccflags -Wc,+bsd-socket"
+ ldflags="$ldflags -Wc,+bsd-socket"
d_socket='define'
d_oldsock='undef'
d_sockpair='define'
# of libswanted excludes some libraries found there. You may want to
# prevent "ucb" from being removed from libswanted and see if perl will
# build on your system.
-ldflags='-non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib'
-ccflags='-systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
-cppflags='-D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude'
+ldflags="$ldflags -non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib"
+ccflags="$ccflags -systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude"
+cppflags="$ccflags -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude"
# Don't use problematic libraries:
# Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
#
# Use Configure -Dcc=gcc to use gcc.
+
+# Why can't we just use PATH? It contains /usr/ccs/bin.
case "$cc" in
'') cc='/bin/cc'
test -f $cc || cc='/usr/ccs/bin/cc'
;;
esac
-ldflags='-L/usr/ccs/lib -L/usr/ucblib'
+
+ldflags="$ldflags -L/usr/ccs/lib -L/usr/ucblib"
test -d /usr/local/man || mansrc='none'
-ccflags='-I/usr/include -I/usr/ucbinclude'
+# Do we really need to tell cc to look in /usr/include?
+ccflags="$ccflags -I/usr/include -I/usr/ucbinclude"
libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' `
d_index='undef'
d_suidsafe=define
# The weird include path is really to work around some bugs in
# broken system header files.
-ccflags="-D__MINT__ -Uatarist -DDEBUGGING -I$here/../mint"
+ccflags="$ccflags -D__MINT__ -Uatarist -DDEBUGGING -I$here/../mint"
# libs
#
# Some good answers to the questions in Configure:
+# Does Configure really get all these wrong?
usenm='true'
d_suidsafe='true'
clocktype='long'
# Revised again for 5.004_69 by Mark Bixby, markb@cccd.edu.
#
osname='mpeix'
-osvers='5.5'
+osvers='5.5' # Isn't there a way to determine this dynamically?
#
# Force Configure to use our wrapper mpeix/nm script
#
#
# Various directory locations.
#
-prefix='/PERL/PUB'
+# Which ones of these does Configure get wrong?
+test -z "$prefix" && prefix='/PERL/PUB'
archname='PA-RISC1.1'
bin="$prefix"
installman1dir="$prefix/man/man1"
#
# Compiling.
#
-cc='gcc'
+test -z "$cc" && cc='gcc'
cccdlflags='none'
-ccflags='-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_POSIX_JOB_CONTROL -DIS_SOCKET_CLIB_ITSELF'
-locincpth='/usr/local/include /usr/contrib/include /BIND/PUB/include'
-optimize='-O2'
+ccflags="$ccflags -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_POSIX_JOB_CONTROL -DIS_SOCKET_CLIB_ITSELF"
+locincpth="$locincpth /usr/local/include /usr/contrib/include /BIND/PUB/include"
+test -z "$optimize" && optimize="-O2"
ranlib='/bin/true'
# Special compiling options for certain source files.
+# But what if you want -g?
regcomp_cflags='optimize=-O'
toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
#
# Linking.
#
lddlflags='-b'
-libs='-lbind -lsyslog -lcurses -lsvipc -lsocket -lm -lc'
-loclibpth='/usr/local/lib /usr/contrib/lib /BIND/PUB/lib /SYSLOG/PUB'
+# What if you want additional libs (e.g. gdbm)?
+# This should remove the unwanted libraries from $libswanted and
+# add on whatever ones are needed instead.
+libs="$libs -lbind -lsyslog -lcurses -lsvipc -lsocket -lm -lc"
+loclibpth="$loclibpth /usr/local/lib /usr/contrib/lib /BIND/PUB/lib /SYSLOG/PUB"
#
# External functions and data items.
#
+# Does Configure *really* get *all* of these wrong?
+#
d_crypt='define'
d_difftime='define'
d_dlerror='undef'
# use the following two lines if you have perl5.003_22 or better and
# do not encounter intermittent core dumps.
-ccflags='-DUSE_NEXT_CTYPE'
+ccflags="$ccflags -DUSE_NEXT_CTYPE"
usemymalloc='n'
######################################################################
echo It will not be found there. Try moving it to >&4
echo /NextDeveloper/Headers/bsd/gdbm.h. >&4
-ccflags='-DUSE_NEXT_CTYPE -DNEXT30_NO_ATTRIBUTE'
+ccflags="$ccflags -DUSE_NEXT_CTYPE -DNEXT30_NO_ATTRIBUTE"
POSIX_cflags='ccflags="-posix $ccflags"'
useposix='undef'
-ldflags='-u libsys_s'
-libswanted='dbm gdbm db'
+ldflags="$ldflags -u libsys_s"
+libswanted="$libswanted dbm gdbm db"
#
lddlflags='-r'
# Give cccdlflags an empty value since Configure will detect we are
libswanted=' '
libc='/NextLibrary/Frameworks/System.framework/System'
-ldflags='-dynamic -prebind'
-lddlflags='-dynamic -bundle -undefined suppress'
-ccflags='-dynamic -fno-common -DUSE_NEXT_CTYPE -DUSE_PERL_SBRK'
+ldflags="$ldflags -dynamic -prebind"
+lddlflags="$lddlflags -dynamic -bundle -undefined suppress"
+ccflags="$ccflags -dynamic -fno-common -DUSE_NEXT_CTYPE -DUSE_PERL_SBRK"
cccdlflags='none'
ld='cc'
#optimize='-g -O'