aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-12-21 12:45:58 -0800
committerTimothy Gu <timothygu99@gmail.com>2014-12-21 12:45:58 -0800
commitb87558a055897891d1c9f26e867d636d833ee55e (patch)
tree80cfc14857ee552cfd5242a815f34ed98cd19359
parent2d6c00722652589b6c2532d9e9a43417d29612c1 (diff)
downloaddlfcn-win32-lib-exp.tar.gz
dlfcn-win32-lib-exp.tar.bz2
dlfcn-win32-lib-exp.zip
WIP autoolslib-exp
-rw-r--r--.gitignore7
-rw-r--r--Makefile.am17
-rw-r--r--acinclude.m46
-rw-r--r--configure.ac11
-rwxr-xr-xconfigure22
5 files changed, 38 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 08504f2..99b2816 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@
31# Deps & libs 31# Deps & libs
32.deps 32.deps
33.libs 33.libs
34*.def
34 35
35# http://www.gnu.org/software/automake 36# http://www.gnu.org/software/automake
36 37
@@ -56,4 +57,8 @@ Makefile
56/config.log 57/config.log
57/config.status 58/config.status
58/libtool 59/libtool
59/ltmain.sh \ No newline at end of file 60/ltmain.sh
61
62# configure2-generated
63
64config.mak \ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
index 1c8ce13..0a6605a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,5 +2,18 @@ ACLOCAL_AMFLAGS = -I m4
2 2
3lib_LTLIBRARIES = libdl.la 3lib_LTLIBRARIES = libdl.la
4libdl_la_SOURCES = dlfcn.c 4libdl_la_SOURCES = dlfcn.c
5libdl_la_LDFLAGS = -no-undefined 5# Don't build libdl as libdl-0.dll
6include_HEADERS = dlfcn.h \ No newline at end of file 6libdl_la_LDFLAGS = -avoid-version -no-undefined @GEN_DEF@
7include_HEADERS = dlfcn.h
8
9$(lib_LTLIBRARIES): @LIBDL_MSVC_LIB@
10
11libdl.lib:
12 $(MSVCLIB) -def:libdl.def -out:libdl.lib
13
14install-exec:: @EXTRA_INSTALL@
15
16install-msvc-lib:
17 mkdir -p "$(DESTDIR)$(libdir)"
18 @echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libdir)'"
19 $(INSTALL_DATA) libdl.lib "$(DESTDIR)$(libdir)"
diff --git a/acinclude.m4 b/acinclude.m4
index 352fbdd..57a1c98 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -28,6 +28,7 @@
28# - MINGW_AC_MSVC_IMPORT_LIBS: 28# - MINGW_AC_MSVC_IMPORT_LIBS:
29# - Renamed the option to --enable-msvc for compatibility with the old 29# - Renamed the option to --enable-msvc for compatibility with the old
30# configure script. 30# configure script.
31# - Error if shared lib is not enabled.
31# - Cosmetics: 32# - Cosmetics:
32# - Use '' instead of `' 33# - Use '' instead of `'
33 34
@@ -48,7 +49,10 @@ AC_DEFUN([MINGW_AC_MSVC_IMPORT_LIBS],
48 [enable building of MSVC compatible import libraries]),[], 49 [enable building of MSVC compatible import libraries]),[],
49 [enable_msvc=no]) 50 [enable_msvc=no])
50 AC_CHECK_TOOL([MSVCLIB], [lib]) 51 AC_CHECK_TOOL([MSVCLIB], [lib])
51 if test "x$enable_msvc" = xyes && test -n "$MSVCLIB" 52
53 if test "x$enable_msvc" = xyes && test "x$enable_shared" != xyes
54 then AC_MSG_ERROR([MSVC import lib requested but shared lib not enabled.])
55 elif test "x$enable_msvc" = xyes && test -n "$MSVCLIB"
52 then $1="$2" 56 then $1="$2"
53 elif test "x$enable_msvc" = xyes 57 elif test "x$enable_msvc" = xyes
54 then AC_MSG_WARN([no MSVC compatible 'lib' program found in \$PATH 58 then AC_MSG_WARN([no MSVC compatible 'lib' program found in \$PATH
diff --git a/configure.ac b/configure.ac
index c9596bd..60baafd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,8 @@ AC_CANONICAL_BUILD
9AM_INIT_AUTOMAKE([foreign]) 9AM_INIT_AUTOMAKE([foreign])
10LT_INIT 10LT_INIT
11 11
12# Set the flags here to make libtool catch the flags
13CFLAGS='-Wall -O3 -fomit-frame-pointer'
12AC_PROG_CC 14AC_PROG_CC
13 15
14AC_MSG_CHECKING([windows.h and win32 API]) 16AC_MSG_CHECKING([windows.h and win32 API])
@@ -26,6 +28,15 @@ AC_LINK_IFELSE([
26]) 28])
27 29
28MINGW_AC_MSVC_IMPORT_LIBS([LIBDL_MSVC_LIB], [libdl.lib]) 30MINGW_AC_MSVC_IMPORT_LIBS([LIBDL_MSVC_LIB], [libdl.lib])
31AC_SUBST([LIBDL_MSVC_LIB])
32
33test -n "${LIBDL_MSVC_LIB}" && \
34 GEN_DEF="-Wl,--output-def,libdl.def" && \
35 EXTRA_INSTALL="install-msvc-lib"
36AC_SUBST([GEN_DEF])
37AC_SUBST([EXTRA_INSTALL])
38
39test -n
29 40
30AC_CONFIG_FILES(Makefile) 41AC_CONFIG_FILES(Makefile)
31AC_OUTPUT \ No newline at end of file 42AC_OUTPUT \ No newline at end of file
diff --git a/configure2 b/configure2
index ba5fcd7..1ea0e86 100755
--- a/configure2
+++ b/configure2
@@ -232,4 +232,4 @@ if enabled shared; then
232fi 232fi
233echo "wine: $wine $winecmd" 233echo "wine: $wine $winecmd"
234 234
235echo "Run `make -f Makefile2` to build." \ No newline at end of file 235echo "Run \`make -f Makefile2\` to build." \ No newline at end of file