annotate configure @ 5:3604828b2f54

add top Makefile
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 29 Aug 2024 13:21:38 +0000
parents 06c795d4781d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #!/bin/sh
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 # This configure script is custom and hand-coded;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 # it is NOT a product of GNU Autoconf or any other such tools!
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 set -e
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 if [ ! -f configure ]
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 then
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 echo "This script needs to be run from the top of the source tree" 1>&2
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 exit 1
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 fi
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 # defaults that can be overridden
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 CC=gcc
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 CFLAGS=-O2
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 prefix=/usr/local
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 exec_prefix=
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 bindir=
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 osmo_prefix=
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 while [ $# != 0 ]
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 do
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 case "$1" in
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 --prefix=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 prefix=`echo $1 | cut -c 10-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 --exec-prefix=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 exec_prefix=`echo $1 | cut -c 15-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 --bindir=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 bindir=`echo $1 | cut -c 10-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 --with-osmo=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 osmo_prefix=`echo $1 | cut -c 13-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 CC=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 CC=`echo $1 | cut -c 4-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 CFLAGS=*)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 CFLAGS=`echo $1 | cut -c 8-`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 *)
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 echo "error: non-understood option $1" 1>&2
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 exit 1;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 ;;
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 esac
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 shift
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 done
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 # find Osmocom dependencies
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 if [ -n "$osmo_prefix" ]
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 then
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 PKG_CONFIG_PATH="$osmo_prefix/lib/pkgconfig"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 export PKG_CONFIG_PATH
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 fi
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 osmo_depend="libosmocore libosmoisdn libosmotrau libosmo-e1d"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 OSMO_INCLUDE=`pkg-config --cflags-only-I $osmo_depend`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 OSMO_LIBS=`pkg-config --libs-only-l $osmo_depend`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 OSMO_LPATH=`pkg-config --libs-only-L $osmo_depend`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 OSMO_RPATH=`echo "$OSMO_LPATH" | sed -e s/-L/-Wl,-rpath,/`
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 # inheritance rules for install directories
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 if [ -z "$exec_prefix" ]
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 then
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 exec_prefix="$prefix"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 fi
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 if [ -z "$bindir" ]
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 then
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 bindir="$exec_prefix/bin"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 fi
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 # report the final configuration
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 echo "C code will be compiled with:"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 echo " CC=$CC"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 echo " CFLAGS=$CFLAGS"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 echo "Installation directory:"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 echo " bindir=$bindir"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 echo "See config.defs output for Osmocom dependencies"
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 # emit the Makefile include fragment
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 echo "CC=$CC" > config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 echo "CFLAGS=$CFLAGS" >> config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 echo "OSMO_INCLUDE=$OSMO_INCLUDE" >> config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 echo "OSMO_LIBS=$OSMO_LIBS" >> config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 echo "OSMO_LPATH=$OSMO_LPATH" >> config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 echo "OSMO_RPATH=$OSMO_RPATH" >> config.defs
06c795d4781d configure: copy from ice1-trau-tester
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 echo "bindir=$bindir" >> config.defs