#!/bin/sh #----------------------------------------------------------------------- # Configure site-specific make files. # # This script may be run any number of times. #----------------------------------------------------------------------- # Usage: # # ./configure system_name # # Where system_name must be one of the following: # sun4-gcc - Sun sparc running SUNOS4.* using gcc. # NB. If your gcc runtime library is not installed # in a directory below /usr/local/lib/gcc-lib/ you should # change CCLIB in the sun4-gcc case below. # sol2-gcc - Sun sparc running Solaris 2.* using gcc. # NB. If your gcc runtime library is not installed # in a directory below /usr/local/lib/gcc-lib/ you should # change CCLIB in the sol2-gcc case below. # sol2-cc - Sun Sparc running Solaris 2.* using the SUN ANSI cc # compiler. # hppa-c89 - HP9000 700 or 800 series workstations using c89. # IBM-c89 - IBM 6xxx series workstations using c89. # alpha-osf1-gcc - Alpha AXP running OSF1, using the Gnu C compiler, gcc. # alpha-osf1-cc - Alpha AXP running OSF1, using the native DEC C compiler. # linux-i486-gcc - I486 PC running Linux, using the Gnu C compiler, gcc. #----------------------------------------------------------------------- # The following shell-variable assignments probably require modification. # To do this, read the information preceding each assignment and modify # the text on the right-hand-side of assignments that need to be changed. # # NOTE that the Bourne-shell will not tolerate any space around the '=' # character in shell-variable assignments. # The directory that difmap looks in for HELP files is set at compile time. # This means that if you change the location of the help files at any time, # then you will also have to re-compile difmap. So it is important to # decide now where you are going to put the help files, and to then # write the name of the directory below. The chosen directory should # be visible to all users wanting to use difmap. You must copy the # help files there yourself, as demonstrated in the README file. The # default location given below is the directory in which the help # files reside in in the distribution. If this is OK, then you need # take no further action, but remember not to delete the distribution # in this case. HELPDIR="`pwd`/help" # If you don't want the difmap executable to initially be placed in the # current directory, specify the required directory below. Given that # the executable can be moved at any time, this is not a critical # choice. My recommendation is that you leave the following assignment # unchanged for now and simply copy the executable from the current # directory to its final installation directory later. BINDIR="`pwd`" # Specify the PGPLOT and X11 libraries in a form suitable for the # linker. If the libraries are in a location that is normally searched # by the linker then all that you will need to write is: # # PGPLOT_LIB="-lpgplot -lX11" # # Otherwise you must precede each library with a -L argument to # specify the directory in which each library resides. For example # under SunOS this might be: # PGPLOT_LIB="-L/scisoft/pgplot -lpgplot -L/usr/X11R6/lib -lX11" # # Under Solaris 2.x there is a complication in that when programs are # linked with shared libraries, as they are by default, the path used # to locate the libraries at compile time is not remembered at run # time. To cater for shared libraries you either have to specify the # run-time library path with the -R flag, or you have to require your # users to specify the directories in their LD_LIBRARY_PATH environment # variables. The former is obviously friendlier. An example of using # the -R flag is: # # PGPLOT_LIB="-L/usr/local/pgplot -L/usr/openwin/lib \ # -R/usr/local/pgplot:/usr/openwin/lib:/opt/SUNWspro/lib -lpgplot -lX11" # # Where /usr/local/pgplot and /opt/SUNWspro/lib are the directories that # contain the PGPLOT and FORTRAN libraries at our site. #### PGPLOT_LIB="-lpgplot -lX11" #----------------------------------------------------------------------- # I recommend that you don't change anything below this point. #----------------------------------------------------------------------- INCDIR="`pwd`/include" LIBDIR="`pwd`/lib" #----------------------------------------------------------------------- # THE FOLLOWING ARE DEFAULTS WHICH ARE OVERRIDEN LATER FOR YOUR OS. # DO NOT CHANGE THESE. #----------------------------------------------------------------------- # The following is the default set of options. After this list are # instructions on how to override the default for a specific system. # The default ANSI-C compiler and the flags that should be presented to it. CC="cc" CFLAGS="-O" # The default FORTRAN compiler (the same one that PGPLOT was compiled with). # Also the flags that should be presented to it. FC="f77" FFLAGS="-O" # If the C run-time library is not automatically linked in when using # the FORTRAN compiler to link, cite the name of the library(ies) here. # The default shown here names the latest version of the gcc run-time # library. CCLIB="" # Flags to be sent to the loader (linker). LDFLAGS="" # The way to create a symbolic or (if symbolic links are not supported) # a hard link to a file. LN="ln -s" # How to run ranlib. RANLIB="ranlib" # The default pager. PAGER="more" # Flags for the cpg_src/pgbind command that tell it how to construct # C wrappers for FORTRAN PGPLOT routines. PGBIND_FLAGS="bsd" #----------------------------------------------------------------------- # OVERRIDE SELECTED OPTIONS FOR THE GIVEN OS. # When compiling for a new OS-compiler combination, add a new # OS-compiler) # case in the switch below and redefine any variables for which the default # is inappropriate. #----------------------------------------------------------------------- # Get the operating system name from the command line. if test $# -lt 1;then echo "Usage: configure OS_name-compiler_name" exit 1 else OS=$1 fi # Override selected options for the given operating system-compiler # pair. case $OS in sun4-gcc) # SUN-Sparc running SUNOS4.*, using the gcc compiler. CC=gcc # # Attempt to find libgcc.a. # CCLIB="`gcc -print-libgcc-file-name`" if test ! -f "$CCLIB"; then echo ' Error: libgcc.a is not in the default location. Please edit' echo ' ./configure to assign the path of libgcc.a to CCLIB under' echo ' sun4-gcc), Eg. if libgcc.a is in /usr/local/lib. write:' echo ' ';echo ' CCLIB="/usr/local/lib/libgcc.a"';echo ' ' exit 1 fi ;; sol2-gcc) # SUN running Solaris2.* using gcc. CC="gcc" FC="f77" # # Attempt to find libgcc.a. # CCLIB="`gcc -print-libgcc-file-name`" if test ! -f "$CCLIB"; then echo ' Error: libgcc.a is not in the default location, please edit' echo ' ./configure to assign the path of libgcc.a to CCLIB under' echo ' sol2-gcc), Eg. if libgcc.a is in /usr/local/lib. write:' echo ' ';echo ' CCLIB="/usr/local/lib/libgcc.a"';echo ' ' exit 1 fi RANLIB="echo ranlib" PGPLOT_LIB="${PGPLOT_LIB} -lsocket -lnsl" ;; sol2-cc) # SUN running Solaris 2.* using the new SUN ANSI C compiler, cc. CC="cc" FC="f77" RANLIB="echo ranlib" PGPLOT_LIB="${PGPLOT_LIB} -lsocket -lnsl" ;; hppa-c89) # HP9000-series 700-800, using the vendor's c89 compiler. CC="c89" FC="fort77" CFLAGS="$CFLAGS -D_HPUX_SOURCE -Dhpux -z" RANLIB="echo ranlib" PGBIND_FLAGS="bsd -suffix ''" ;; IBM-c89) # IBM 6xxx using the vendor's c89 compiler. CC="c89" FC="xlf" CFLAGS="$CFLAGS -Dibm_aix" RANLIB="echo ranlib" PGBIND_FLAGS="bsd -suffix ''" ;; alpha-osf1-gcc) # Alpha AXP running OSF1, using the gcc compiler. CC=gcc # # Attempt to find libgcc.a. # CCLIB="`gcc -print-libgcc-file-name`" if test ! -f "$CCLIB"; then echo ' Error: libgcc.a is not in the default location, please edit' echo ' ./configure to assign the path of libgcc.a to CCLIB under' echo ' alpha-osf1-gcc), Eg. if libgcc.a is in /usr/local/lib.' echo ' write:' echo ' ';echo ' CCLIB="/usr/local/lib/libgcc.a"';echo ' ' exit 1 fi ;; alpha-osf1-cc) # Alpha AXP running OSF1, using the native DEC cc compiler. CC=cc CFLAGS="$CFLAGS -std1 -D__alpha__" ;; linux-i486-gcc) # I486 PC running Linux, using the Gnu C compiler, gcc. CC=gcc CFLAGS="$CFLAGS -Dlinux_i486_gcc" # # Attempt to find libgcc.a in its default location. # CCLIB="`gcc -print-libgcc-file-name`" if test ! -f "$CCLIB"; then echo ' Error: libgcc.a is not in the default location, please edit' echo ' ./configure to assign the path of libgcc.a to CCLIB under' echo ' linux-i486-gcc), Eg. if libgcc.a is in /usr/local/lib.' echo ' write:' echo ' ';echo ' CCLIB="/usr/local/lib/libgcc.a"';echo ' ' exit 1 fi ;; *) echo "Unknown OS-compiler combination: $OS" exit 1 ;; esac #----------------------------------------------------------------------- # You should not have to change anything below this line. #----------------------------------------------------------------------- # Keep the user informed. echo 'Configuration follows:' echo ' BINDIR =' $BINDIR echo ' INCDIR =' $INCDIR echo ' LIBDIR =' $LIBDIR echo ' HELPDIR =' $HELPDIR echo ' PGPLOT_LIB =' $PGPLOT_LIB echo ' CC =' $CC echo ' CCLIB =' $CCLIB echo ' FC =' $FC echo ' CFLAGS =' $CFLAGS echo ' FFLAGS =' $FFLAGS echo ' LDFLAGS =' $LDFLAGS echo ' LN =' $LN echo ' RANLIB =' $RANLIB echo ' PAGER =' $PAGER echo ' PGBIND_FLAGS =' $PGBIND_FLAGS echo ' ' # Create the makefile header. cat > make.configure << EOF # Copyright (c) 1993 by the California Institute of Technology. # ANSI-C compiler. CC = $CC # ANSI-C run-time library CCLIB = $CCLIB # FORTRAN compiler. FC = $FC # C and FORTRAN compilation flags. CFLAGS = $CFLAGS FFLAGS = $FFLAGS # Directory for executables. BINDIR = $BINDIR # Directory for includes. INCDIR = $INCDIR # Directory for libraries. LIBDIR = $LIBDIR # Directory of help files. HELPDIR = $HELPDIR # Directory in which the PGPLOT library can be found. PGPLOT_LIB = $PGPLOT_LIB # Loader flags. LDFLAGS = $LDFLAGS # Symbolic link creation. LN = $LN # The way to invoke ranlib. RANLIB = $RANLIB # The default pager. PAGER = $PAGER # The flags used by cpg_src/pgbind. PGBIND_FLAGS = $PGBIND_FLAGS EOF # Create include and library directories if not already there. if test ! -d include; then mkdir include fi if test ! -d lib; then mkdir lib fi # Create site-specific make files in each of the source directories. echo 'Configuring make files.' echo ' ' cat make.configure cpg_src/makefile.lis cpg_src/makefile.distrib > cpg_src/makefile cat make.configure sphere_src/makefile.distrib > sphere_src/makefile cat make.configure difmap_src/makefile.distrib > difmap_src/makefile cat make.configure logio_src/makefile.distrib > logio_src/makefile cat make.configure pager_src/makefile.distrib > pager_src/makefile cat make.configure recio_src/makefile.distrib > recio_src/makefile cat make.configure scrfil_src/makefile.distrib > scrfil_src/makefile cat make.configure fits_src/makefile.distrib > fits_src/makefile cat make.configure slalib_src/makefile.distrib > slalib_src/makefile \rm make.configure