aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-03-27 02:58:02 +0000
committerTimothy Gu <timothygu99@gmail.com>2014-03-27 02:58:02 +0000
commit665499d095190d49a9b70059a6c7225f81abc78b (patch)
tree8f545214741755a127969628a33a4935ff663597
parente16a6e8eb4f81144a14d31b66774c65e900caa7d (diff)
downloaddlfcn-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--Makefile2
-rwxr-xr-xconfigure36
2 files changed, 31 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 377a0e2..4d11de8 100644
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ testdll.dll: testdll.c
64 $(CC) -shared -o $@ $^ 64 $(CC) -shared -o $@ $^
65 65
66test: $(TARGETS) test.exe testdll.dll 66test: $(TARGETS) test.exe testdll.dll
67 test.exe 67 $(WINE) test.exe
68 68
69clean:: 69clean::
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
diff --git a/configure b/configure
index 5b5e409..91f7d07 100755
--- a/configure
+++ b/configure
@@ -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"
77cc_default="gcc" 81cc_default="gcc"
78ranlib="ranlib" 82ranlib="ranlib"
79strip="strip" 83strip="strip"
84winecmd="wine"
80 85
81DEFAULT="msvc 86DEFAULT="msvc
87 wine
82" 88"
83 89
84DEFAULT_NO="shared 90DEFAULT_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
161if enabled msvc; then 171if 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 }
177elif disabled wine; then # explicitly disabled
178 winecmd=""
179else # autodetect
180 $winecmd --version > /dev/null 2>&1 /dev/null && enable wine || winecmd=""
181fi
182
183if ! enabled stripping; then
184 strip="@echo ignoring strip"
185fi
186
187if 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 }
172fi 198fi
173 199
174if ! enabled stripping; then 200if enabled shared; then # msvc autodetected
175 strip="@echo ignoring strip"
176fi
177
178if 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
180fi 202fi
181 203
@@ -193,6 +215,7 @@ echo "BUILD_SHARED=$shared" >> config.mak
193echo "BUILD_STATIC=$static" >> config.mak 215echo "BUILD_STATIC=$static" >> config.mak
194echo "BUILD_MSVC=$msvc" >> config.mak 216echo "BUILD_MSVC=$msvc" >> config.mak
195echo "LIBCMD=$libcmd" >> config.mak 217echo "LIBCMD=$libcmd" >> config.mak
218echo "WINE=$winecmd" >> config.mak
196 219
197echo "prefix: $prefix" 220echo "prefix: $prefix"
198echo "libdir: $libdir" 221echo "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";
209fi 232fi
233echo "wine: $wine $winecmd"