source: XMLIO_SERVER/trunk/configure @ 16

Last change on this file since 16 was 16, checked in by ymipsl, 13 years ago

correction pour portage sur Mercure

File size: 3.2 KB
Line 
1#!/bin/csh
2set verbose echo
3set has_arch_opt           = FALSE
4set has_compile_opt        = FALSE
5set default_compile_flags  = "%PROD_FFLAGS"
6set has_use_vt             = FALSE
7
8top:
9if ($#argv > 0) then
10    switch ($1)
11
12    case -h
13
14########################################################################
15# Manuel en ligne
16########################################################################
17more <<eod
18
19
20configure_ioserver [Options]
21
22bla, bla, bla
23eod
24exit
25
26########################################################################
27# Lecture des differentes options
28########################################################################
29                   
30    case -a
31    case -arch
32        set has_arch_opt = TRUE
33        set arch="$2" ; shift ; shift ; goto top
34
35    case -prod
36        set has_compile_opt = TRUE
37        set compile_flags="%PROD_FFLAGS"
38        shift ; goto top
39
40    case -dev
41        set has_compile_opt = TRUE
42        set compile_flags="%DEV_FFLAGS"
43        shift ; goto top
44
45    case -debug
46        set has_compile_opt = TRUE
47        set compile_flags="%DEBUG_FFLAGS"
48        shift ; goto top
49    case -use_vt
50        set has_use_vt = TRUE
51        shift ; goto top
52       
53   default
54        echo "unknown option "$1" , exiting..."
55        exit
56   endsw
57endif
58
59
60#define architecture files
61if ( $has_arch_opt == TRUE) then
62  if ( -e arch/arch-${arch}.fcm ) then
63    rm -f arch.fcm
64    ln -s arch/arch-${arch}.fcm arch.fcm
65  else
66    echo "architecture file : << arch/arch-${arch}.fcm >> is missing, exiting...."
67    exit
68  endif
69 
70  if ( -e arch/arch-${arch}.path ) then
71    rm -f arch.path
72    ln -s arch/arch-${arch}.path arch.path
73  else
74    echo "architecture file : << arch/arch-${arch}.path >> is missing, exiting...."
75    exit
76  endif
77else
78  echo "Warning : architecture not specified, taking default file <<arch.fcm>> and <<arch.path>>" 
79  if ( ! -e arch.fcm ) then
80    echo "architecture file : << arch.fcm >> is missing, exiting...."
81    exit
82  endif
83
84  if ( ! -e arch.fcm ) then
85    echo "architecture file : << arch.path >> is missing, exiting...."
86    exit
87  endif
88endif
89 
90# set compiler flags
91set FFLAGS="%BASE_FFLAGS"
92set LD_FFLAGS="%BASE_LD"
93set CPP_KEY="%FPP_DEF"
94set INCDIR=""
95set LIB=""
96
97source ./arch.path
98
99# set compiler flags for optimisation
100if ( $has_compile_opt == FALSE ) then
101  set compile_flags=$default_compile_flags
102endif
103set FFLAGS=${FFLAGS}" "$compile_flags
104
105
106# add path for xmlf90 library
107
108set INCDIR="$INCDIR $XMLF90_INCDIR"
109set LIB="$LIB $XMLF90_LIBDIR $XMLF90_LIB"
110
111# add path for ioipsl library
112set INCDIR="$INCDIR $IOIPSL_INCDIR"
113set LIB="$LIB $IOIPSL_LIBDIR $IOIPSL_LIB"
114
115# add path for netcdf library
116set INCDIR="$INCDIR $NETCDF_INCDIR"
117set LIB="$LIB $NETCDF_LIBDIR $NETCDF_LIB"
118
119if ( $has_use_vt == TRUE ) then
120set INCDIR="$INCDIR $VAMPIR_INCDIR"
121set LIB="$LIB $VAMPIR_LIBDIR $VAMPIR_LIB"
122set CPP_KEY="$CPP_KEY USE_VT"
123endif
124
125
126# build config file
127set config_fcm="config.fcm"
128rm -f $config_fcm
129
130echo "%FFLAGS        $FFLAGS"                           >  $config_fcm 
131echo "%CPP_KEY       $CPP_KEY"                          >> $config_fcm
132echo "%LD_FFLAGS     $LD_FFLAGS"                        >> $config_fcm
133echo "%INCDIR        $INCDIR"                           >> $config_fcm
134echo "%LIB           $LIB"                              >> $config_fcm
Note: See TracBrowser for help on using the repository browser.