changeset 3656:db04d0916c22

implib for ${PROG} should finally work.
author Jonathan Schleifer <js@h3c.de>
date Thu, 27 Sep 2007 21:25:58 +0200
parents 047829635612
children e83412963c51
files buildsys.mk.in configure.ac m4/buildsys.m4 src/audacious/Makefile
diffstat 4 files changed, 47 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/buildsys.mk.in	Thu Sep 27 23:27:30 2007 +0900
+++ b/buildsys.mk.in	Thu Sep 27 21:25:58 2007 +0200
@@ -35,6 +35,8 @@
 OBJCFLAGS = @OBJCFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
+PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@
+PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@
 PROG_SUFFIX = @EXEEXT@
 LIB_CPPFLAGS = @LIB_CPPFLAGS@
 LIB_CFLAGS = @LIB_CFLAGS@
@@ -368,7 +370,7 @@
 		${DIR_LEAVE}; \
 	done
 	
-	for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \
+	for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST}  ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \
 		if test -f $$i -o -d $$i; then \
 			if rm -fr $$i; then \
 				${DELETE_OK}; \
--- a/configure.ac	Thu Sep 27 23:27:30 2007 +0900
+++ b/configure.ac	Thu Sep 27 21:25:58 2007 +0200
@@ -155,6 +155,7 @@
 dnl ========================
 
 dnl Ok, first we find out what flags we need to use.
+BUILDSYS_PROG_IMPLIB
 BUILDSYS_SHARED_LIB
 
 dnl XXX
--- a/m4/buildsys.m4	Thu Sep 27 23:27:30 2007 +0900
+++ b/m4/buildsys.m4	Thu Sep 27 21:25:58 2007 +0200
@@ -18,6 +18,25 @@
 dnl POSSIBILITY OF SUCH DAMAGE.
 dnl
 
+AC_DEFUN([BUILDSYS_PROG_IMPLIB], [
+	AC_MSG_CHECKING(wether we need an implib)
+	case "$target" in
+		*-*-cygwin | *-*-mingw32)
+			AC_MSG_RESULT(yes)
+			PROG_IMPLIB_NEEDED=1
+			PROG_IMPLIB_LDFLAGS='-Wl,-export-all-symbols,--out-implib,lib${PROG}.a'
+			;;
+		*)
+			AC_MSG_RESULT(no)
+			PROG_IMPLIB_NEEDED=0
+			PROG_IMPLIB_LDFLAGS=''
+			;;
+	esac
+	
+	AC_SUBST(PROG_IMPLIB_NEEDED)
+	AC_SUBST(PROG_IMPLIB_LDFLAGS)
+])
+
 AC_DEFUN([BUILDSYS_SHARED_LIB], [
 	AC_MSG_CHECKING(for shared library system)
 	case "$target" in
--- a/src/audacious/Makefile	Thu Sep 27 23:27:30 2007 +0900
+++ b/src/audacious/Makefile	Thu Sep 27 21:25:58 2007 +0200
@@ -153,14 +153,11 @@
        ui/playlist.ui				\
        ui/carbon-menubar.ui
 
-CLEAN = build_stamp.c
-EXT_DEPS += ../libguess/libguess.a
+CLEAN = build_stamp.c libaudacious.exe.a
+EXT_DEPS = ../libguess/libguess.a
 
 include ../../buildsys.mk
 
-LDFLAGS += ${EXPORTDYN}
-LIBS += ${LDADD}
-
 ifdef USE_DBUS
 CPPFLAGS += -I../libaudclient
 DBUS_BINDINGS = dbus-server-bindings.h dbus-client-bindings.h
@@ -183,7 +180,8 @@
 	    -I.. -I../..		\
 	    -I./intl
 
-LIBS += ${LIBINTL}		\
+LIBS += ${LDADD}		\
+	${LIBINTL}		\
 	${samplerate_LIBS}	\
 	../libguess/libguess.a	\
 	${GTK_LIBS}		\
@@ -193,7 +191,7 @@
 	${LIBGLADE_LIBS}	\
 	${REGEX_LIBS}
 
-LDFLAGS += ${PROG_IMPLIB_LDFLAGS}
+LDFLAGS += ${EXPORTDYN} ${PROG_IMPLIB_LDFLAGS}
 
 build_stamp.c: 
 	if [ -d ../../.hg ]; then \
@@ -218,4 +216,22 @@
 dbus-client-bindings.h: ${DBUS_BINDINGS_SOURCES}
 	${DBUS_BINDING_TOOL} --mode=glib-client --prefix=audacious_rc objects.xml > $@
 
-OBJECTIVE_DATA = audacious.desktop:${datadir}/applications
+install-extra:
+	for i in audacious.desktop; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${libdir} && install -m 644 $$i ${DESTDIR}${datadir}/applications/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+	if test x"${PROG_NEED_IMPLIB}" = x"1"; then \
+		for i in ${LIB}; do \
+			${INSTALL_STATUS}; \
+			if ${MKDIR_P} ${DESTDIR}${libdir} && install -m 644 $$i ${DESTDIR}${libdir}/$$i; then \
+				${INSTALL_OK}; \
+			else \
+				${INSTALL_FAILED}; \
+			fi \
+		done \
+	fi