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
87 echo "CC=$CC" >> makefile.opts
90 if [ "$CFLAGS" = "" -a "$CC" = "gcc" ] ; then
94 echo "CFLAGS=$CFLAGS" >> makefile.opts
100 if [ "$AR" = "" ] ; then
104 echo "AR=$AR" >> makefile.opts
107 if [ "$YACC" = "" ] ; then
111 echo "YACC=$YACC" >> makefile.opts
114 cat VERSION
>> config.h
116 # add installation prefix
117 echo "#define CONFOPT_PREFIX \"$PREFIX\"" >> config.h
119 #########################################################
121 # configuration directives
124 echo -n "Looking for MPDM... "
126 for MPDM
in .
/mpdm ..
/mpdm NOTFOUND
; do
127 if [ -d $MPDM ] && [ -f $MPDM/mpdm.h
] ; then
132 if [ "$MPDM" != "NOTFOUND" ] ; then
133 echo "-I$MPDM" >> config.cflags
134 echo "-L$MPDM -lmpdm" >> config.ldflags
141 # If MPDM is not configured, do it
142 if [ ! -f $MPDM/Makefile
] ; then
143 ( echo ; cd $MPDM ; .
/config.sh
$CONF_ARGS ; echo )
146 cat $MPDM/config.ldflags
>> config.ldflags
148 # if win32, the interpreter is called mpsl.exe
149 grep CONFOPT_WIN32
${MPDM}/config.h
>/dev
/null
&& TARGET
=mpsl.exe
151 #########################################################
155 echo "MPDM=$MPDM" >> makefile.opts
156 grep DOCS
$MPDM/makefile.opts
>> makefile.opts
157 echo "VERSION=$VERSION" >> makefile.opts
158 echo "PREFIX=\$(DESTDIR)$PREFIX" >> makefile.opts
159 echo "DOCDIR=\$(DESTDIR)$DOCDIR" >> makefile.opts
160 echo "TARGET=$TARGET" >> makefile.opts
161 echo >> makefile.opts
163 cat makefile.opts makefile.
in makefile.depend
> Makefile
165 #########################################################