resetting manifest requested domain to floor
[platform/upstream/ed.git] / configure
1 #! /bin/sh
2 # configure script for GNU ed - The GNU line editor
3 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 # Antonio Diaz Diaz.
5 #
6 # This configure script is free software: you have unlimited permission
7 # to copy, distribute and modify it.
8
9 args=
10 no_create=
11 pkgname=ed
12 pkgversion=1.6
13 progname=ed
14 srctrigger=ed.h
15
16 # clear some things potentially inherited from environment.
17 LC_ALL=C
18 export LC_ALL
19 srcdir=
20 prefix=/usr/local
21 exec_prefix='$(prefix)'
22 bindir='$(exec_prefix)/bin'
23 datadir='$(prefix)/share'
24 infodir='$(datadir)/info'
25 mandir='$(datadir)/man'
26 sysconfdir='$(prefix)/etc'
27 program_prefix=
28 CC=
29 CPPFLAGS=
30 CFLAGS='-Wall -W -O2'
31 LDFLAGS=
32
33 # Loop over all args
34 while [ -n "$1" ] ; do
35
36         # Get the first arg, and shuffle
37         option=$1
38         shift
39
40         # Add the argument quoted to args
41         args="${args} \"${option}\""
42
43         # Split out the argument for options that take them
44         case ${option} in
45         *=*) optarg=`echo ${option} | sed -e 's,^[^=]*=,,'` ;;
46         esac
47
48         # Process the options
49         case ${option} in
50         --help | --he* | -h)
51                 echo "Usage: configure [options]"
52                 echo
53                 echo "Options: [defaults in brackets]"
54                 echo "  -h, --help            display this help and exit"
55                 echo "  -V, --version         output version information and exit"
56                 echo "  --srcdir=DIR          find the sources in DIR [. or ..]"
57                 echo "  --prefix=DIR          install into DIR [${prefix}]"
58                 echo "  --exec-prefix=DIR     base directory for arch-dependent files [${exec_prefix}]"
59                 echo "  --bindir=DIR          user executables directory [${bindir}]"
60                 echo "  --datadir=DIR         base directory for doc and data [${datadir}]"
61                 echo "  --infodir=DIR         info files directory [${infodir}]"
62                 echo "  --mandir=DIR          man pages directory [${mandir}]"
63                 echo "  --sysconfdir=DIR      read-only single-machine data directory [${sysconfdir}]"
64                 echo "  --program-prefix=NAME install program and documentation prefixed with NAME"
65                 echo "  CC=COMPILER           C compiler to use [gcc]"
66                 echo "  CPPFLAGS=OPTIONS      command line options for the preprocessor [${CPPFLAGS}]"
67                 echo "  CFLAGS=OPTIONS        command line options for the C compiler [${CFLAGS}]"
68                 echo "  LDFLAGS=OPTIONS       command line options for the linker [${LDFLAGS}]"
69                 echo
70                 exit 0 ;;
71         --version | --ve* | -V)
72                 echo "Configure script for GNU ${pkgname} version ${pkgversion}"
73                 exit 0 ;;
74         --srcdir* | --sr*)
75                 srcdir=`echo ${optarg} | sed -e 's,/$,,'` ;;
76         --prefix* | --pre*)
77                 prefix=`echo ${optarg} | sed -e 's,/$,,'` ;;
78         --exec-prefix* | --ex*)
79                 exec_prefix=`echo ${optarg} | sed -e 's,/$,,'` ;;
80         --bindir* | --bi*)
81                 bindir=`echo ${optarg} | sed -e 's,/$,,'` ;;
82         --datadir* | --da*)
83                 datadir=`echo ${optarg} | sed -e 's,/$,,'` ;;
84         --infodir* | --inf*)
85                 infodir=`echo ${optarg} | sed -e 's,/$,,'` ;;
86         --mandir* | --ma*)
87                 mandir=`echo ${optarg} | sed -e 's,/$,,'` ;;
88         --sysconfdir* | --sy*)
89                 sysconfdir=`echo ${optarg} | sed -e 's,/$,,'` ;;
90         --program-prefix* | --pro*)
91                 program_prefix=`echo ${optarg} | sed -e 's,/$,,'` ;;
92         --no-create | --no-c*)
93                 no_create=yes ;;
94
95         CC=*)       CC=${optarg} ;;
96         CPPFLAGS=*) CPPFLAGS=${optarg} ;;
97         CFLAGS=*)   CFLAGS=${optarg} ;;
98         LDFLAGS=*)  LDFLAGS=${optarg} ;;
99
100         --* | *=* | *-*-*) ;;
101         *)
102                 echo "configure: Unrecognized option: \"${option}\"; use --help for usage." 1>&2
103                 exit 1 ;;
104         esac
105 done
106
107 # Find the source files, if location was not specified.
108 srcdirtext=
109 if [ -z "${srcdir}" ] ; then
110         srcdirtext="or . or .." ; srcdir=.
111         if [ ! -r ${srcdir}/${srctrigger} ] ; then srcdir=.. ; fi
112         if [ ! -r ${srcdir}/${srctrigger} ] ; then
113                 ## the sed command below emulates the dirname command
114                 srcdir=`echo $0 | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
115         fi
116 fi
117
118 if [ ! -r ${srcdir}/${srctrigger} ] ; then
119         exec 1>&2
120         echo
121         echo "configure: Can't find sources in ${srcdir} ${srcdirtext}"
122         echo "configure: (At least ${srctrigger} is missing)."
123         exit 1
124 fi
125
126 # Set srcdir to . if that's what it is.
127 if [ "`pwd`" = "`cd ${srcdir} ; pwd`" ] ; then srcdir=. ; fi
128
129 # checking whether we are using GNU C.
130 if [ -z "${CC}" ] ; then                # Let the user override the test.
131         if [ -x /bin/gcc ] ||
132            [ -x /usr/bin/gcc ] ||
133            [ -x /usr/local/bin/gcc ] ; then
134                 CC="gcc"
135         else
136                 CC="cc"
137         fi
138 fi
139
140 echo
141 if [ -z "${no_create}" ] ; then
142         echo "creating config.status"
143         rm -f config.status
144         cat > config.status << EOF
145 #! /bin/sh
146 # This file was generated automatically by configure. Do not edit.
147 # Run this file to recreate the current configuration.
148 #
149 # This script is free software: you have unlimited permission
150 # to copy, distribute and modify it.
151
152 exec /bin/sh $0 ${args} --no-create
153 EOF
154         chmod +x config.status
155 fi
156
157 echo "creating Makefile"
158 echo "VPATH = ${srcdir}"
159 echo "prefix = ${prefix}"
160 echo "exec_prefix = ${exec_prefix}"
161 echo "bindir = ${bindir}"
162 echo "datadir = ${datadir}"
163 echo "infodir = ${infodir}"
164 echo "mandir = ${mandir}"
165 echo "sysconfdir = ${sysconfdir}"
166 echo "program_prefix = ${program_prefix}"
167 echo "CC = ${CC}"
168 echo "CPPFLAGS = ${CPPFLAGS}"
169 echo "CFLAGS = ${CFLAGS}"
170 echo "LDFLAGS = ${LDFLAGS}"
171 rm -f Makefile
172 cat > Makefile << EOF
173 # Makefile for GNU ed - The GNU line editor
174 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
175 # Antonio Diaz Diaz.
176 # This file was generated automatically by configure. Do not edit.
177 #
178 # This Makefile is free software: you have unlimited permission
179 # to copy, distribute and modify it.
180
181 pkgname = ${pkgname}
182 pkgversion = ${pkgversion}
183 progname = ${progname}
184 VPATH = ${srcdir}
185 prefix = ${prefix}
186 exec_prefix = ${exec_prefix}
187 bindir = ${bindir}
188 datadir = ${datadir}
189 infodir = ${infodir}
190 mandir = ${mandir}
191 sysconfdir = ${sysconfdir}
192 program_prefix = ${program_prefix}
193 CC = ${CC}
194 CPPFLAGS = ${CPPFLAGS}
195 CFLAGS = ${CFLAGS}
196 LDFLAGS = ${LDFLAGS}
197 EOF
198 cat ${srcdir}/Makefile.in >> Makefile
199
200 echo "OK. Now you can run make."