Skip to content

Commit

Permalink
Support MSYS2/mingw-w64
Browse files Browse the repository at this point in the history
  • Loading branch information
mingwandroid committed Dec 2, 2020
1 parent b871c72 commit d09679a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CC_C99
LT_INIT([disable-static])
LT_INIT([disable-static win32-dll])


AC_CONFIG_HEADERS([include/config.h])
Expand All @@ -38,6 +38,10 @@ case $host_os in
AC_MSG_RESULT([Darwin/OSX])
have_darwin=yes
;;
*mingw*)
AC_MSG_RESULT([MinGW-w64])
have_mingw=yes
;;
*)
AC_MSG_RESULT([ $host_os ? ... let us try])
;;
Expand Down Expand Up @@ -80,6 +84,8 @@ if test x$have_cpuflags = xyes; then
fi
fi

AM_CONDITIONAL([HAVE_MINGW], [test x$have_mingw = xyes])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h inttypes.h limits.h stdlib.h string.h])
Expand Down
12 changes: 9 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,29 @@ xfade0r_la_SOURCES = mixer2/xfade0r/xfade0r.cpp
AM_CPPFLAGS = -I@top_srcdir@/include -Waddress -Wtype-limits -Wsign-compare
AM_CFLAGS = -I@top_srcdir@/include -Waddress -Wtype-limits -Wsign-compare
AM_CXXFLAGS = -I@top_srcdir@/include -Waddress -Wtype-limits -Wsign-compare
AM_LDFLAGS = -module -avoid-version -lm -export-dynamic
AM_LIBTOOLFLAGS = --tag=disable-static

plugindir = @libdir@/frei0r-1

if HAVE_MINGW
SO_EXT = .dll
AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined
else
SO_EXT = .so
AM_LDFLAGS = -module -avoid-version -lm -export-dynamic
endif

install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
mkdir -p $(DESTDIR)/$(plugindir)
list='$(plugin_LTLIBRARIES)'; \
for file in $$list; do \
sofile=`basename $$file .la`.so; \
sofile=`basename $$file .la`$(SO_EXT); \
$(INSTALL_PROGRAM) .libs/$$sofile $(DESTDIR)/$(plugindir); \
done

uninstall-pluginLTLIBRARIES:
list='$(plugin_LTLIBRARIES)'; \
for file in $$list; do \
sofile=`basename $$file .la`.so; \
sofile=`basename $$file .la`$(SO_EXT); \
rm -f $(DESTDIR)/$(plugindir)/$$sofile; \
done

0 comments on commit d09679a

Please # to comment.