[gjs/wip/js24: 2/29] build: update makefiles to build using C++



commit 8dc13052aca179c052dfbbea947fcb5889d4c6de
Author: Tim Lunn <tim feathertop org>
Date:   Mon Sep 23 09:37:55 2013 +1000

    build: update makefiles to build using C++
    
    Makefile: use CXX Warning flags

 Makefile-insttest.am |    6 +-
 Makefile-modules.am  |   45 +++++++++++-----------
 Makefile-test.am     |    6 +-
 Makefile.am          |  101 +++++++++++++++++++++++++-------------------------
 configure.ac         |    4 +-
 5 files changed, 82 insertions(+), 80 deletions(-)
---
diff --git a/Makefile-insttest.am b/Makefile-insttest.am
index e48b6bb..335c902 100644
--- a/Makefile-insttest.am
+++ b/Makefile-insttest.am
@@ -22,11 +22,11 @@ TEST_PROGS += jsunit
 
 TEST_INTROSPECTION_GIRS =
 
-jsunit_CPPFLAGS = $(AM_CPPFLAGS) -DPKGLIBDIR=\"$(pkglibdir)\" -DINSTTESTDIR=\"$(gjsinsttestdir)\"
+jsunit_CPPFLAGS = $(AM_CPPFLAGS) $(GJS_CFLAGS) -DPKGLIBDIR=\"$(pkglibdir)\" 
-DINSTTESTDIR=\"$(gjsinsttestdir)\" 
 jsunit_CFLAGS = $(AM_CFLAGS) $(GJS_CFLAGS) -I$(top_srcdir)
 jsunit_LDADD = $(GJS_LIBS) libgjs.la
 jsunit_LDFLAGS = -rpath $(pkglibdir)
-jsunit_SOURCES = installed-tests/gjs-unit.c
+jsunit_SOURCES = installed-tests/gjs-unit.cpp
 
 privlibdir = $(pkglibdir)
 privlib_LTLIBRARIES =
@@ -59,7 +59,7 @@ libgimarshallingtests_la_LDFLAGS = -avoid-version $(GJS_LIBS)
 Regress-1.0.gir: libregress.la
 Regress_1_0_gir_LIBS = libregress.la
 Regress_1_0_gir_FILES = $(nodist_libregress_la_SOURCES)
-Regress_1_0_gir_SCANNERFLAGS = --warn-all --warn-error $(libregress_scannerflags_includes) 
$(libregress_la_CPPFLAGS)
+Regress_1_0_gir_SCANNERFLAGS = --warn-all --warn-error $(libregress_scannerflags_includes)
 TEST_INTROSPECTION_GIRS += Regress-1.0.gir
 
 WarnLib-1.0.gir: libwarnlib.la
diff --git a/Makefile-modules.am b/Makefile-modules.am
index 29502ea..cb939db 100644
--- a/Makefile-modules.am
+++ b/Makefile-modules.am
@@ -29,13 +29,13 @@ noinst_LTLIBRARIES += $(NATIVE_MODULES)
 libgjs_la_LIBADD += $(NATIVE_MODULES)
 
 JS_NATIVE_MODULE_CFLAGS =      \
-        $(AM_CFLAGS)           \
+        $(AM_CPPFLAGS)         \
        -DGJS_COMPILATION       \
         $(GJS_CFLAGS)
 JS_NATIVE_MODULE_LIBADD =      \
         $(GJS_LIBS)
 
-libcairoNative_la_CFLAGS =                      \
+libcairoNative_la_CPPFLAGS =                      \
         $(JS_NATIVE_MODULE_CFLAGS)              \
         $(GJS_CAIRO_CFLAGS)                     \
         $(GJS_CFLAGS)
@@ -46,31 +46,32 @@ libcairoNative_la_LIBADD =                      \
 libcairoNative_la_SOURCES =                     \
        modules/cairo-private.h                 \
        modules/cairo-module.h                  \
-       modules/cairo-context.c                 \
-       modules/cairo-path.c                    \
-       modules/cairo-surface.c                 \
-       modules/cairo-image-surface.c           \
-       modules/cairo-ps-surface.c              \
-       modules/cairo-pdf-surface.c             \
-       modules/cairo-svg-surface.c             \
-       modules/cairo-pattern.c                 \
-       modules/cairo-gradient.c                \
-       modules/cairo-linear-gradient.c         \
-       modules/cairo-radial-gradient.c         \
-       modules/cairo-surface-pattern.c         \
-       modules/cairo-solid-pattern.c           \
-       modules/cairo.c
+       modules/cairo-context.cpp                 \
+       modules/cairo-path.cpp                  \
+       modules/cairo-surface.cpp                 \
+       modules/cairo-image-surface.cpp           \
+       modules/cairo-ps-surface.cpp              \
+       modules/cairo-pdf-surface.cpp             \
+       modules/cairo-svg-surface.cpp             \
+       modules/cairo-pattern.cpp                 \
+       modules/cairo-gradient.cpp                \
+       modules/cairo-linear-gradient.cpp         \
+       modules/cairo-radial-gradient.cpp         \
+       modules/cairo-surface-pattern.cpp         \
+       modules/cairo-solid-pattern.cpp           \
+       modules/cairo.cpp
 
