diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2017-12-20 18:45:43 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2017-12-20 18:45:43 +0100 |
commit | 0951e9a056dc791cd7a46014f1178b153829c48a (patch) | |
tree | af236deff67e8dd92e39794b914186acce8c481b | |
parent | 3c53dbf634c8647c6d66aec50e06a26098e4c657 (diff) |
ptunnel-ng:
* autoconf mingw dlltool check
* build import library and link ptunnel-ng.exe against it
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | src/Makefile.am | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index c89069b..4533baf 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,10 @@ if test x"${use_msw}" != x"yes"; then AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock syslog getaddrinfo freeaddrinfo gai_strerror],, [AC_MSG_ERROR([Missing essential Linux std functions.])]) else + AC_CHECK_TOOL([DLLTOOL], [dlltool], [:]) + if test x"${DLLTOOL}" = x":"; then + AC_MSG_ERROR([Missing dlltool which is required to build the import library!]) + fi AC_CHECK_HEADERS([winsock2.h windows.h ws2tcpip.h],, [AC_MSG_ERROR([Missing essential Windows std headers.])]) AC_CHECK_LIB([ws2_32],[main]) @@ -146,6 +150,7 @@ fi dnl Set automake conf vars AM_CONDITIONAL([HAVE_PCAP], [test x"${pcap_enabled}" = xyes]) AM_CONDITIONAL([HAVE_SELINUX], [test x"${selinux_enabled}" = xyes]) +AM_CONDITIONAL([IS_WINDOWS], [test x"${use_msw}" = xyes]) dnl output config headers AC_CONFIG_HEADERS([src/config.h:src/config.h.in]) diff --git a/src/Makefile.am b/src/Makefile.am index 8aaa52a..6ded388 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,9 +3,13 @@ man8_MANS = ptunnel-ng.8 ptunnel_ng_CFLAGS = -Wall ptunnel_ng_LDADD = +CLEANFILES = +EXTTRA_DIST = + if HAVE_PCAP ptunnel_ng_CFLAGS += -DHAVE_PCAP=1 endif + if HAVE_SELINUX ptunnel_ng_CFLAGS += -DHAVE_SELINUX=1 endif @@ -18,3 +22,17 @@ ptunnel_ng_SOURCES = \ pkt.c \ pdesc.c \ ptunnel.c + +if IS_WINDOWS +wpcap_DEF = $(abs_srcdir)/win32/WPCAP.DEF +wpcap_IMP = $(abs_srcdir)/win32/libwpcap_implib.a +ptunnel_ng_CFLAGS += -I$(abs_srcdir)/win32/includes -DHAVE_PCAP=1 +ptunnel_ng_LDADD += $(wpcap_IMP) +ptunnel_ng_SOURCES += $(wpcap_DEF) + +$(wpcap_IMP): + @DLLTOOL@ -k -l $(wpcap_IMP) --def $(wpcap_DEF) + +CLEANFILES += $(wpcap_IMP) +EXTTRA_DIST += $(wpcap_DEF) +endif |