diff options
author | Timothy Gu <timothygu99@gmail.com> | 2014-03-27 02:58:02 +0000 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2014-03-27 02:58:02 +0000 |
commit | 665499d095190d49a9b70059a6c7225f81abc78b (patch) | |
tree | 8f545214741755a127969628a33a4935ff663597 | |
parent | e16a6e8eb4f81144a14d31b66774c65e900caa7d (diff) | |
download | dlfcn-win32-665499d095190d49a9b70059a6c7225f81abc78b.tar.gz dlfcn-win32-665499d095190d49a9b70059a6c7225f81abc78b.tar.bz2 dlfcn-win32-665499d095190d49a9b70059a6c7225f81abc78b.zip |
Build sys additions
* wine support for testing
* License boilerplate
* Reorder configure checks
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | configure | 36 |
2 files changed, 31 insertions, 7 deletions
@@ -64,7 +64,7 @@ testdll.dll: testdll.c | |||
64 | $(CC) -shared -o $@ $^ | 64 | $(CC) -shared -o $@ $^ |
65 | 65 | ||
66 | test: $(TARGETS) test.exe testdll.dll | 66 | test: $(TARGETS) test.exe testdll.dll |
67 | test.exe | 67 | $(WINE) test.exe |
68 | 68 | ||
69 | clean:: | 69 | clean:: |
70 | rm -f dlfcn.o libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp test.exe testdll.dll | 70 | rm -f dlfcn.o libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp test.exe testdll.dll |
@@ -1,6 +1,9 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # dlfcn-win32 configure script | 2 | # dlfcn-win32 configure script |
3 | # | 3 | # |
4 | # Copyright (c) 2007, 2009, 2012 Ramiro Polla | ||
5 | # Copyright (c) 2014 Tiancheng "Timothy" Gu | ||
6 | # | ||
4 | # Parts copied from FFmpeg's configure. Original license was: | 7 | # Parts copied from FFmpeg's configure. Original license was: |
5 | # | 8 | # |
6 | # Copyright (c) 2000-2002 Fabrice Bellard | 9 | # Copyright (c) 2000-2002 Fabrice Bellard |
@@ -58,6 +61,7 @@ show_help(){ | |||
58 | echo " --enable-static build static libraries [yes]" | 61 | echo " --enable-static build static libraries [yes]" |
59 | echo " --enable-msvc create msvc-compatible import lib [auto]" | 62 | echo " --enable-msvc create msvc-compatible import lib [auto]" |
60 | echo " --enable-stripping strip shared library [yes]" | 63 | echo " --enable-stripping strip shared library [yes]" |
64 | echo " --enable-wine[=cmd] use wine in tests [auto,cmd=$winecmd]" | ||
61 | echo | 65 | echo |
62 | echo " --cc=CC use C compiler CC [$cc_default]" | 66 | echo " --cc=CC use C compiler CC [$cc_default]" |
63 | echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" | 67 | echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" |
@@ -77,8 +81,10 @@ ar="ar" | |||
77 | cc_default="gcc" | 81 | cc_default="gcc" |
78 | ranlib="ranlib" | 82 | ranlib="ranlib" |
79 | strip="strip" | 83 | strip="strip" |
84 | winecmd="wine" | ||
80 | 85 | ||
81 | DEFAULT="msvc | 86 | DEFAULT="msvc |
87 | wine | ||
82 | " | 88 | " |
83 | 89 | ||
84 | DEFAULT_NO="shared | 90 | DEFAULT_NO="shared |
@@ -117,6 +123,10 @@ for opt do | |||
117 | --cross-prefix=*) | 123 | --cross-prefix=*) |
118 | cross_prefix="$optval" | 124 | cross_prefix="$optval" |
119 | ;; | 125 | ;; |
126 | --enable-wine=*) | ||
127 | winecmd="$optval" | ||
128 | enable wine | ||
129 | ;; | ||
120 | --enable-?*|--disable-?*) | 130 | --enable-?*|--disable-?*) |
121 | eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` | 131 | eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` |
122 | echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt | 132 | echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt |
@@ -158,7 +168,23 @@ test "$?" != 0 && { | |||
158 | exit 1; | 168 | exit 1; |
159 | } | 169 | } |
160 | 170 | ||
161 | if enabled msvc; then | 171 | if enabled wine; then # wine explicitly enabled |
172 | $winecmd --version > /dev/null 2>&1 /dev/null || { | ||
173 | echo "wine command not found." | ||
174 | echo "Make sure wine is installed and its bin folder is in your \$PATH." | ||
175 | exit 1 | ||
176 | } | ||
177 | elif disabled wine; then # explicitly disabled | ||
178 | winecmd="" | ||
179 | else # autodetect | ||
180 | $winecmd --version > /dev/null 2>&1 /dev/null && enable wine || winecmd="" | ||
181 | fi | ||
182 | |||
183 | if ! enabled stripping; then | ||
184 | strip="@echo ignoring strip" | ||
185 | fi | ||
186 | |||
187 | if enabled msvc; then # msvc explicitly enabled | ||
162 | disabled shared && { | 188 | disabled shared && { |
163 | echo "MSVC understands static libraries created by gcc." | 189 | echo "MSVC understands static libraries created by gcc." |
164 | echo "There's no need to create an import lib." | 190 | echo "There's no need to create an import lib." |
@@ -171,11 +197,7 @@ if enabled msvc; then | |||
171 | } | 197 | } |
172 | fi | 198 | fi |
173 | 199 | ||
174 | if ! enabled stripping; then | 200 | if enabled shared; then # msvc autodetected |
175 | strip="@echo ignoring strip" | ||
176 | fi | ||
177 | |||
178 | if enabled shared; then | ||
179 | lib /? > /dev/null 2>&1 /dev/null && enable msvc || disable msvc | 201 | lib /? > /dev/null 2>&1 /dev/null && enable msvc || disable msvc |
180 | fi | 202 | fi |
181 | 203 | ||
@@ -193,6 +215,7 @@ echo "BUILD_SHARED=$shared" >> config.mak | |||
193 | echo "BUILD_STATIC=$static" >> config.mak | 215 | echo "BUILD_STATIC=$static" >> config.mak |
194 | echo "BUILD_MSVC=$msvc" >> config.mak | 216 | echo "BUILD_MSVC=$msvc" >> config.mak |
195 | echo "LIBCMD=$libcmd" >> config.mak | 217 | echo "LIBCMD=$libcmd" >> config.mak |
218 | echo "WINE=$winecmd" >> config.mak | ||
196 | 219 | ||
197 | echo "prefix: $prefix" | 220 | echo "prefix: $prefix" |
198 | echo "libdir: $libdir" | 221 | echo "libdir: $libdir" |
@@ -207,3 +230,4 @@ if enabled shared; then | |||
207 | echo "msvc: $msvc"; | 230 | echo "msvc: $msvc"; |
208 | echo "strip: $stripping"; | 231 | echo "strip: $stripping"; |
209 | fi | 232 | fi |
233 | echo "wine: $wine $winecmd" | ||