-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·72 lines (63 loc) · 1.9 KB
/
configure
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
#!/bin/sh
set -x
if test "x$1" != "x"; then
# echo Found input parameter -- $1
# Now see if the parameter is --prefix=
if test "x${1#--prefix=}" != "x$1"; then
# echo "Found --prefix in input args. Setting prefix directory."
prefix=${1#--prefix=}
else
# echo "Found unrecognized parameter in input args."
# Just use the default prefix dir.
prefix=/usr/local
fi
pkglibdir=${prefix}/lib/gnucap
plugpath=${pkglibdir}:$( gnucap-conf --pkglibdir )
sysconfdir=${prefix}/etc
else
# echo "No input parameter found."
# Just use the default prefix dir
prefix=$( gnucap-conf --exec-prefix )
pkglibdir=$( gnucap-conf --pkglibdir )
plugpath=$( gnucap-conf --pkglibdir )
sysconfdir=$( gnucap-conf --sysconfdir )
fi
# bug. this is not implemented consistently.
CXX=${CXX-c++}
STATUS="$*"
NOTICE="\#THIS_FILE_IS_AUTOMATICALLY_GENERATED"
# hmm, here?
GNUCSATOR_PKGLIBDIR=${pkglibdir}/qucs
PKGINCLUDEDIR=${prefix}/include/gnucap-qucs/
fill_template() {
t=$( mktemp );#tempfile depricated -> mktemp
sed -e "s#@prefix@#$prefix#g" \
-e "s#@exec_prefix@#$prefix#g" \
-e "s#@libdir@#$prefix/lib#g" \
-e "s#@NOTICE@#$NOTICE#g" \
-e "s#@PKGINCLUDEDIR@#$PKGINCLUDEDIR#g" \
-e "s#@includedir@#$\{prefix\}/include#g" \
-e "s#@datarootdir@#$\{prefix\}/share/gnucap#g" \
-e "s#@sysconfdir@#$sysconfdir#g" \
-e "s#@pkglibdir@#$pkglibdir#g" \
-e "s#@plugpath@#$plugpath#g" \
-e "s#@CXXFLAGS@#$CCFLAGS#g" \
-e "s#@LIBS@#-lgnucap#g" \
-e "s#@STATUS@#$STATUS#g" \
-e "s#@CXX@#$CXX#g" < $1.in > $t
if diff $1 $t >/dev/null; then
rm $t;
else
mv $t $1;
fi
}
fill_template config.h
fill_template Makefile
fill_template tests/Makefile
fill_template gnucsator.rc
echo -n '# ' > config.log
date > config.log
echo $0 "$@" >> config.log
echo prefix: $prefix
echo pkglibdir: $pkglibdir
echo plugpath: $plugpath