3 # Configuration shell script
8 VERSION
=`cut -f2 -d\" VERSION`
10 # default installation prefix
13 # installation directory for documents
16 # store command line args for configuring the libraries
20 while [ $# -gt 0 ] ; do
23 --help) CONFIG_HELP
=1 ;;
25 --mingw32) CC
=i586-mingw32msvc-cc
26 WINDRES
=i586-mingw32msvc-windres
27 AR
=i586-mingw32msvc-ar
30 --prefix) PREFIX
=$2 ; shift ;;
31 --prefix=*) PREFIX
=`echo $1 | sed -e 's/--prefix=//'` ;;
33 --docdir) DOCDIR
=$2 ; shift ;;
34 --docdir=*) DOCDIR
=`echo $1 | sed -e 's/--docdir=//'` ;;
41 if [ "$CONFIG_HELP" = "1" ] ; then
43 echo "Available options:"
44 echo "--prefix=PREFIX Installation prefix ($PREFIX)."
45 echo "--docdir=DOCDIR Instalation directory for documentation."
46 echo "--without-win32 Disable win32 interface detection."
47 echo "--without-unix-glob Disable glob.h usage (use workaround)."
48 echo "--with-included-regex Use included regex code (gnu_regex.c)."
49 echo "--with-pcre Enable PCRE library detection."
50 echo "--without-gettext Disable gettext usage."
51 echo "--without-iconv Disable iconv usage."
52 echo "--without-wcwidth Disable system wcwidth() (use workaround)."
53 echo "--mingw32 Build using the mingw32 compiler."
56 echo "Environment variables:"
58 echo "AR Library Archiver."
64 if [ "$DOCDIR" = "" ] ; then
65 DOCDIR
=$PREFIX/share
/doc
/mpsl
68 echo "Configuring MPSL..."
70 echo "/* automatically created by config.sh - do not modify */" > config.h
71 echo "# automatically created by config.sh - do not modify" > makefile.opts
77 if [ "$CC" = "" ] ; then
79 # if CC is unset, try if gcc is available
80 which gcc
> /dev
/null
2>&1
87 echo "CC=$CC" >> makefile.opts
90 if [ "$AR" = "" ] ; then
94 echo "AR=$AR" >> makefile.opts
97 if [ "$YACC" = "" ] ; then
101 echo "YACC=$YACC" >> makefile.opts
104 cat VERSION
>> config.h
106 # add installation prefix
107 echo "#define CONFOPT_PREFIX \"$PREFIX\"" >> config.h
109 #########################################################
111 # configuration directives
114 if [ -z "$CFLAGS" ] ; then
118 echo -n "Testing if C compiler supports ${CFLAGS}... "
119 echo "int main(int argc, char *argv[]) { return 0; }" > .tmp.c
121 $CC .tmp.c
-o .tmp.o
2>> .config.log
126 echo "No; resetting to defaults"
130 echo "CFLAGS=$CFLAGS" >> makefile.opts
136 echo -n "Looking for MPDM... "
138 for MPDM
in .
/mpdm ..
/mpdm NOTFOUND
; do
139 if [ -d $MPDM ] && [ -f $MPDM/mpdm.h
] ; then
144 if [ "$MPDM" != "NOTFOUND" ] ; then
145 echo "-I$MPDM" >> config.cflags
146 echo "-L$MPDM -lmpdm" >> config.ldflags
153 # If MPDM is not configured, do it
154 if [ ! -f $MPDM/Makefile
] ; then
155 ( echo ; cd $MPDM ; .
/config.sh
$CONF_ARGS ; echo )
158 cat $MPDM/config.ldflags
>> config.ldflags
159 echo "-lm" >> config.ldflags
161 # if win32, the interpreter is called mpsl.exe
162 grep CONFOPT_WIN32
${MPDM}/config.h
>/dev
/null
&& TARGET
=mpsl.exe
164 #########################################################
168 echo "MPDM=$MPDM" >> makefile.opts
169 grep DOCS
$MPDM/makefile.opts
>> makefile.opts
170 echo "VERSION=$VERSION" >> makefile.opts
171 echo "PREFIX=\$(DESTDIR)$PREFIX" >> makefile.opts
172 echo "DOCDIR=\$(DESTDIR)$DOCDIR" >> makefile.opts
173 echo "TARGET=$TARGET" >> makefile.opts
174 echo >> makefile.opts
176 cat makefile.opts makefile.
in makefile.depend
> Makefile
178 #########################################################