-libsystem_la_CFLAGS = $(JS_NATIVE_MODULE_CFLAGS)
+libsystem_la_CPPFLAGS = $(JS_NATIVE_MODULE_CFLAGS)
 libsystem_la_LIBADD = $(JS_NATIVE_MODULE_LIBADD)
-libsystem_la_SOURCES =                         \
-       modules/system.h                        \
-       modules/system.c
+libsystem_la_SOURCES =                                     \
+       modules/system.h                                        \
+       modules/system.cpp
 
-libconsole_la_CFLAGS = $(JS_NATIVE_MODULE_CFLAGS)
+libconsole_la_CPPFLAGS = $(JS_NATIVE_MODULE_CFLAGS) \
+                        $(GJS_CFLAGS)
 libconsole_la_LIBADD =                         \
        $(JS_NATIVE_MODULE_LIBADD)              \
        $(READLINE_LIBS)
 libconsole_la_SOURCES =                                \
        modules/console.h                       \
-       modules/console.c
+       modules/console.cpp
diff --git a/Makefile-test.am b/Makefile-test.am
index a7cb44f..27b2204 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -8,8 +8,8 @@ GTESTER = ${TESTS_ENVIRONMENT} ${RUN_WITH_DBUS} gtester
 ########################################################################
 TEST_PROGS += gjs-tests
 
-gjs_tests_CFLAGS =                             \
-       $(AM_CFLAGS)                            \
+gjs_tests_CPPFLAGS =                           \
+       $(AM_CPPFLAGS)                          \
        -DGJS_COMPILATION                       \
        $(GJSTESTS_CFLAGS)                      \
        $(gjs_directory_defines)                \
@@ -22,7 +22,7 @@ gjs_tests_LDADD =             \
        $(GJSTESTS_LIBS)
 
 gjs_tests_SOURCES =            \
-       test/gjs-tests.c
+       test/gjs-tests.cpp
 
 check-local: gjs-tests
        @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS} ${TEST_PROGS_OPTIONS}
diff --git a/Makefile.am b/Makefile.am
index 9a3c0ac..c46b7a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,7 @@ check_PROGRAMS = $(TEST_PROGS)
 INTROSPECTION_GIRS =
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
 AM_CFLAGS = $(WARN_CFLAGS) -DG_LOG_DOMAIN=\"Gjs\"
+AM_CPPFLAGS = $(WARN_CXXFLAGS) -DG_LOG_DOMAIN=\"Gjs\"
 
 gjsjsdir = @gjsjsdir@
 gjsoverridedir = $(gjsjsdir)/overrides
@@ -102,58 +103,58 @@ libgjs_la_LIBADD =                \
        $(GJS_LIBS)
 
 libgjs_la_SOURCES =            \
-       gjs/byteArray.c         \
-       gjs/context.c           \
-       gjs/importer.c          \
+       gjs/byteArray.cpp               \
+       gjs/context.cpp         \
+       gjs/importer.cpp                \
        gjs/gi.h                \
-       gjs/gi.c                \
+       gjs/gi.cpp              \
        gjs/jsapi-private.cpp   \
-       gjs/jsapi-util.c        \
-       gjs/jsapi-dynamic-class.c \
-       gjs/jsapi-util-array.c  \
-       gjs/jsapi-util-error.c  \
-       gjs/jsapi-util-string.c \
-       gjs/mem.c               \
-       gjs/native.c            \
-       gjs/profiler.c          \
-       gjs/runtime.c           \
-       gjs/stack.c             \
-       gjs/type-module.c       \
-       modules/modules.c       \
+       gjs/jsapi-util.cpp      \
+       gjs/jsapi-dynamic-class.cpp \
+       gjs/jsapi-util-array.cpp        \
+       gjs/jsapi-util-error.cpp        \
+       gjs/jsapi-util-string.cpp       \
+       gjs/mem.cpp             \
+       gjs/native.cpp          \
+       gjs/profiler.cpp                \
+       gjs/runtime.cpp         \
+       gjs/stack.cpp           \
+       gjs/type-module.cpp     \
+       modules/modules.cpp     \
        modules/modules.h       \
