File: build_function_libtool

package info (click to toggle)
gerris 20131206%2Bdfsg-17
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,720 kB
  • ctags: 6,768
  • sloc: ansic: 66,593; sh: 15,922; f90: 1,513; makefile: 1,149; fortran: 696; python: 484; awk: 104; lisp: 89; xml: 27
file content (38 lines) | stat: -rw-r--r-- 1,047 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# file generated automatically by configure from 'build_function_libtool'

DIMENSION=$1  # gerris2D or gerris3D
WDIR=$2       # simulation directory

CC="PREFIX/share/gerris/libtool --tag=CC --silent --mode=compile COMPILER"
LD="PREFIX/share/gerris/libtool --tag=CC --silent --mode=link COMPILER"
CFLAGS="-O"
LDFLAGS="-O -rpath PREFIX/lib/gerris"

touch links
if sed 's/@/#/g' < function.c | awk '{
      if ($1 == "#" && $2 == "link") {
        for (i = 3; i <= NF; i++)
          printf ("%s ", $i) >> "links";
        print "";
      } else if ($1 == "#link") {
        for (i = 2; i <= NF; i++)
          printf ("%s ", $i) >> "links";
        print "";
      } else print $0;
    }' > module.c; then :
else
    exit 1
fi

if $CC `pkg-config $DIMENSION --cflags` $CFLAGS -I"$WDIR" \
    -c module.c; then :
    if $LD `pkg-config $DIMENSION --libs` $LDFLAGS -o libmodule.la `cat links` module.lo; then :
    else
	exit 1
    fi
else
    exit 1
fi

ln -s .libs/`grep dlname= libmodule.la | sed -e 's/dlname=//' -e "s/'//g"` module.so