Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: third_party/dlfcn-win32/configure

Issue 137143003: Add dlfcn-win32 to third_party (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/deps/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/dlfcn-win32/README.nacl ('k') | third_party/dlfcn-win32/dlfcn.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
1 #!/bin/sh
2 # dlfcn-win32 configure script
3 #
4 # Parts copied from FFmpeg's configure
5 #
6
7 set_all(){
8 value=$1
9 shift
10 for var in $*; do
11 eval $var=$value
12 done
13 }
14
15 enable(){
16 set_all yes $*
17 }
18
19 disable(){
20 set_all no $*
21 }
22
23 enabled(){
24 eval test "x\$$1" = "xyes"
25 }
26
27 disabled(){
28 eval test "x\$$1" = "xno"
29 }
30
31 show_help(){
32 echo "Usage: configure [options]"
33 echo "Options: [defaults in brackets after descriptions]"
34 echo "All \"enable\" options have \"disable\" counterparts"
35 echo
36 echo " --help print this message"
37 echo " --prefix=PREFIX install in PREFIX [$prefix]"
38 echo " --libdir=DIR install libs in DIR [$libdir]"
39 echo " --incdir=DIR install includes in DIR [$incdir]"
40 echo " --enable-shared build shared libraries [no]"
41 echo " --enable-static build static libraries [yes]"
42 echo " --enable-msvc create msvc-compatible import lib [auto]"
43 echo " --enable-stripping strip shared library [yes]"
44 echo
45 echo " --cc=CC use C compiler CC [$cc_default]"
46 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_pre fix]"
47 exit 1
48 }
49
50 die_unknown(){
51 echo "Unknown option \"$1\"."
52 echo "See $0 --help for available options."
53 exit 1
54 }
55
56 prefix="/mingw"
57 libdir='${prefix}/lib'
58 incdir='${prefix}/include'
59 ar="ar"
60 cc_default="gcc"
61 ranlib="ranlib"
62 strip="strip"
63
64 DEFAULT="msvc
65 "
66
67 DEFAULT_NO="shared
68 "
69
70 DEFAULT_YES="static
71 stripping
72 "
73
74 CMDLINE_SELECT="$DEFAULT
75 $DEFAULT_NO
76 $DEFAULT_YES
77 "
78
79 enable $DEFAULT_YES
80 disable $DEFAULT_NO
81
82 for opt do
83 optval="${opt#*=}"
84 case "$opt" in
85 --help)
86 show_help
87 ;;
88 --prefix=*)
89 prefix="$optval"
90 ;;
91 --libdir=*)
92 libdir="$optval"
93 ;;
94 --incdir=*)
95 incdir="$optval"
96 ;;
97 --cc=*)
98 cc="$optval"
99 ;;
100 --cross-prefix=*)
101 cross_prefix="$optval"
102 ;;
103 --enable-?*|--disable-?*)
104 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
105 echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
106 $action $option
107 ;;
108 *)
109 die_unknown $opt
110 ;;
111 esac
112 done
113
114 ar="${cross_prefix}${ar}"
115 cc_default="${cross_prefix}${cc_default}"
116 ranlib="${cross_prefix}${ranlib}"
117 strip="${cross_prefix}${strip}"
118
119 if ! test -z $cc; then
120 cc_default="${cc}"
121 fi
122 cc="${cc_default}"
123
124 disabled shared && disabled static && {
125 echo "At least one library type must be set.";
126 exit 1;
127 }
128
129 # simple cc test
130 cat > /tmp/test.c << EOF
131 #include <windows.h>
132 void function(void)
133 { LoadLibrary(NULL); }
134 EOF
135 echo testing compiler: $cc -shared -o /tmp/test.dll /tmp/test.c
136 $cc -shared -o /tmp/test.dll /tmp/test.c
137
138 test "$?" != 0 && {
139 echo "$cc could not create shared file with Windows API functions.";
140 echo "Make sure your MinGW system is working properly.";
141 exit 1;
142 }
143
144 if enabled msvc; then
145 disabled shared && {
146 echo "MSVC understands static libraries created by gcc."
147 echo "There's no need to create an import lib."
148 exit 1
149 }
150 lib /? > /dev/null 2>&1 /dev/null || {
151 echo "MSVC's lib command not found."
152 echo "Make sure MSVC is installed and its bin folder is in your \$PATH."
153 exit 1
154 }
155 fi
156
157 if ! enabled stripping; then
158 strip="@echo ignoring strip"
159 fi
160
161 if enabled shared; then
162 lib /? > /dev/null 2>&1 /dev/null && enable msvc || disable msvc
163 fi
164
165 enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib"
166
167 echo "# Automatically generated by configure" > config.mak
168 echo "prefix=$prefix" >> config.mak
169 echo "libdir=$libdir" >> config.mak
170 echo "incdir=$incdir" >> config.mak
171 echo "AR=$ar" >> config.mak
172 echo "CC=$cc" >> config.mak
173 echo "RANLIB=$ranlib" >> config.mak
174 echo "STRIP=$strip" >> config.mak
175 echo "BUILD_SHARED=$shared" >> config.mak
176 echo "BUILD_STATIC=$static" >> config.mak
177 echo "BUILD_MSVC=$msvc" >> config.mak
178 echo "LIBCMD=$libcmd" >> config.mak
179
180 echo "prefix: $prefix"
181 echo "libdir: $libdir"
182 echo "incdir: $incdir"
183 echo "ar: $ar"
184 echo "cc: $cc"
185 echo "ranlib: $ranlib"
186 echo "strip: $strip"
187 echo "static: $static"
188 echo "shared: $shared"
189 if enabled shared; then
190 echo "msvc: $msvc";
191 echo "strip: $stripping";
192 fi
OLDNEW
« no previous file with comments | « third_party/dlfcn-win32/README.nacl ('k') | third_party/dlfcn-win32/dlfcn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698