[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1585
Date       : Fri Jul 28 17:19:42 BST 2006

Changed paths:
   M /Trunk/XaraLX/Makefile.am
   M /Trunk/XaraLX/configure.in
   M /Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp
   M /Trunk/XaraLX/xarlib/Makefile.am

More work on xarlib makefile


Diff:
Index: Trunk/XaraLX/xarlib/Makefile.am
===================================================================
--- Trunk/XaraLX/xarlib/Makefile.am	(revision 1584)
+++ Trunk/XaraLX/xarlib/Makefile.am	(revision 1585)
@@ -6,11 +6,13 @@
 #noinst_LIBRARIES	= libXar.a
 lib_LTLIBRARIES = libXar.la
 
+# have to use the -I flags to point at the three directories concerned as I
+# can't get this file to compile pretranslated source files.
 XARLIBFLAGS = \
 	-DUSE_NATIVE_XLONG -DBUILDSHADOWS -DOLD_MATRIX_TRANSFORMATIONS \
 	-DVECTOR_STROKING -DEXCLUDE_FROM_XARLIB -DNEW_SHADOW_RENDER -DNO_XARACMS \
 	-DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT \
-	-I$(TOPDIR)/xarlib -I$(TOPDIR)/PreComp -I$(TOPDIR)/Kernel -I$(TOPDIR)/wxOil -I$(TOPDIR)/GDraw 
+	-Iinclude -I$(TOPDIR)/PreComp -I$(TOPDIR)/Kernel -I$(TOPDIR)/wxOil -I$(TOPDIR)/GDraw
 
 # make sure this does NOT have our include files in the path
 # xarlib needs to be first
@@ -19,7 +21,8 @@
 #Extra libraries
 #libXar_la_LDFLAGS = @GTK_LIBS@
 
-libXar_la_SOURCES = \
+# Ensure these all begin with "../<directory>/" even if in the current directory
+XARLIBCPP = \
 	../Kernel/ccfile.cpp \
 	../Kernel/ccmaths.cpp \
 	../Kernel/ccpanose.cpp \
@@ -67,11 +70,12 @@
 	../wxOil/cammemory.cpp \
 	../wxOil/pathname.cpp \
 	../wxOil/unicdman.cpp \
-	camelot.cpp \
-	ensure.cpp \
-	xarlib.cpp
+	../xarlib/camelot.cpp \
+	../xarlib/ensure.cpp \
+	../xarlib/xarlib.cpp
 
-pkginclude_HEADERS = \
+# Ensure these all begin with "../<directory>/" even if in the current directory
+XARLIBHEADERS = \
 	../PreComp/camtypes.h \
 	../wxOil/basestr.h \
 	../wxOil/camresource.h \
@@ -135,17 +139,53 @@
 	../Kernel/zlib.h \
 	../Kernel/zstream.h \
 	../Kernel/zutil.h \
-	camelot.h \
-	ensure.h \
-	xarlib.h
+	../xarlib/camelot.h \
+	../xarlib/ensure.h \
+	../xarlib/xarlib.h
 
+INSTHEADERS = $(addprefix include/xarlib/, $(notdir $(XARLIBHEADERS)) )
+INSTCPP = $(notdir $(XARLIBCPP) )
+
+libXar_la_SOURCES = $(XARLIBCPP) $(INSTHEADERS)
+
+pkginclude_HEADERS = $(INSTHEADERS)
+
+BUILT_SOURCES = $(INSTHEADERS)
+#BUILT_SOURCES = $(INSTHEADERS) $(INSTCPP)
+
+MOSTLYCLEANFILES = $(INSTHEADERS)
+#MOSTLYCLEANFILES = $(INSTHEADERS) $(INSTCPP)
+
+# Insert an additional dependency to get the headers and cpp files built
+noinst_DATA = $(INSTHEADERS)
+#noinst_DATA = $(INSTHEADERS) $(INSTCPP)
+
+# Generate a directory of includes which has "xarlib/" in the include path
+$(INSTHEADERS) : $(XARLIBHEADERS)
+	@mkdir -p include/xarlib && \
+	echo $(libXar_la_SOURCES) > /tmp/bar && \
+	j=xarlib/$(filter %/$(notdir $@), $(XARLIBHEADERS) ) && \
+	echo "Building xarlib header $@ from $(TOPDIR)/$$j" && \
+	perl -pe 's,^[ 	]*#include[ 	]+\",#include \"xarlib/,' <$(TOPDIR)/$$j >$@ 
+
+# Generate a directory of includes which has "xarlib/" in the include path
+# We have to muck around with the prefixes here to avoid partial matches (coord.cpp matching doccoord.cpp etc.)
+$(INSTCPP) : $(XARLIBCPP)
+	@echo $(INSTCPP) > /tmp/foo && \
+	j=$(filter %/$(notdir $@), $(addprefix xarlib/, $(XARLIBCPP)) ) && \
+	echo "Building xarlib CPP file $@ from $(TOPDIR)/$$j" && \
+	ls -la $(TOPDIR)/$$j && \
+	#perl -pe 's,^[ 	]*#include[ 	]+\",#include \"xarlib/,' <$(TOPDIR)/$$j >$@ 
+
+# Only build the static library until we have an API/ABI nailed down
+libXar_la_LDFLAGS = -static
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = Xar.pc
+
 bin_PROGRAMS = expandxar
 expandxar_SOURCES = ExpandXar/expandxar.cpp
 expandxar_LDADD = libXar.la $(WX_LIBS)
+#expandxar_LDFLAGS = -all-static
+expandxar_LDFLAGS = -static
 expandxar_CXXFLAGS = $(XARLIBFLAGS)
-
-pkgconfigdir = $(libdir)/pkgconfig
-#if FALSE
-pkgconfig_DATA = Xar.pc
-#endif
-
Index: Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp
===================================================================
--- Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp	(revision 1584)
+++ Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp	(revision 1585)
@@ -1,8 +1,8 @@
 // ExpandXar.cpp : A console application for uncompressing and fixing Xar format files.
 //
-
+
 #include <iostream>
-#include "xarlib.h"
+#include "xarlib/xarlib.h"
 
 /****************************************************************************
 
@@ -277,43 +277,43 @@
 		wxFprintf(stderr, _T("Usage : ExpandXar <input file> <output file>
"));
 		return 1;
 	}
-
-#if wxUSE_UNICODE
-	wxChar **wxArgv = new wxChar *[argc + 1];
-	
-	{
-		int n;
-
-		for (n = 0; n < argc; n++ )
-		{
-			wxMB2WXbuf warg = wxConvertMB2WX(argv[n]);
-			wxArgv[n] = wxStrdup(warg);
-		}
-
-		wxArgv[n] = NULL;
-	}
-#else // !wxUSE_UNICODE
-	#define wxArgv argv
-#endif // wxUSE_UNICODE/!wxUSE_UNICODE
-
-	int RetVal = 0;
 
+#if wxUSE_UNICODE
+	wxChar **wxArgv = new wxChar *[argc + 1];
+	
+	{
+		int n;
+
+		for (n = 0; n < argc; n++ )
+		{
+			wxMB2WXbuf warg = wxConvertMB2WX(argv[n]);
+			wxArgv[n] = wxStrdup(warg);
+		}
+
+		wxArgv[n] = NULL;
+	}
+#else // !wxUSE_UNICODE
+	#define wxArgv argv
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+
+	int RetVal = 0;
+
 	if (!ProcessFile(wxArgv[1], wxArgv[2]))
 	{
 		RetVal = 1;
 	}
-
-#if wxUSE_UNICODE
-	{
-		for ( int n = 0; n < argc; n++ )
-			free(wxArgv[n]);
-
-		delete [] wxArgv;
-	}
-#endif // wxUSE_UNICODE
-
-	wxUnusedVar(argc);
-	wxUnusedVar(argv);
+
+#if wxUSE_UNICODE
+	{
+		for ( int n = 0; n < argc; n++ )
+			free(wxArgv[n]);
+
+		delete [] wxArgv;
+	}
+#endif // wxUSE_UNICODE
+
+	wxUnusedVar(argc);
+	wxUnusedVar(argv);
 	
 	return RetVal;
 }
Index: Trunk/XaraLX/configure.in
===================================================================
--- Trunk/XaraLX/configure.in	(revision 1584)
+++ Trunk/XaraLX/configure.in	(revision 1585)
@@ -120,6 +120,9 @@
 # Stop automake directly including stuff
 XRCINCLUDE=include
 
+# Disable generation of shared libtool libraries - that's libXar. Note this has NOTHING to
+# do with static-exec (the executables)
+AC_DISABLE_SHARED
 # We don't need dlopen right now and it's not supported on Darwin
 # AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
Index: Trunk/XaraLX/Makefile.am
===================================================================
--- Trunk/XaraLX/Makefile.am	(revision 1584)
+++ Trunk/XaraLX/Makefile.am	(revision 1585)
@@ -5,19 +5,22 @@
 	-DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT
 export TOPDIR
 
-PRECOMPILE_DIR =
 if PRECOMPILE_ENABLE
-	PRECOMPILE_DIR = PreComp
+     PRECOMPILE_DIR = PreComp
+else
+     PRECOMPILE_DIR =
 endif
 
-XARLIB_DIR =
 if XARLIB_ENABLE
-	XARLIB_DIR = xarlib
+     XARLIB_DIR = xarlib
+else
+     XARLIB_DIR =
 endif
 
-FILTERS_DIRS =
 if FILTERS_ENABLE
-	FILTERS_DIRS = filters/SVGFilter
+     FILTERS_DIRS = filters/SVGFilter
+else
+     FILTERS_DIRS =
 endif
 
 # Do not compile po directory if WXRC is broken (gentoo wxWidgets 2.6.3.2)


Xara