source: XMLF90/configure @ 1807

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

XMLF90 : correction pour brodie

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