diff options
author | Timothy Gu <timothygu99@gmail.com> | 2014-09-13 17:01:43 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2014-09-13 17:03:07 -0700 |
commit | 2d6c00722652589b6c2532d9e9a43417d29612c1 (patch) | |
tree | 04bd767f7fb6de394a21d60d5d487ac41b5af2a3 | |
parent | cf56306383935c6123f1ab70fcb73c850e301819 (diff) | |
download | dlfcn-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-- | .gitignore | 59 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | Makefile2 (renamed from Makefile) | 0 | ||||
-rw-r--r-- | acinclude.m4 | 68 | ||||
-rw-r--r-- | configure.ac | 31 | ||||
-rwxr-xr-x | configure2 (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 | |||
37 | Makefile.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 | |||
55 | Makefile | ||
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 @@ | |||
1 | ACLOCAL_AMFLAGS = -I m4 | ||
2 | |||
3 | lib_LTLIBRARIES = libdl.la | ||
4 | libdl_la_SOURCES = dlfcn.c | ||
5 | libdl_la_LDFLAGS = -no-undefined | ||
6 | include_HEADERS = dlfcn.h \ No newline at end of file | ||
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 | # | ||
45 | AC_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 @@ | |||
1 | AC_PREREQ(2.59) | ||
2 | |||
3 | AC_INIT([dlfcn-win32], [1.0.0.99], [timothygu99@gmail.com]) | ||
4 | |||
5 | AC_CONFIG_MACRO_DIR([m4]) | ||
6 | |||
7 | AC_CANONICAL_BUILD | ||
8 | |||
9 | AM_INIT_AUTOMAKE([foreign]) | ||
10 | LT_INIT | ||
11 | |||
12 | AC_PROG_CC | ||
13 | |||
14 | AC_MSG_CHECKING([windows.h and win32 API]) | ||
15 | AC_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 | |||
28 | MINGW_AC_MSVC_IMPORT_LIBS([LIBDL_MSVC_LIB], [libdl.lib]) | ||
29 | |||
30 | AC_CONFIG_FILES(Makefile) | ||
31 | AC_OUTPUT \ No newline at end of file | ||
@@ -203,7 +203,7 @@ fi | |||
203 | 203 | ||
204 | enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib" | 204 | enabled msvc && libcmd="lib" || libcmd="@echo ignoring lib" |
205 | 205 | ||
206 | echo "# Automatically generated by configure" > config.mak | 206 | echo "# Automatically generated by configure2" > config.mak |
207 | echo "prefix=$prefix" >> config.mak | 207 | echo "prefix=$prefix" >> config.mak |
208 | echo "libdir=$libdir" >> config.mak | 208 | echo "libdir=$libdir" >> config.mak |
209 | echo "incdir=$incdir" >> config.mak | 209 | echo "incdir=$incdir" >> config.mak |
@@ -231,3 +231,5 @@ if enabled shared; then | |||
231 | echo "strip: $stripping"; | 231 | echo "strip: $stripping"; |
232 | fi | 232 | fi |
233 | echo "wine: $wine $winecmd" | 233 | echo "wine: $wine $winecmd" |
234 | |||
235 | echo "Run `make -f Makefile2` to build." \ No newline at end of file | ||