aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-09-13 17:01:43 -0700
committerTimothy Gu <timothygu99@gmail.com>2014-09-13 17:03:07 -0700
commit2d6c00722652589b6c2532d9e9a43417d29612c1 (patch)
tree04bd767f7fb6de394a21d60d5d487ac41b5af2a3
parentcf56306383935c6123f1ab70fcb73c850e301819 (diff)
downloaddlfcn-win32-2d6c00722652589b6c2532d9e9a43417d29612c1.tar.gz
dlfcn-win32-2d6c00722652589b6c2532d9e9a43417d29612c1.tar.bz2
dlfcn-win32-2d6c00722652589b6c2532d9e9a43417d29612c1.zip
Add autotools build system
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
-rw-r--r--.gitignore59
-rw-r--r--Makefile.am6
-rw-r--r--Makefile2 (renamed from Makefile)0
-rw-r--r--acinclude.m468
-rw-r--r--configure.ac31
-rwxr-xr-xconfigure2 (renamed from configure)4
6 files changed, 167 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..08504f2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,59 @@
1# Object files
2*.o
3*.ko
4*.obj
5*.elf
6
7# Precompiled Headers
8*.gch
9*.pch
10
11# Libraries
12*.lib
13*.a
14*.la
15*.lo
16
17# Shared objects (inc. Windows DLLs)
18*.dll
19*.so
20*.so.*
21*.dylib
22
23# Executables
24*.exe
25*.out
26*.app
27*.i*86
28*.x86_64
29*.hex
30
31# Deps & libs
32.deps
33.libs
34
35# http://www.gnu.org/software/automake
36
37Makefile.in
38
39# http://www.gnu.org/software/autoconf
40
41/m4
42/autom4te.cache
43/aclocal.m4
44/compile
45/config.guess
46/config.sub
47/configure
48/depcomp
49/install-sh
50/missing
51/stamp-h1
52
53# configure-generated
54
55Makefile
56/config.log
57/config.status
58/libtool
59/ltmain.sh \ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..1c8ce13
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,6 @@
1ACLOCAL_AMFLAGS = -I m4
2
3lib_LTLIBRARIES = libdl.la
4libdl_la_SOURCES = dlfcn.c
5libdl_la_LDFLAGS = -no-undefined
6include_HEADERS = dlfcn.h \ No newline at end of file
diff --git a/Makefile b/Makefile2
index 4d11de8..4d11de8 100644
--- a/Makefile
+++ b/Makefile2
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..352fbdd
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,68 @@
1# MSVC-compatibe import lib generation recipe
2#
3# Copyright (C) 2007, MinGW Project
4# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
5#
6#
7# This is free software. It is provided AS IS, in the hope that it may
8# be useful, but WITHOUT WARRANTY OF ANY KIND, not even an IMPLIED WARRANTY
9# of MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE.
10#
11# Permission is granted to redistribute this software, either "as is" or
12# in modified form, under the terms of the GNU Lesser General Public License,
13# as published by the Free Software Foundation; either version 2.1, or (at
14# your option) any later version.
15#
16# You should have received a copy of the GNU Lesser General Public License
17# along with this software; see the file COPYING. If not, write to the
18# Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,
19# MA 02110-1301, USA.
20
21# Copied from http://sourceforge.net/p/mingw/regex/ci/e7b1d8be1cd5dcf0c654228c2af30fd769cac61d/tree/aclocal.m4
22#
23# Modifications:
24# - License header:
25# - Short description of file added
26# - Changed 'see the file COPYING.lib' to 'see the file COPYING'
27# - Removed all macros besides MINGW_AC_MSVC_IMPORT_LIBS
28# - MINGW_AC_MSVC_IMPORT_LIBS:
29# - Renamed the option to --enable-msvc for compatibility with the old
30# configure script.
31# - Cosmetics:
32# - Use '' instead of `'
33
34# MINGW_AC_MSVC_IMPORT_LIBS( VARNAME, TARGET )
35# --------------------------------------------
36# Check for the availability of the MSVC 'lib' program.
37# If it is found in $PATH, and the user has requested '--enable-msvc',
38# then set the AC_SUBST variable VARNAME to TARGET, otherwise set VARNAME to
39# the null string.
40#
41# If the user has requested '--enable-msvc', but MSVC 'lib' cannot be
42# found, then 'configure' will print a warning; this will be suppressed, if
43# '--enable-msvc' has not been requested.
44#
45AC_DEFUN([MINGW_AC_MSVC_IMPORT_LIBS],
46[AC_ARG_ENABLE([msvc],
47 AS_HELP_STRING([--enable-msvc],
48 [enable building of MSVC compatible import libraries]),[],
49 [enable_msvc=no])
50 AC_CHECK_TOOL([MSVCLIB], [lib])
51 if test "x$enable_msvc" = xyes && test -n "$MSVCLIB"
52 then $1="$2"
53 elif test "x$enable_msvc" = xyes
54 then AC_MSG_WARN([no MSVC compatible 'lib' program found in \$PATH
55
56 The MSVC 'lib' program is required to build MSVC compatible import libs.
57 Since this program does not appear to be installed on this computer, MSVC
58 compatible import libs will not be built; configuration will continue, but
59 only MinGW format import libs will be included in the resultant build.
60
61 If you wish to build a development kit which does include import libs for
62 MSVC, in addition to those for MinGW, you should ensure that MSVC has been
63 installed on this computer, and that \$PATH includes the directory in which
64 its 'lib' program is located, then run 'configure' again.
65 ])
66 fi
67 AC_SUBST([$1])dnl
68])# MINGW_AC_MSVC_IMPORT_LIBS
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..c9596bd
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,31 @@
1AC_PREREQ(2.59)
2
3AC_INIT([dlfcn-win32], [1.0.0.99], [timothygu99@gmail.com])
4
5AC_CONFIG_MACRO_DIR([m4])
6
7AC_CANONICAL_BUILD
8
9AM_INIT_AUTOMAKE([foreign])
10LT_INIT
11
12AC_PROG_CC
13
14AC_MSG_CHECKING([windows.h and win32 API])
15AC_LINK_IFELSE([
16 AC_LANG_PROGRAM([[
17 #include <windows.h>
18 ]], [[
19 LoadLibrary(NULL);
20 ]])
21], [
22 AC_MSG_RESULT([yes])
23], [
24 AC_MSG_RESULT([no])
25 AC_MSG_ERROR([C compiler is not able to link standard win32 program.])
26])
27
28MINGW_AC_MSVC_IMPORT_LIBS([LIBDL_MSVC_LIB], [libdl.lib])
29
30AC_CONFIG_FILES(Makefile)
31AC_OUTPUT \ No newline at end of file
diff --git a/configure b/configure2
index 91f7d07..ba5fcd7 100755
--- a/configure
+++ b/configure2
@@ -203,7 +203,7 @@ fi
203 203
204enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib" 204enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib"
205 205
206echo "# Automatically generated by configure" > config.mak 206echo "# Automatically generated by configure2" > config.mak
207echo "prefix=$prefix" >> config.mak 207echo "prefix=$prefix" >> config.mak
208echo "libdir=$libdir" >> config.mak 208echo "libdir=$libdir" >> config.mak
209echo "incdir=$incdir" >> config.mak 209echo "incdir=$incdir" >> config.mak
@@ -231,3 +231,5 @@ if enabled shared; then
231 echo "strip: $stripping"; 231 echo "strip: $stripping";
232fi 232fi
233echo "wine: $wine $winecmd" 233echo "wine: $wine $winecmd"
234
235echo "Run `make -f Makefile2` to build." \ No newline at end of file