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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/dlfcn-win32/README.nacl ('k') | third_party/dlfcn-win32/dlfcn.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/dlfcn-win32/configure
===================================================================
--- third_party/dlfcn-win32/configure (revision 0)
+++ third_party/dlfcn-win32/configure (revision 0)
@@ -0,0 +1,192 @@
+#!/bin/sh
+# dlfcn-win32 configure script
+#
+# Parts copied from FFmpeg's configure
+#
+
+set_all(){
+ value=$1
+ shift
+ for var in $*; do
+ eval $var=$value
+ done
+}
+
+enable(){
+ set_all yes $*
+}
+
+disable(){
+ set_all no $*
+}
+
+enabled(){
+ eval test "x\$$1" = "xyes"
+}
+
+disabled(){
+ eval test "x\$$1" = "xno"
+}
+
+show_help(){
+ echo "Usage: configure [options]"
+ echo "Options: [defaults in brackets after descriptions]"
+ echo "All \"enable\" options have \"disable\" counterparts"
+ echo
+ echo " --help print this message"
+ echo " --prefix=PREFIX install in PREFIX [$prefix]"
+ echo " --libdir=DIR install libs in DIR [$libdir]"
+ echo " --incdir=DIR install includes in DIR [$incdir]"
+ echo " --enable-shared build shared libraries [no]"
+ echo " --enable-static build static libraries [yes]"
+ echo " --enable-msvc create msvc-compatible import lib [auto]"
+ echo " --enable-stripping strip shared library [yes]"
+ echo
+ echo " --cc=CC use C compiler CC [$cc_default]"
+ echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
+ exit 1
+}
+
+die_unknown(){
+ echo "Unknown option \"$1\"."
+ echo "See $0 --help for available options."
+ exit 1
+}
+
+prefix="/mingw"
+libdir='${prefix}/lib'
+incdir='${prefix}/include'
+ar="ar"
+cc_default="gcc"
+ranlib="ranlib"
+strip="strip"
+
+DEFAULT="msvc
+"
+
+DEFAULT_NO="shared
+"
+
+DEFAULT_YES="static
+ stripping
+"
+
+CMDLINE_SELECT="$DEFAULT
+ $DEFAULT_NO
+ $DEFAULT_YES
+"
+
+enable $DEFAULT_YES
+disable $DEFAULT_NO
+
+for opt do
+ optval="${opt#*=}"
+ case "$opt" in
+ --help)
+ show_help
+ ;;
+ --prefix=*)
+ prefix="$optval"
+ ;;
+ --libdir=*)
+ libdir="$optval"
+ ;;
+ --incdir=*)
+ incdir="$optval"
+ ;;
+ --cc=*)
+ cc="$optval"
+ ;;
+ --cross-prefix=*)
+ cross_prefix="$optval"
+ ;;
+ --enable-?*|--disable-?*)
+ eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
+ echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
+ $action $option
+ ;;
+ *)
+ die_unknown $opt
+ ;;
+ esac
+done
+
+ar="${cross_prefix}${ar}"
+cc_default="${cross_prefix}${cc_default}"
+ranlib="${cross_prefix}${ranlib}"
+strip="${cross_prefix}${strip}"
+
+if ! test -z $cc; then
+ cc_default="${cc}"
+fi
+cc="${cc_default}"
+
+disabled shared && disabled static && {
+ echo "At least one library type must be set.";
+ exit 1;
+}
+
+# simple cc test
+cat > /tmp/test.c << EOF
+#include <windows.h>
+void function(void)
+{ LoadLibrary(NULL); }
+EOF
+echo testing compiler: $cc -shared -o /tmp/test.dll /tmp/test.c
+$cc -shared -o /tmp/test.dll /tmp/test.c
+
+test "$?" != 0 && {
+ echo "$cc could not create shared file with Windows API functions.";
+ echo "Make sure your MinGW system is working properly.";
+ exit 1;
+}
+
+if enabled msvc; then
+ disabled shared && {
+ echo "MSVC understands static libraries created by gcc."
+ echo "There's no need to create an import lib."
+ exit 1
+ }
+ lib /? > /dev/null 2>&1 /dev/null || {
+ echo "MSVC's lib command not found."
+ echo "Make sure MSVC is installed and its bin folder is in your \$PATH."
+ exit 1
+ }
+fi
+
+if ! enabled stripping; then
+ strip="@echo ignoring strip"
+fi
+
+if enabled shared; then
+ lib /? > /dev/null 2>&1 /dev/null && enable msvc || disable msvc
+fi
+
+enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib"
+
+echo "# Automatically generated by configure" > config.mak
+echo "prefix=$prefix" >> config.mak
+echo "libdir=$libdir" >> config.mak
+echo "incdir=$incdir" >> config.mak
+echo "AR=$ar" >> config.mak
+echo "CC=$cc" >> config.mak
+echo "RANLIB=$ranlib" >> config.mak
+echo "STRIP=$strip" >> config.mak
+echo "BUILD_SHARED=$shared" >> config.mak
+echo "BUILD_STATIC=$static" >> config.mak
+echo "BUILD_MSVC=$msvc" >> config.mak
+echo "LIBCMD=$libcmd" >> config.mak
+
+echo "prefix: $prefix"
+echo "libdir: $libdir"
+echo "incdir: $incdir"
+echo "ar: $ar"
+echo "cc: $cc"
+echo "ranlib: $ranlib"
+echo "strip: $strip"
+echo "static: $static"
+echo "shared: $shared"
+if enabled shared; then
+ echo "msvc: $msvc";
+ echo "strip: $stripping";
+fi
Property changes on: third_party/dlfcn-win32/configure
___________________________________________________________________
Added: svn:executable
+ *
« 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