FreeCalypso > hg > themwi-rtp-lib
comparison configure @ 0:4277bc14f5bf
starting project with configure script
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 05 Jul 2024 07:36:37 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4277bc14f5bf |
---|---|
1 #!/bin/sh | |
2 # This configure script is custom and hand-coded; | |
3 # it is NOT a product of GNU Autoconf or any other such tools! | |
4 | |
5 set -e | |
6 | |
7 if [ ! -f configure ] | |
8 then | |
9 echo "This script needs to be run from the top of the source tree" 1>&2 | |
10 exit 1 | |
11 fi | |
12 | |
13 # defaults that can be overridden | |
14 CC=gcc | |
15 CFLAGS=-O2 | |
16 prefix=/usr/local | |
17 exec_prefix= | |
18 bindir= | |
19 includedir= | |
20 libdir= | |
21 osmo_prefix= | |
22 | |
23 while [ $# != 0 ] | |
24 do | |
25 case "$1" in | |
26 --prefix=*) | |
27 prefix=`echo $1 | cut -c 10-` | |
28 ;; | |
29 --exec-prefix=*) | |
30 exec_prefix=`echo $1 | cut -c 15-` | |
31 ;; | |
32 --bindir=*) | |
33 bindir=`echo $1 | cut -c 10-` | |
34 ;; | |
35 --includedir=*) | |
36 includedir=`echo $1 | cut -c 14-` | |
37 ;; | |
38 --libdir=*) | |
39 libdir=`echo $1 | cut -c 10-` | |
40 ;; | |
41 --with-osmo=*) | |
42 osmo_prefix=`echo $1 | cut -c 13-` | |
43 ;; | |
44 CC=*) | |
45 CC=`echo $1 | cut -c 4-` | |
46 ;; | |
47 CFLAGS=*) | |
48 CFLAGS=`echo $1 | cut -c 8-` | |
49 ;; | |
50 *) | |
51 echo "error: non-understood option $1" 1>&2 | |
52 exit 1; | |
53 ;; | |
54 esac | |
55 shift | |
56 done | |
57 | |
58 # find Osmocom dependencies | |
59 | |
60 if [ -n "$osmo_prefix" ] | |
61 then | |
62 PKG_CONFIG_PATH="$osmo_prefix/lib/pkgconfig" | |
63 export PKG_CONFIG_PATH | |
64 fi | |
65 | |
66 osmo_depend="libosmocore libosmovty" | |
67 | |
68 OSMO_INCLUDE=`pkg-config --cflags-only-I $osmo_depend` | |
69 OSMO_LIBS=`pkg-config --libs-only-l $osmo_depend` | |
70 OSMO_LPATH=`pkg-config --libs-only-L $osmo_depend` | |
71 OSMO_RPATH=`echo "$OSMO_LPATH" | sed -e s/-L/-Wl,-rpath,/` | |
72 | |
73 # inheritance rules for install directories | |
74 | |
75 if [ -z "$exec_prefix" ] | |
76 then | |
77 exec_prefix="$prefix" | |
78 fi | |
79 if [ -z "$bindir" ] | |
80 then | |
81 bindir="$exec_prefix/bin" | |
82 fi | |
83 if [ -z "$includedir" ] | |
84 then | |
85 includedir="$prefix/include" | |
86 fi | |
87 if [ -z "$libdir" ] | |
88 then | |
89 libdir="$exec_prefix/lib" | |
90 fi | |
91 | |
92 # report the final configuration | |
93 | |
94 echo "C code will be compiled with:" | |
95 echo " CC=$CC" | |
96 echo " CFLAGS=$CFLAGS" | |
97 echo "Installation directories:" | |
98 echo " bindir=$bindir" | |
99 echo " includedir=$includedir" | |
100 echo " libdir=$libdir" | |
101 echo "See config.defs output for Osmocom dependencies" | |
102 | |
103 # emit the Makefile include fragment | |
104 echo "CC=$CC" > config.defs | |
105 echo "CFLAGS=$CFLAGS" >> config.defs | |
106 echo "OSMO_INCLUDE=$OSMO_INCLUDE" >> config.defs | |
107 echo "OSMO_LIBS=$OSMO_LIBS" >> config.defs | |
108 echo "OSMO_LPATH=$OSMO_LPATH" >> config.defs | |
109 echo "OSMO_RPATH=$OSMO_RPATH" >> config.defs | |
110 echo "bindir=$bindir" >> config.defs | |
111 echo "includedir=$includedir" >> config.defs | |
112 echo "libdir=$libdir" >> config.defs |