-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·86 lines (71 loc) · 2.28 KB
/
configure
File metadata and controls
executable file
·86 lines (71 loc) · 2.28 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/csh -f
#***************************************************************************
#*
#* Copyright Dstl (C) 2012
#*
#* Module: Configure
#*
#* Original Author: Darren Muff
#*
#* Description: Configuration script for MVector Library
#*
#***************************************************************************
# The file asks for specific variables and then
# inserts them into the code using sed.
set CURR_DIR = $PWD
# First need to check that required binaries are in the users path
# Required binaries are :
# g++
echo "Searching for files required for this installation..."
foreach req (g++)
which $req
if ($status) then
echo "Error: required binary $req not found"
exit 1
endif
end
# Inputs required are :
# INSTALL_DIR: The directory in which the application is going to be installed
set def_INSTALL_DIR = /usr/local/dstl
# Determine which version this library is
set VERSION = `grep "define MVECTOR_RELEASE_NAME" MVector_version.h | awk -F\" '{print $2}'`
#
# Ask for parameters for installation directory
#
echo " "
echo "Please enter the full path name of the directory"
echo "that MVector is to be installed into. Executable files"
echo "will be placed in a bin subdirectory, libraries will"
echo "be put in a lib subdirectory and includes into "
echo "include. [$def_INSTALL_DIR]"
echo " "
set INSTALL_DIR = $<
if ($INSTALL_DIR == "") then
set INSTALL_DIR = $def_INSTALL_DIR
endif
echo "Setting install_dir to be $INSTALL_DIR"
if ( ! (-d $INSTALL_DIR/bin && -d $INSTALL_DIR/include && -d $INSTALL_DIR && -d $INSTALL_DIR/lib) ) then
echo " "
echo "$INSTALL_DIR, $INSTALL_DIR/bin or $INSTALL_DIR/include or $INSTALL_DIR/lib does not exist. Shall I create it? [y/n]"
set yesno = $<
if ( $yesno == "y" || $yesno == "Y" || $yesno == "yes" || $yesno == "Yes" || $yesno == "YES") then
mkdir -p $INSTALL_DIR
mkdir -p $INSTALL_DIR/bin
mkdir -p $INSTALL_DIR/include
mkdir -p $INSTALL_DIR/lib
if ( ! -d $INSTALL_DIR ) then
echo "Error : Failed to create install directory $INSTALL_DIR"
exit 1
endif
else
echo "Exiting ... "
exit 1
endif
endif
sed s@INSTALL_DIR@${INSTALL_DIR}@g Makefile.in > Makefile.tmp
sed s@CONFIGVERSION@${VERSION}@g Makefile.tmp > Makefile
rm -fr Makefile.tmp
echo "Configuration is complete."
echo " Now type 'make; make install' "
echo " "
echo " "