changeset 3651:a5a81f8d6fd7

Update buildsys + small fixes.
author Jonathan Schleifer <js@h3c.de>
date Thu, 27 Sep 2007 13:14:34 +0200
parents 4caed047a58f
children 4505dec6560a
files buildsys.mk.in configure.ac m4/buildsys.m4 src/audacious/Makefile
diffstat 4 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/buildsys.mk.in	Wed Sep 26 06:38:34 2007 +0200
+++ b/buildsys.mk.in	Thu Sep 27 13:14:34 2007 +0200
@@ -35,6 +35,7 @@
 OBJCFLAGS = @OBJCFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
+PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@
 PROG_SUFFIX = @EXEEXT@
 LIB_CPPFLAGS = @LIB_CPPFLAGS@
 LIB_CFLAGS = @LIB_CFLAGS@
@@ -93,7 +94,6 @@
 	if test x"$$regen" = x"1"; then \
 		list=""; \
 		${DEPEND_STATUS}; \
-		rm -f .deps; \
 		for i in ${SRCS}; do \
 			case $${i##*.} in \
 			c|cc|cxx|m) \
@@ -101,10 +101,12 @@
 				;; \
 			esac; \
 		done; \
-		if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \
-			${DEPEND_OK}; \
-		else \
-			${DEPEND_FAILED}; \
+		if test x"$$list" != "x"; then \
+			if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \
+				${DEPEND_OK}; \
+			else \
+				${DEPEND_FAILED}; \
+			fi; \
 		fi; \
 	fi
 
@@ -367,7 +369,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	Wed Sep 26 06:38:34 2007 +0200
+++ b/configure.ac	Thu Sep 27 13:14:34 2007 +0200
@@ -154,6 +154,7 @@
 dnl ========================
 
 dnl Ok, first we find out what flags we need to use.
+BUILDSYS_PROG_IMPLIB
 BUILDSYS_SHARED_LIB
 
 dnl XXX
@@ -426,7 +427,7 @@
 
 # Use -rpath?
 AC_ARG_ENABLE(rpath,
-	      [  --enable-rpath	   enable use of -rpath on ELF systems (default=yes)], [enable_rpath=$enableval], [enable_rpath=no])
+	      [  --enable-rpath	   enable use of -rpath on ELF systems (default=no)], [enable_rpath=$enableval], [enable_rpath=no])
 if test "x$enable_rpath" = "xyes"; then
 	test x"`$CC -dM -E - </dev/null | grep __ELF__`" != x"" && LDFLAGS="$LDFLAGS -Wl,-rpath $libdir"
 fi
--- a/m4/buildsys.m4	Wed Sep 26 06:38:34 2007 +0200
+++ b/m4/buildsys.m4	Thu Sep 27 13:14:34 2007 +0200
@@ -18,6 +18,22 @@
 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_LDFLAGS='-Wl,--out-implib,${PROG}.a'
+			;;
+		*)
+			AC_MSG_RESULT(no)
+			PROG_IMPLIB_LDFLAGS=''
+			;;
+	esac
+	
+	AC_SUBST(PROG_IMPLIB_LDFLAGS)
+])
+
 AC_DEFUN([BUILDSYS_SHARED_LIB], [
 	AC_MSG_CHECKING(for shared library system)
 	case "$target" in
--- a/src/audacious/Makefile	Wed Sep 26 06:38:34 2007 +0200
+++ b/src/audacious/Makefile	Thu Sep 27 13:14:34 2007 +0200
@@ -192,6 +192,8 @@
 	${LIBGLADE_LIBS}	\
 	${REGEX_LIBS}
 
+LDFLAGS += ${PROG_IMPLIB_LDFLAGS}
+
 build_stamp.c: 
 	if [ -d ../../.hg ]; then \
 		revh=`hg tip --template 'const char *svn_stamp = "#rev#:#node|short#";\n' 2>/dev/null`; \