Build metacity as library so that plugins can link against it.

Renamed original main() to meta_main(); added wrapper main() into metacity.c.
This commit is contained in:
Tomas Frydrych 2008-10-08 10:11:57 +01:00
parent 60695fd89a
commit bbdd7d9b15
5 changed files with 45 additions and 11 deletions

View File

@ -1,4 +1,4 @@
lib_LTLIBRARIES = libmetacity-private.la
lib_LTLIBRARIES = libmetacity-private.la libmetacity.la
SUBDIRS=wm-tester tools themes
@ -8,7 +8,10 @@ endif
INCLUDES=@METACITY_CFLAGS@ -I $(srcdir)/include -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -DMETACITY_MAJOR_VERSION=$(METACITY_MAJOR_VERSION) -DMETACITY_MINOR_VERSION=$(METACITY_MINOR_VERSION) -DMETACITY_MICRO_VERSION=$(METACITY_MICRO_VERSION) -DMETACITY_CLUTTER_PLUGIN_API_VERSION=$(METACITY_CLUTTER_PLUGIN_API_VERSION) -DMETACITY_PKGLIBDIR=\"$(pkglibdir)\"
metacity_SOURCES= \
metacity_SOURCES= \
core/metacity.c
libmetacity_la_SOURCES= \
core/async-getprop.c \
core/async-getprop.h \
core/atomnames.h \
@ -103,7 +106,8 @@ metacity_SOURCES= \
ui/ui.c
if WITH_CLUTTER
metacity_SOURCES += compositor/compositor-clutter.c \
libmetacity_la_SOURCES += \
compositor/compositor-clutter.c \
compositor/compositor-clutter.h \
compositor/tidy-texture-frame.c \
compositor/tidy-texture-frame.h \
@ -156,19 +160,19 @@ bin_PROGRAMS=metacity metacity-theme-viewer
libexec_PROGRAMS=metacity-dialog
EFENCE=
metacity_LDADD=@METACITY_LIBS@ $(EFENCE)
metacity_LDADD=@METACITY_LIBS@ libmetacity.la $(EFENCE)
metacity_theme_viewer_LDADD= @METACITY_LIBS@ libmetacity-private.la
metacity_dialog_LDADD=@METACITY_LIBS@
testboxes_SOURCES=include/util.h core/util.c include/boxes.h core/boxes.c core/testboxes.c
testgradient_SOURCES=ui/gradient.h ui/gradient.c ui/testgradient.c
testasyncgetprop_SOURCES=core/async-getprop.h core/async-getprop.c core/testasyncgetprop.c
testboxes_SOURCES=core/testboxes.c
testgradient_SOURCES=ui/testgradient.c
testasyncgetprop_SOURCES=core/testasyncgetprop.c
noinst_PROGRAMS=testboxes testgradient testasyncgetprop
testboxes_LDADD= @METACITY_LIBS@
testgradient_LDADD= @METACITY_LIBS@
testasyncgetprop_LDADD= @METACITY_LIBS@
testboxes_LDADD= @METACITY_LIBS@ libmetacity.la
testgradient_LDADD= @METACITY_LIBS@ libmetacity.la
testasyncgetprop_LDADD= @METACITY_LIBS@ libmetacity.la
@INTLTOOL_DESKTOP_RULE@

View File

@ -5,6 +5,8 @@ if WITH_CLUTTER
INCLUDES=@METACITY_CFLAGS@ -I $(top_srcdir)/src/include -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -DMETACITY_MAJOR_VERSION=$(METACITY_MAJOR_VERSION) -DMETACITY_MINOR_VERSION=$(METACITY_MINOR_VERSION) -DMETACITY_MICRO_VERSION=$(METACITY_MICRO_VERSION) -DMETACITY_CLUTTER_PLUGIN_API_VERSION=$(METACITY_CLUTTER_PLUGIN_API_VERSION) -DMETACITY_PKGLIBDIR=\"$(pkglibdir)\"
LDADD = $(top_builddir)/src/libmetacity.la
default_la_CFLAGS = -fPIC
default_la_SOURCES = default.c
default_la_LDFLAGS = -module -avoid-version -no-undefined

View File

@ -386,7 +386,7 @@ void meta_select_display (gchar *display_name)
* functions.
*/
int
main (int argc, char **argv)
meta_main (int argc, char **argv)
{
struct sigaction act;
sigset_t empty_mask;

26
src/core/metacity.c Normal file
View File

@ -0,0 +1,26 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2008 Intel Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
int
main (int argc, char **argv)
{
return meta_main (argc, argv);
}

View File

@ -40,4 +40,6 @@ void meta_quit (MetaExitCode code);
void meta_restart (void);
int meta_main (int argc, char **argv);
#endif