1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
#! /bin/sh
# if any of it looks familiar, I stole it from MPlayer.
for parm in "$@" ; do
if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
cat << EOF
Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
Compile System:
--no-cygwin compile on cygwin with mingw runtime
--enable-debug compile with debugging symbols
--with-socklib=LIB specify the socket library to link against (if any)
Installation directories:
--prefix=DIR use this prefix for installation [/usr/local]
--bindir=DIR use this prefix for installing binaries [PREFIX/bin]
--incdir=DIR use this prefix for installing headers [PREFIX/include]
--docdir=DIR use this prefix for installing docs [PREFIX/share/doc]
--libdir=DIR use this prefix for object code libraries [PREFIX/lib]
EOF
exit 0
fi
done # for parm in ...
_prefix="/usr/local"
_no_cygwin=no
_debug=no
for ac_option do
case "$ac_option" in
--enable-debug)
_debug=yes
;;
--no-cygwin)
_no_cygwin=yes
;;
--prefix=*)
_prefix=`echo $ac_option | cut -d '=' -f 2`
;;
--bindir=*)
_bindir=`echo $ac_option | cut -d '=' -f 2`
;;
--incdir=*)
_incdir=`echo $ac_option | cut -d '=' -f 2`
;;
--docdir=*)
_docdir=`echo $ac_option | cut -d '=' -f 2`
;;
--libdir=*)
_libdir=`echo $ac_option | cut -d '=' -f 2`
;;
--with-socklib=*)
_socklib=`echo $ac_option | cut -d '=' -f 2`
;;
*)
echo "Unknown parameter: $ac_option"
exit 1
;;
esac
done
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_incdir" && _incdir="$_prefix/include"
test -z "$_docdir" && _docdir="$_prefix/share/doc"
test -z "$_libdir" && _libdir="$_prefix/lib"
if test -z "$CFLAGS" ; then
CFLAGS="-O2"
fi
if test "$_debug" = "yes"; then
CFLAGS="$CFLAGS -g -Wall"
fi
_cygwin=`uname -s | grep -i cygwin`;
_mingw=`uname -s | grep -i mingw`;
if test "$_cygwin" != "" && test "$_no_cygwin" = "yes"; then
_mingw=yes
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin -enable-stdcall-fixup"
fi
if test "$_mingw" != "" && test -z "$_socklib"; then
_socklib="-lws2_32"
fi
#############################################################################
echo "Creating config.mak"
cat > config.mak << EOF
# -------- Generated by configure -----------
BINDIR = $_bindir
LIBDIR = $_libdir
INCDIR = $_incdir
DOCDIR = $_docdir
D_BINDIR = \$(DESTDIR)\$(BINDIR)
D_LIBDIR = \$(DESTDIR)\$(LIBDIR)
D_INCDIR = \$(DESTDIR)\$(INCDIR)
D_DOCDIR = \$(DESTDIR)\$(DOCDIR)
CFLAGS = $CFLAGS
LDFLAGS = $LDFLAGS
CYGWIN = $_cygwin
MINGW = $_mingw
SOCKLIB = $_socklib
EOF
echo "Config files successfully generated by ./configure !"
|