File: configure

package info (click to toggle)
searchandrescue 1.5.0-2.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 6,768 kB
  • sloc: ansic: 89,609; cpp: 7,699; makefile: 194; sh: 123
file content (118 lines) | stat: -rwxr-xr-x 2,597 bytes parent folder | download | duplicates (7)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
#
# Platform Configurator (pconf) calling script
#
# Edit only if you are the vendor, end users should not modify this file!
#

# ##############################################################################
#
# Vendor Editable Section
#

# Source files prefix directory:
#
SRC_DIR=sar

# Platforms configuration file, this file lists all defined platforms this
# program is ported to:
#
PCONF_PLATFORMS_INI=$SRC_DIR/platforms.ini

# This platform information file:
#
PCONF_THIS_PLATFORM_INI=$SRC_DIR/this_platform.ini

# Output Makefile (should be same as the one specified in 
# PCONF_PLATFORMS_INI):
#
PCONF_MAKEFILE_OUTPUT=$SRC_DIR/Makefile


# Referances to Platform Configurator's files:
#

# Prefix directory:
PCONF_PREFIX=pconf

# Generated pconf binary:
PCONF=$PCONF_PREFIX/pconf

# Tempory variables (don't touch):
PCONF_NEED_COMPILE=1
PCONF_GENERATE_SUCCESS=0


# ##############################################################################
#
# No need to edit below this line
#

# Special `reset' case
if [ "$1" = "--reset" ]; then
 echo "Resetting Platform Configurator for a clean distribution..."

 # Remove generated pconf binary
 if [ -f $PCONF ]; then
  rm -v $PCONF
 fi

 # Remove this platform information file
 if [ -f $PCONF_THIS_PLATFORM_INI ]; then
  rm -v $PCONF_THIS_PLATFORM_INI
 fi

 # Remove generated pconf output Makefile
 if [ -f $PCONF_MAKEFILE_OUTPUT ]; then
  rm -v $PCONF_MAKEFILE_OUTPUT
 fi

 echo "Done"
 exit 0
fi


# Has pconf been compiled for this system?
if [ -f $PCONF ]; then
 PCONF_NEED_COMPILE=0
fi

# Need to generate (compile) pconf?
if [ $PCONF_NEED_COMPILE = "1" ]; then
 echo "Collecting information about this platform..."
 if [ -f $PCONF_THIS_PLATFORM_INI ]; then
  rm $PCONF_THIS_PLATFORM_INI
 fi
 uname -s >> $PCONF_THIS_PLATFORM_INI
 uname -r >> $PCONF_THIS_PLATFORM_INI
 uname -m >> $PCONF_THIS_PLATFORM_INI

 echo "Generating Platform Configurator and testing system's compiler..."
 cd $PCONF_PREFIX
 make clean
 make
 cd ..

 # Check if generation successful
 if [ -f $PCONF ]; then
  PCONF_GENERATE_SUCCESS=1
 fi
 if [ $PCONF_GENERATE_SUCCESS = "0" ]; then
  echo "Could not generate Platform Configurator and/or compiler not functioning,"
  echo "you may not be able to compile/build any programs on this system. Please "
  echo "review any errors encountered above and consult with vendors."
  echo " "
  exit 1
 fi
 if [ $PCONF_GENERATE_SUCCESS = "1" ]; then
  echo " "
  echo "Compiler passed all compatibility tests!"
  echo " "
 fi
fi

# Run pconf
if [ -f $PCONF ]; then
 $PCONF $PCONF_PLATFORMS_INI "$@"
 exit $?
fi