Fix bugs and add unit tests for BSEARCH()
[mikachu/openbox.git] / Makefile.am
index 8cdb126..b438904 100644 (file)
@@ -6,6 +6,7 @@ localedir       = $(datadir)/locale
 configdir       = $(sysconfdir)/xdg
 rcdir           = $(configdir)/openbox
 xsessionsdir    = $(datadir)/xsessions
+gnomesessiondir = $(datadir)/gnome-session/sessions
 gnomewmfilesdir = $(datadir)/gnome/wm-properties
 pkgconfigdir    = $(libdir)/pkgconfig
 obtpubincludedir= $(includedir)/openbox/@OBT_VERSION@/obt
@@ -35,6 +36,9 @@ bin_PROGRAMS = \
        tools/gnome-panel-control/gnome-panel-control \
        tools/obxprop/obxprop
 
+noinst_PROGRAMS = \
+       obt/obt_unittests
+
 nodist_bin_SCRIPTS = \
        data/xsession/openbox-session \
        data/xsession/openbox-gnome-session \
@@ -47,8 +51,7 @@ nodist_rc_SCRIPTS = \
        data/autostart/autostart
 
 dist_libexec_SCRIPTS = \
-       data/autostart/openbox-xdg-autostart \
-       data/autostart/openbox-autostart
+       data/autostart/openbox-xdg-autostart
 
 nodist_libexec_SCRIPTS = \
        data/autostart/openbox-autostart
@@ -75,19 +78,21 @@ obrender_libobrender_la_CPPFLAGS = \
        $(XML_CFLAGS) \
        $(PANGO_CFLAGS) \
        $(IMLIB2_CFLAGS) \
+       $(LIBRSVG_CFLAGS) \
        -DG_LOG_DOMAIN=\"ObRender\" \
        -DDEFAULT_THEME=\"$(theme)\"
 obrender_libobrender_la_LDFLAGS = \
        -version-info $(RR_CURRENT):$(RR_REVISION):$(RR_AGE)
 obrender_libobrender_la_LIBADD = \
+       obt/libobt.la \
        $(X_LIBS) \
        $(PANGO_LIBS) \
        $(GLIB_LIBS) \
        $(IMLIB2_LIBS) \
+       $(LIBRSVG_LIBS) \
        $(XML_LIBS)
 obrender_libobrender_la_SOURCES = \
        gettext.h \
-       obrender/button.h \
        obrender/button.c \
        obrender/color.h \
        obrender/color.c \
@@ -113,6 +118,7 @@ obrender_libobrender_la_SOURCES = \
 ## obt ##
 
 obt_libobt_la_CPPFLAGS = \
+       $(X_CFLAGS) \
        $(XINERAMA_CFLAGS) \
        $(XKB_CFLAGS) \
        $(XRANDR_CFLAGS) \
@@ -127,6 +133,7 @@ obt_libobt_la_CPPFLAGS = \
 obt_libobt_la_LDFLAGS = \
        -version-info $(OBT_CURRENT):$(OBT_REVISION):$(OBT_AGE)
 obt_libobt_la_LIBADD = \
+       $(X_LIBS) \
        $(XINERAMA_LIBS) \
        $(XKB_LIBS) \
        $(XRANDR_LIBS) \
@@ -154,8 +161,6 @@ obt_libobt_la_SOURCES = \
        obt/signal.h \
        obt/signal.c \
        obt/util.h \
-       obt/watch.h \
-       obt/watch.c \
        obt/xqueue.h \
        obt/xqueue.c
 
@@ -175,6 +180,8 @@ openbox_openbox_CPPFLAGS = \
        -DCONFIGDIR=\"$(configdir)\" \
        -DG_LOG_DOMAIN=\"Openbox\"
 openbox_openbox_LDADD = \
+       $(XINERAMA_LIBS) \
+       $(XRANDR_LIBS) \
        $(SM_LIBS) \
        $(GLIB_LIBS) \
        $(X_LIBS) \
@@ -283,6 +290,8 @@ openbox_openbox_SOURCES = \
        openbox/ping.h \
        openbox/place.c \
        openbox/place.h \
