File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,7 +176,15 @@ install(FILES
176176 ${CMAKE_INSTALL_INCLUDEDIR} /libmodplug
177177)
178178
179- if (NOT WIN32 )
179+ if (NOT MSVC )
180+ if (MINGW OR CYGWIN )
181+ set (LIBS_PRIVATE "-luser32 -lstdc++" )
182+ else ()
183+ set (LIBS_PRIVATE "-lstdc++" )
184+ if (MATH_LIB)
185+ set (LIBS_PRIVATE "${LIBS_PRIVATE} -lm" )
186+ endif ()
187+ endif ()
180188 set (prefix ${CMAKE_INSTALL_PREFIX } )
181189 set (exec_prefix ${CMAKE_INSTALL_PREFIX } )
182190 set (libdir ${CMAKE_INSTALL_PREFIX } /${CMAKE_INSTALL_LIBDIR} )
@@ -187,4 +195,4 @@ if (NOT WIN32)
187195 install (FILES "${PROJECT_BINARY_DIR } /libmodplug.pc"
188196 DESTINATION ${CMAKE_INSTALL_LIBDIR} /pkgconfig
189197 )
190- endif (NOT WIN32 )
198+ endif ()
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ LT_INIT([win32-dll])
2929
3030AC_HEADER_STDC
3131AC_CHECK_HEADERS ( [ inttypes.h stdint.h malloc.h] )
32- AC_CHECK_FUNCS ( sinf )
3332
3433CXXFLAGS="$CXXFLAGS -fno-exceptions -Wall -ffast-math -fno-common -D_REENTRANT"
3534
@@ -44,6 +43,30 @@ case "$host" in
4443esac
4544AC_SUBST ( LT_LDFLAGS )
4645
46+ LIBS_PRIVATE=-lstdc++
47+ LIBM=
48+ case "${host_os}" in
49+ dnl Djgpp has all c89 math funcs in libc.a
50+ *djgpp)
51+ ;;
52+ dnl These systems don't have libm or don't need it (list based on libtool)
53+ darwin*|haiku*|beos*|cegcc*|pw32*)
54+ ;;
55+ dnl MinGW and Cygwin don't need libm, either
56+ mingw*|cygwin*)
57+ LIBS_PRIVATE="-luser32 ${LIBS_PRIVATE}"
58+ ;;
59+ dnl All others:
60+ *) AC_CHECK_LIB ( m , pow , LIBM="-lm" )
61+ if test x$LIBM != x; then
62+ LIBS="${LIBS} ${LIBM}"
63+ LIBS_PRIVATE="${LIBS_PRIVATE} ${LIBM}"
64+ fi
65+ ;;
66+ esac
67+ AC_SUBST ( LIBS_PRIVATE )
68+ AC_CHECK_FUNCS ( sinf )
69+
4770# symbol visibility
4871ac_save_CXXFLAGS="$CXXFLAGS"
4972CXXFLAGS="$CXXFLAGS -fvisibility=hidden -Werror"
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ Name: libmodplug
77Description : The ModPlug mod file playing library.
88Version : @VERSION@
99Requires :
10- Libs : -L ${ libdir} -l modplug
11- Libs.private : -l stdc++ -l m
10+ Libs : -L ${ libdir} -l modplug
11+ Libs.private : @LIBS_PRIVATE@
1212Cflags : -I ${ includedir}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/libmodplug
66
77lib_LTLIBRARIES = libmodplug.la
88libmodplug_la_LDFLAGS = -version-info $(MODPLUG_LIBRARY_VERSION ) $(LT_LDFLAGS )
9- libmodplug_la_LIBADD = -lm
109libmodplug_la_SOURCES = tables.h \
1110 sndmix.cpp \
1211 sndfile.cpp \
You can’t perform that action at this time.
0 commit comments