2 # configure script for GNU ed - The GNU line editor
3 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
6 # This configure script is free software: you have unlimited permission
7 # to copy, distribute and modify it.
16 # clear some things potentially inherited from environment.
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'
34 while [ -n "$1" ] ; do
36 # Get the first arg, and shuffle
40 # Add the argument quoted to args
41 args="${args} \"${option}\""
43 # Split out the argument for options that take them
45 *=*) optarg=`echo ${option} | sed -e 's,^[^=]*=,,'` ;;
51 echo "Usage: configure [options]"
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}]"
71 --version | --ve* | -V)
72 echo "Configure script for GNU ${pkgname} version ${pkgversion}"
75 srcdir=`echo ${optarg} | sed -e 's,/$,,'` ;;
77 prefix=`echo ${optarg} | sed -e 's,/$,,'` ;;
78 --exec-prefix* | --ex*)
79 exec_prefix=`echo ${optarg} | sed -e 's,/$,,'` ;;
81 bindir=`echo ${optarg} | sed -e 's,/$,,'` ;;
83 datadir=`echo ${optarg} | sed -e 's,/$,,'` ;;
85 infodir=`echo ${optarg} | sed -e 's,/$,,'` ;;
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*)
96 CPPFLAGS=*) CPPFLAGS=${optarg} ;;
97 CFLAGS=*) CFLAGS=${optarg} ;;
98 LDFLAGS=*) LDFLAGS=${optarg} ;;
100 --* | *=* | *-*-*) ;;
102 echo "configure: Unrecognized option: \"${option}\"; use --help for usage." 1>&2
107 # Find the source files, if location was not specified.
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,^$,.,'`
118 if [ ! -r ${srcdir}/${srctrigger} ] ; then
121 echo "configure: Can't find sources in ${srcdir} ${srcdirtext}"
122 echo "configure: (At least ${srctrigger} is missing)."
126 # Set srcdir to . if that's what it is.
127 if [ "`pwd`" = "`cd ${srcdir} ; pwd`" ] ; then srcdir=. ; fi
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
141 if [ -z "${no_create}" ] ; then
142 echo "creating config.status"
144 cat > config.status << EOF
146 # This file was generated automatically by configure. Do not edit.
147 # Run this file to recreate the current configuration.
149 # This script is free software: you have unlimited permission
150 # to copy, distribute and modify it.
152 exec /bin/sh $0 ${args} --no-create
154 chmod +x config.status
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}"
168 echo "CPPFLAGS = ${CPPFLAGS}"
169 echo "CFLAGS = ${CFLAGS}"
170 echo "LDFLAGS = ${LDFLAGS}"
172 cat > Makefile << EOF
173 # Makefile for GNU ed - The GNU line editor
174 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
176 # This file was generated automatically by configure. Do not edit.
178 # This Makefile is free software: you have unlimited permission
179 # to copy, distribute and modify it.
182 pkgversion = ${pkgversion}
183 progname = ${progname}
186 exec_prefix = ${exec_prefix}
191 sysconfdir = ${sysconfdir}
192 program_prefix = ${program_prefix}
194 CPPFLAGS = ${CPPFLAGS}
198 cat ${srcdir}/Makefile.in >> Makefile
200 echo "OK. Now you can run make."