2 # mmap-win32 configure script
4 # Parts copied from FFmpeg's configure
24 eval test "x\$$1" = "xyes"
28 eval test "x\$$1" = "xno"
32 echo "Usage: configure [options]"
33 echo "Options: [defaults in brackets after descriptions]"
34 echo "All \"enable\" options have \"disable\" counterparts"
36 echo " --help print this message"
37 echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
38 echo " --bindir=DIR install binaries in DIR [$PREFIX/bin]"
39 echo " --libdir=DIR install libs in DIR [$PREFIX/lib]"
40 echo " --incdir=DIR install includes in DIR [$PREFIX/include]"
41 echo " --enable-static build static libraries [yes]"
42 echo " --enable-shared build shared libraries [no]"
43 echo " --enable-msvc create msvc-compatible import lib [auto]"
45 echo " --cc=CC use C compiler CC [$cc_default]"
46 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
51 echo "Unknown option \"$1\"."
52 echo "See $0 --help for available options."
72 CMDLINE_SELECT="$DEFAULT
102 cross_prefix="$optval"
104 --enable-?*|--disable-?*)
105 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
106 echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
115 bindir="${PREFIX}/bin"
116 libdir="${PREFIX}/lib"
117 incdir="${PREFIX}/include/sys"
118 ar="${cross_prefix}${ar}"
119 cc_default="${cross_prefix}${cc_default}"
120 ranlib="${cross_prefix}${ranlib}"
121 strip="${cross_prefix}${strip}"
123 if ! test -z $cc; then
128 disabled static && disabled shared && {
129 echo "At least one library type must be set.";
133 if enabled msvc; then
134 lib /? > /dev/null 2>&1 /dev/null || {
135 echo "MSVC's lib command not found."
136 echo "Make sure MSVC is installed and its bin folder is in your \$PATH."
141 if ! enabled stripping; then
142 strip="echo ignoring strip"
145 enabled msvc && libcmd="lib" || libcmd="echo ignoring lib"
147 echo "# Automatically generated by configure" > config.mak
148 echo "PREFIX=$PREFIX" >> config.mak
149 echo "bindir=$bindir" >> config.mak
150 echo "libdir=$libdir" >> config.mak
151 echo "incdir=$incdir" >> config.mak
152 echo "AR=$ar" >> config.mak
153 echo "CC=$cc" >> config.mak
154 echo "RANLIB=$ranlib" >> config.mak
155 echo "STRIP=$strip" >> config.mak
156 echo "BUILD_STATIC=$static" >> config.mak
157 echo "BUILD_SHARED=$shared" >> config.mak
158 echo "BUILD_MSVC=$msvc" >> config.mak
159 echo "LIBCMD=$libcmd" >> config.mak
161 echo "prefix: $PREFIX"
162 echo "bindir: $bindir"
163 echo "libdir: $libdir"
164 echo "incdir: $incdir"
167 echo "ranlib: $ranlib"
169 echo "static: $static"
170 echo "shared: $shared"