Added libt2n-gccxml.sh wrapper script to filter new, unknown gccxml -pthread option
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 6 Aug 2009 08:42:09 +0000 (10:42 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 6 Aug 2009 08:42:09 +0000 (10:42 +0200)
Makefile.am
examples-codegen/example1/Makefile.am
examples-codegen/example1/codegen.make
examples-codegen/example2/Makefile.am
examples-codegen/example2/codegen.make
examples/Makefile.am
libt2n-gccxml.sh [new file with mode: 0755]
libt2n.spec.in

index b3b5391..cd5d05e 100644 (file)
@@ -17,4 +17,6 @@ endif
 m4datadir = $(datadir)/aclocal
 m4data_DATA = libt2n.m4
 
-EXTRA_DIST = AUTHORS ChangeLog LICENSE COPYING.GPL $(m4data_DATA) test-build-install-use
+bin_SCRIPTS = libt2n-gccxml.sh
+
+EXTRA_DIST = AUTHORS ChangeLog LICENSE COPYING.GPL $(m4data_DATA) test-build-install-use libt2n-gccxml.sh
index 32dc2fe..59614ae 100644 (file)
@@ -29,5 +29,9 @@ libt2n_example1_server_SOURCES = \
        server.cpp $(t2nexample_GROUP) \
        t2nexample_server.cpp
 
+# Make libt2n-gccxml.sh available
+# as libt2n is not installed yet
+PATH := $(top_srcdir):$(PATH)
+
 # include Makefile snippet doing all the magic
 include codegen.make
index 6d7f069..76e3f93 100644 (file)
@@ -22,7 +22,7 @@ libt2ngroup_%.P : Makefile.am
        echo '#include "$*.hxx"' >> $*_common.hxx;
 # todo use tmp file for xml file
        for i in $($*_GROUP); do \
-               gccxml $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
+               libt2n-gccxml.sh $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
        done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && for i in $($*_GROUP); do \
                rm $${i%*.cpp}.xml; \
        done && touch $@
index 3ad765b..44752ac 100644 (file)
@@ -56,6 +56,10 @@ TESTS = test
 
 EXTRA_DIST = $(TESTS)
 
+# Make libt2n-gccxml.sh available
+# as libt2n is not installed yet
+PATH := $(top_srcdir):$(PATH)
+
 # if you use libt2n-codegen you should add this
 # (i did not find a nice way to let libt2n install this makefile snippet
 # and let projects using libt2n use the installed version.
index 6d7f069..76e3f93 100644 (file)
@@ -22,7 +22,7 @@ libt2ngroup_%.P : Makefile.am
        echo '#include "$*.hxx"' >> $*_common.hxx;
 # todo use tmp file for xml file
        for i in $($*_GROUP); do \
-               gccxml $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
+               libt2n-gccxml.sh $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
        done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && for i in $($*_GROUP); do \
                rm $${i%*.cpp}.xml; \
        done && touch $@
index 7bffe1a..c45351b 100644 (file)
@@ -22,6 +22,6 @@ noinst_PROGRAMS = minimalistic_client minimalistic_server
 all-local: minimalistic-server.xml
 
 minimalistic-server.xml: minimalistic-server.cpp
-       gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/minimalistic-server.cpp -fxml=minimalistic-server.xml
+       $(top_srcdir)/libt2n-gccxml.sh $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/minimalistic-server.cpp -fxml=minimalistic-server.xml
 
 CLEANFILES = minimalistic-server.xml
diff --git a/libt2n-gccxml.sh b/libt2n-gccxml.sh
new file mode 100755 (executable)
index 0000000..162d792
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Filter "-pthread" option from newer gcc versions
+# as it's currently unsupported in gccxml.
+EOO=0
+while [[ $1 ]]; do
+if ! ((EOO)); then
+  case "$1" in
+    -pthread)
+      shift
+      ;;
+    --)
+      EOO=1
+      OPTIONS+=("$1")
+      shift
+      ;;
+    *)
+      OPTIONS+=("$1")
+      shift
+      ;;
+  esac
+else
+  OPTIONS+=("$1")
+  shift
+fi
+done
+
+gccxml "${OPTIONS[@]}"
index d1970ad..2ee3df0 100644 (file)
@@ -52,6 +52,7 @@ rm -fr $RPM_BUILD_ROOT
 %doc ChangeLog doc examples examples-codegen 
 %defattr(-,root,root)
 %{prefix}/bin/libt2n-codegen
+%{prefix}/bin/libt2n-gccxml.sh
 %{prefix}/lib/*.*a*
 %{prefix}/lib/pkgconfig/*.pc
 %{prefix}/include/