+       openbox/place_overlap.c \
+       openbox/place_overlap.h \
        openbox/prompt.c \
        openbox/prompt.h \
        openbox/popup.c \
@@ -302,6 +311,21 @@ openbox_openbox_SOURCES = \
        openbox/window.c \
        openbox/window.h
 
+## obt_unittests ##
+
+obt_obt_unittests_CPPFLAGS = \
+       $(GLIB_CFLAGS) \
+       -DLOCALEDIR=\"$(localedir)\" \
+       -DDATADIR=\"$(datadir)\" \
+       -DCONFIGDIR=\"$(configdir)\" \
+       -DG_LOG_DOMAIN=\"Obt-Unittests\"
+obt_obt_unittests_LDADD = \
+       $(GLIB_LIBS) \
+       obt/libobt.la
+obt_obt_unittests_LDFLAGS = -export-dynamic
+obt_obt_unittests_SOURCES = \
+       obt/unittest_base.c \
+       obt/bsearch_unittest.c
 
 ## gnome-panel-control ##
 
@@ -326,9 +350,11 @@ tools_obxprop_obxprop_SOURCES = \
 ## gdm-control ##
 
 tools_gdm_control_gdm_control_CPPFLAGS = \
+       $(XAUTH_CFLAGS) \
        $(X_CFLAGS) \
        $(GLIB_CFLAGS)
 tools_gdm_control_gdm_control_LDADD = \
+       $(XAUTH_LIBS) \
        $(X_LIBS) \
        $(GLIB_LIBS)
 tools_gdm_control_gdm_control_SOURCES = \
@@ -451,7 +477,6 @@ obtpubinclude_HEADERS = \
        obt/signal.h \
        obt/util.h \
        obt/version.h \
-       obt/watch.h \
        obt/xqueue.h
 
 nodist_pkgconfig_DATA = \
@@ -473,20 +498,21 @@ dist_rc_DATA = \
 edit = $(SED) \
        -e 's!@version\@!$(VERSION)!' \
        -e 's!@configdir\@!$(configdir)!' \
+       -e 's!@rcdir\@!$(rcdir)!' \
        -e 's!@libexecdir\@!$(libexecdir)!' \
        -e 's!@bindir\@!$(bindir)!'
 
-data/autostart/autostart: $(srcdir)/data/autostart/autostart.in Makefile
+data/autostart/autostart: $(top_srcdir)/data/autostart/autostart.in Makefile
        @echo make: creating $@
-       @test -d $(shell dirname $(builddir)/$@) || \
-         mkdir $(shell dirname $(builddir)/$@)
-       @$(edit) $< >$(builddir)/$@
+       @test -d $(shell dirname $(top_builddir)/$@) || \
+         mkdir $(shell dirname $(top_builddir)/$@)
+       @$(edit) $< >$(top_builddir)/$@
 
-data/autostart/openbox-autostart: $(srcdir)/data/autostart/openbox-autostart.in Makefile
+data/autostart/openbox-autostart: $(top_srcdir)/data/autostart/openbox-autostart.in Makefile
        @echo make: creating $@
-       @test -d $(shell dirname $(builddir)/$@) || \
-         mkdir $(shell dirname $(builddir)/$@)
-       @$(edit) $< >$(builddir)/$@
+       @test -d $(shell dirname $(top_builddir)/$@) || \
+         mkdir $(shell dirname $(top_builddir)/$@)
+       @$(edit) $< >$(top_builddir)/$@
 
 %.desktop: %.desktop.in Makefile
        @echo make: creating $@
@@ -512,6 +538,10 @@ nodist_xsessions_DATA = \
        data/xsession/openbox-gnome.desktop \
        data/xsession/openbox-kde.desktop
 
+dist_gnomesession_DATA = \
+       data/gnome-session/openbox-gnome.session \
+       data/gnome-session/openbox-gnome-fallback.session
+
 dist_noinst_DATA = \
        data/rc.xsd \
        data/menu.xsd \