| 1 | #!/bin/sh |
|---|
| 2 | #==================================================================== |
|---|
| 3 | # NeXus - Neutron & X-ray Common Data Format |
|---|
| 4 | # |
|---|
| 5 | # $Id$ |
|---|
| 6 | # |
|---|
| 7 | # @configure_input@ |
|---|
| 8 | # |
|---|
| 9 | # Script for building NeXus applications |
|---|
| 10 | # |
|---|
| 11 | # Copyright (C) 2004 Freddie Akeroyd |
|---|
| 12 | # |
|---|
| 13 | # This library is free software; you can redistribute it and/or |
|---|
| 14 | # modify it under the terms of the GNU Lesser General Public |
|---|
| 15 | # License as published by the Free Software Foundation; either |
|---|
| 16 | # version 2 of the License, or (at your option) any later version. |
|---|
| 17 | # |
|---|
| 18 | # This library is distributed in the hope that it will be useful, |
|---|
| 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 21 | # Lesser General Public License for more details. |
|---|
| 22 | # |
|---|
| 23 | # You should have received a copy of the GNU Lesser General Public |
|---|
| 24 | # License along with this library; if not, write to the Free |
|---|
| 25 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|---|
| 26 | # MA 02111-1307 USA |
|---|
| 27 | # |
|---|
| 28 | # For further information, see <http://www.nexusformat.org> |
|---|
| 29 | # |
|---|
| 30 | #==================================================================== |
|---|
| 31 | SHELL="@SHELL@" |
|---|
| 32 | srcdir="@srcdir@" |
|---|
| 33 | top_srcdir="@top_srcdir@" |
|---|
| 34 | VPATH="@srcdir@" |
|---|
| 35 | prefix="@prefix@" |
|---|
| 36 | exec_prefix="@exec_prefix@" |
|---|
| 37 | bindir="@bindir@" |
|---|
| 38 | sbindir="@sbindir@" |
|---|
| 39 | libexecdir="@libexecdir@" |
|---|
| 40 | datadir="@datadir@" |
|---|
| 41 | datarootdir="@datarootdir@" |
|---|
| 42 | libdir="@libdir@" |
|---|
| 43 | infodir="@infodir@" |
|---|
| 44 | mandir="@mandir@" |
|---|
| 45 | includedir="@includedir@" |
|---|
| 46 | #pkgdatadir=$(datadir)/@PACKAGE@ |
|---|
| 47 | #pkglibdir=$(libdir)/@PACKAGE@ |
|---|
| 48 | #pkgincludedir=$(includedir)/@PACKAGE@ |
|---|
| 49 | #top_builddir=.. |
|---|
| 50 | host_alias="@host_alias@" |
|---|
| 51 | host_triplet="@host@" |
|---|
| 52 | CC="@CC@" |
|---|
| 53 | F77="@F77@" |
|---|
| 54 | F90="@F90@" |
|---|
| 55 | F90FLAGS="@F90FLAGS@" |
|---|
| 56 | H4ROOT="@H4ROOT@" |
|---|
| 57 | H5ROOT="@H5ROOT@" |
|---|
| 58 | PACKAGE="@PACKAGE@" |
|---|
| 59 | RANLIB="@RANLIB@" |
|---|
| 60 | STRIP="@STRIP@" |
|---|
| 61 | VERSION="@VERSION@" |
|---|
| 62 | LIBNEXUS="${prefix}/lib/libNeXus.a" |
|---|
| 63 | LIBNEXUS77="${prefix}/lib/libNeXus77.a" |
|---|
| 64 | LIBNEXUS90="${prefix}/lib/libNeXus90.a" |
|---|
| 65 | CFLAGS="@CFLAGS@" |
|---|
| 66 | FFLAGS="@FFLAGS@" |
|---|
| 67 | DEFS="@DEFS@" |
|---|
| 68 | CPPFLAGS="@CPPFLAGS@ -I${prefix}/include" |
|---|
| 69 | LDFLAGS="@LDFLAGS@" |
|---|
| 70 | LIBS="@LIBS@" |
|---|
| 71 | |
|---|
| 72 | OBJS="" |
|---|
| 73 | TARGET="a.out" |
|---|
| 74 | while [ $# -ne 0 ]; do |
|---|
| 75 | case $1 in |
|---|
| 76 | -o) |
|---|
| 77 | shift |
|---|
| 78 | TARGET=$1 |
|---|
| 79 | ;; |
|---|
| 80 | *.f90) |
|---|
| 81 | $F90 $F90FLAGS -c $1 |
|---|
| 82 | OBJS="$OBJS `basename $1 .f90`.o" |
|---|
| 83 | ;; |
|---|
| 84 | *.c) |
|---|
| 85 | $CC $CPPFLAGS $DEFS $CFLAGS -c $1 |
|---|
| 86 | OBJS="$OBJS `basename $1 .c`.o" |
|---|
| 87 | ;; |
|---|
| 88 | *.f) |
|---|
| 89 | $F77 $F77FLAGS -c $1 |
|---|
| 90 | OBJS="$OBJS `basename $1 .f`.o" |
|---|
| 91 | ;; |
|---|
| 92 | --help|-h) |
|---|
| 93 | echo "usage: nxbuild [-o target] file [file...]" |
|---|
| 94 | echo "usage: nxbuild --help" |
|---|
| 95 | echo "usage: nxbuild --version" |
|---|
| 96 | exit |
|---|
| 97 | ;; |
|---|
| 98 | --version|-V) |
|---|
| 99 | echo 'nxbuild $Revision$ for NeXus release' $VERSION |
|---|
| 100 | echo "Type nxbuild --help for usage" |
|---|
| 101 | exit |
|---|
| 102 | ;; |
|---|
| 103 | *) # *.o, *.a etc |
|---|
| 104 | OBJS="$OBJS $1" |
|---|
| 105 | ;; |
|---|
| 106 | esac |
|---|
| 107 | shift |
|---|
| 108 | done |
|---|
| 109 | $CC -o $TARGET $LDFLAGS $OBJS $LIBNEXUS $LIBS |
|---|