-       util/error.c            \
-       util/hash-x32.c         \
-       util/glib.c             \
-       util/crash.c            \
-       util/log.c              \
-       util/misc.c
+       util/error.cpp          \
+       util/hash-x32.cpp               \
+       util/glib.cpp           \
+       util/crash.cpp          \
+       util/log.cpp            \
+       util/misc.cpp
 
 # For historical reasons, some files live in gi/
 libgjs_la_SOURCES += \
        gi/gjs_gi_trace.h \
-       gi/arg.c        \
-       gi/boxed.c      \
-       gi/closure.c    \
-       gi/enumeration.c        \
-       gi/function.c   \
-       gi/keep-alive.c \
-       gi/ns.c \
-       gi/object.c     \
-       gi/foreign.c    \
-       gi/param.c      \
-       gi/proxyutils.c \
-        gi/repo.c      \
-       gi/union.c      \
-        gi/value.c     \
-       gi/interface.c  \
-       gi/gtype.c      \
-       gi/gerror.c
+       gi/arg.cpp      \
+       gi/boxed.cpp    \
+       gi/closure.cpp  \
+       gi/enumeration.cpp      \
+       gi/function.cpp \
+       gi/keep-alive.cpp       \
+       gi/ns.cpp       \
+       gi/object.cpp   \
+       gi/foreign.cpp  \
+       gi/param.cpp    \
+       gi/proxyutils.cpp       \
+        gi/repo.cpp    \
+       gi/union.cpp    \
+        gi/value.cpp   \
+       gi/interface.cpp        \
+       gi/gtype.cpp    \
+       gi/gerror.cpp
 
 # Also, these files used to be a separate library
 libgjs_private_source_files = \
-       libgjs-private/gjs-gdbus-wrapper.c      \
+       libgjs-private/gjs-gdbus-wrapper.cpp    \
        libgjs-private/gjs-gdbus-wrapper.h      \
-       libgjs-private/gjs-util.c               \
+       libgjs-private/gjs-util.cpp             \
        libgjs-private/gjs-util.h
 libgjs_la_SOURCES += $(libgjs_private_source_files)
 
@@ -176,12 +177,12 @@ endif
 EXTRA_DIST += gi/gjs_gi_probes.d
 
 gjstest_files_with_tests +=    \
-       gjs/context.c           \
-       gjs/jsapi-util-array.c  \
-       gjs/jsapi-util-error.c  \
-       gjs/jsapi-util-string.c \
-       gjs/stack.c                             \
-       util/glib.c
+       gjs/context.cpp         \
+       gjs/jsapi-util-array.cpp        \
+       gjs/jsapi-util-error.cpp        \
+       gjs/jsapi-util-string.cpp       \
+       gjs/stack.cpp                           \
+       util/glib.cpp
 
 tapset_in_files = gjs/gjs.stp.in
 EXTRA_DIST += $(tapset_in_files)
@@ -201,15 +202,15 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 ########################################################################
 bin_PROGRAMS += gjs-console
 
-gjs_console_CFLAGS =           \
-       $(AM_CFLAGS)            \
+gjs_console_CPPFLAGS =                 \
+       $(AM_CPPFLAGS)          \
         $(GOBJECT_CFLAGS)
 gjs_console_LDADD =            \
        $(JS_LIBS)              \
        $(GOBJECT_LIBS)         \
        libgjs.la
 gjs_console_LDFLAGS = -rdynamic
-gjs_console_SOURCES = gjs/console.c
+gjs_console_SOURCES = gjs/console.cpp
 
 install-exec-hook:
        (cd $(DESTDIR)$(bindir) && ln -sf gjs-console$(EXEEXT) gjs$(EXEEXT))
diff --git a/configure.ac b/configure.ac
index 67e7d0e..6f69f84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ m4_define(pkg_int_version, (pkg_major_version * 100 + pkg_minor_version) * 100 +
 AC_PREREQ(2.61)
 AC_INIT([gjs], pkg_version, [http://bugzilla.gnome.org/enter_bug.cgi?product=gjs])
 AM_INIT_AUTOMAKE([dist-xz no-dist-gzip])
-AC_CONFIG_SRCDIR([gjs/console.c])
+AC_CONFIG_SRCDIR([gjs/console.cpp])
 AC_CONFIG_HEADER([config.h])
 
 AC_DEFINE([GJS_VERSION], pkg_int_version, [The gjs version as an integer])
@@ -40,7 +40,7 @@ dnl DOLT
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
-GNOME_COMPILE_WARNINGS([maximum])
+GNOME_CXX_WARNINGS([maximum])
 GNOME_MAINTAINER_MODE_DEFINES
 
 # coverage


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