aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2009-01-11 20:19:24 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2009-01-11 20:19:24 +0000
commit4750304376d4697ac440c54c3ac4646bba715bf0 (patch)
treef04baf9c31eb341684d9441dca01fb0c0a85597a
parent74b330c11c881e939c0b79e8d5fa53bdee86c479 (diff)
downloaddlfcn-win32-4750304376d4697ac440c54c3ac4646bba715bf0.tar.gz
dlfcn-win32-4750304376d4697ac440c54c3ac4646bba715bf0.tar.bz2
dlfcn-win32-4750304376d4697ac440c54c3ac4646bba715bf0.zip
dos2unix configure
-rwxr-xr-xconfigure332
1 files changed, 166 insertions, 166 deletions
diff --git a/configure b/configure
index 96f9ee0..7d44f17 100755
--- a/configure
+++ b/configure
@@ -1,166 +1,166 @@
1#!/bin/sh 1#!/bin/sh
2# dlfcn-win32 configure script 2# dlfcn-win32 configure script
3# 3#
4# Parts copied from FFmpeg's configure 4# Parts copied from FFmpeg's configure
5# 5#
6 6
7set_all(){ 7set_all(){
8 value=$1 8 value=$1
9 shift 9 shift
10 for var in $*; do 10 for var in $*; do
11 eval $var=$value 11 eval $var=$value
12 done 12 done
13} 13}
14 14
15enable(){ 15enable(){
16 set_all yes $* 16 set_all yes $*
17} 17}
18 18
19disable(){ 19disable(){
20 set_all no $* 20 set_all no $*
21} 21}
22 22
23enabled(){ 23enabled(){
24 eval test "x\$$1" = "xyes" 24 eval test "x\$$1" = "xyes"
25} 25}
26 26
27disabled(){ 27disabled(){
28 eval test "x\$$1" = "xno" 28 eval test "x\$$1" = "xno"
29} 29}
30 30
31show_help(){ 31show_help(){
32 echo "Usage: configure [options]" 32 echo "Usage: configure [options]"
33 echo "Options: [defaults in brackets after descriptions]" 33 echo "Options: [defaults in brackets after descriptions]"
34 echo "All \"enable\" options have \"disable\" counterparts" 34 echo "All \"enable\" options have \"disable\" counterparts"
35 echo 35 echo
36 echo " --help print this message" 36 echo " --help print this message"
37 echo " --prefix=PREFIX install in PREFIX [$PREFIX]" 37 echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
38 echo " --libdir=DIR install libs in DIR [$PREFIX/lib]" 38 echo " --libdir=DIR install libs in DIR [$PREFIX/lib]"
39 echo " --incdir=DIR install includes in DIR [$PREFIX/include]" 39 echo " --incdir=DIR install includes in DIR [$PREFIX/include]"
40 echo " --enable-shared build shared libraries [no]" 40 echo " --enable-shared build shared libraries [no]"
41 echo " --enable-static build static libraries [yes]" 41 echo " --enable-static build static libraries [yes]"
42 echo " --enable-msvc create msvc-compatible import lib [auto]" 42 echo " --enable-msvc create msvc-compatible import lib [auto]"
43 echo " --enable-strip strip shared library [yes]" 43 echo " --enable-strip strip shared library [yes]"
44 echo 44 echo
45 echo " --cc=CC use C compiler CC [$cc]" 45 echo " --cc=CC use C compiler CC [$cc]"
46 echo " --make=MAKE use specified make [$make]" 46 echo " --make=MAKE use specified make [$make]"
47 exit 1 47 exit 1
48} 48}
49 49
50die_unknown(){ 50die_unknown(){
51 echo "Unknown option \"$1\"." 51 echo "Unknown option \"$1\"."
52 echo "See $0 --help for available options." 52 echo "See $0 --help for available options."
53 exit 1 53 exit 1
54} 54}
55 55
56PREFIX="/mingw" 56PREFIX="/mingw"
57libdir="${PREFIX}/lib" 57libdir="${PREFIX}/lib"
58incdir="${PREFIX}/include" 58incdir="${PREFIX}/include"
59cc="gcc" 59cc="gcc"
60 60
61DEFAULT="msvc 61DEFAULT="msvc
62" 62"
63 63
64DEFAULT_NO="shared 64DEFAULT_NO="shared
65" 65"
66 66
67DEFAULT_YES="static 67DEFAULT_YES="static
68 strip 68 strip
69" 69"
70 70
71CMDLINE_SELECT="$DEFAULT 71CMDLINE_SELECT="$DEFAULT
72 $DEFAULT_NO 72 $DEFAULT_NO
73 $DEFAULT_YES 73 $DEFAULT_YES
74" 74"
75 75
76enable $DEFAULT_YES 76enable $DEFAULT_YES
77disable $DEFAULT_NO 77disable $DEFAULT_NO
78 78
79for opt do 79for opt do
80 optval="${opt#*=}" 80 optval="${opt#*=}"
81 case "$opt" in 81 case "$opt" in
82 --help) 82 --help)
83 show_help 83 show_help
84 ;; 84 ;;
85 --prefix=*) 85 --prefix=*)
86 PREFIX="$optval" 86 PREFIX="$optval"
87 ;; 87 ;;
88 --libdir=*) 88 --libdir=*)
89 libdir="$optval" 89 libdir="$optval"
90 ;; 90 ;;
91 --incdir=*) 91 --incdir=*)
92 incdir="$optval" 92 incdir="$optval"
93 ;; 93 ;;
94 --cc=*) 94 --cc=*)
95 cc="$optval" 95 cc="$optval"
96 ;; 96 ;;
97 --make=*) 97 --make=*)
98 make="$optval" 98 make="$optval"
99 ;; 99 ;;
100 --enable-?*|--disable-?*) 100 --enable-?*|--disable-?*)
101 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` 101 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
102 echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt 102 echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
103 $action $option 103 $action $option
104 ;; 104 ;;
105 *) 105 *)
106 die_unknown $opt 106 die_unknown $opt
107 ;; 107 ;;
108 esac 108 esac
109done 109done
110 110
111disabled shared && disabled static && { 111disabled shared && disabled static && {
112 echo "At least one library type must be set."; 112 echo "At least one library type must be set.";
113 exit 1; 113 exit 1;
114} 114}
115 115
116# simple cc test 116# simple cc test
117cat > /tmp/test.c << EOF 117cat > /tmp/test.c << EOF
118#include <windows.h> 118#include <windows.h>
119void function(void) 119void function(void)
120{ LoadLibrary(NULL); } 120{ LoadLibrary(NULL); }
121EOF 121EOF
122$cc -shared -o /tmp/test.dll /tmp/test.c 122$cc -shared -o /tmp/test.dll /tmp/test.c
123 123
124test "$?" = !0 && { 124test "$?" = !0 && {
125 echo "$cc could not create shared file with Windows API functions."; 125 echo "$cc could not create shared file with Windows API functions.";
126 echo "Make sure your MinGW system is working properly."; 126 echo "Make sure your MinGW system is working properly.";
127 exit 1; 127 exit 1;
128} 128}
129 129
130if enabled msvc; then 130if enabled msvc; then
131 disabled shared && { 131 disabled shared && {
132 echo "MSVC understands static libraries created by gcc." 132 echo "MSVC understands static libraries created by gcc."
133 echo "There's no need to create an import lib." 133 echo "There's no need to create an import lib."
134 exit 1 134 exit 1
135 } 135 }
136 lib /? >& /dev/null || { 136 lib /? >& /dev/null || {
137 echo "MSVC's lib command not found." 137 echo "MSVC's lib command not found."
138 echo "Make sure MSVC is installed and its bin folder is in your \$PATH." 138 echo "Make sure MSVC is installed and its bin folder is in your \$PATH."
139 exit 1 139 exit 1
140 } 140 }
141fi 141fi
142 142
143if enabled shared; then 143if enabled shared; then
144 lib /? >& /dev/null && enable msvc || disable msvc 144 lib /? >& /dev/null && enable msvc || disable msvc
145fi 145fi
146 146
147echo "# Automatically generated by configure" > config.mak 147echo "# Automatically generated by configure" > config.mak
148echo "PREFIX=$PREFIX" >> config.mak 148echo "PREFIX=$PREFIX" >> config.mak
149echo "libdir=$libdir" >> config.mak 149echo "libdir=$libdir" >> config.mak
150echo "incdir=$incdir" >> config.mak 150echo "incdir=$incdir" >> config.mak
151echo "CC=$cc" >> config.mak 151echo "CC=$cc" >> config.mak
152echo "BUILD_SHARED=$shared" >> config.mak 152echo "BUILD_SHARED=$shared" >> config.mak
153echo "BUILD_STATIC=$static" >> config.mak 153echo "BUILD_STATIC=$static" >> config.mak
154echo "BUILD_MSVC=$msvc" >> config.mak 154echo "BUILD_MSVC=$msvc" >> config.mak
155echo "DO_STRIP=$strip" >> config.mak 155echo "DO_STRIP=$strip" >> config.mak
156 156
157echo "prefix: $PREFIX" 157echo "prefix: $PREFIX"
158echo "libdir: $libdir" 158echo "libdir: $libdir"
159echo "incdir: $incdir" 159echo "incdir: $incdir"
160echo "cc: $cc" 160echo "cc: $cc"
161echo "static: $static" 161echo "static: $static"
162echo "shared: $shared" 162echo "shared: $shared"
163enabled shared && { 163enabled shared && {
164 echo "msvc: $msvc"; 164 echo "msvc: $msvc";
165 echo "strip: $strip"; 165 echo "strip: $strip";
166} 166}