From 6615c966030228e148c9f2b2ecf74468b317160c Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 27 Jan 2016 22:37:45 +0100 Subject: [PATCH 2/3] Move public-api directory to toplevel We're about to make the src directory optional; move this at the toplevel so that libgeoclue can include it directly. https://bugs.freedesktop.org/show_bug.cgi?id=93889 --- Makefile.am | 2 +- configure.ac | 2 +- demo/Makefile.am | 8 +++---- libgeoclue/Makefile.am | 12 +++++----- public-api/Makefile.am | 43 ++++++++++++++++++++++++++++++++++++ public-api/gclue-enums.h | 52 ++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 8 +++---- src/gclue-location-source.h | 2 +- src/gclue-locator.h | 2 +- src/gclue-nmea-source.c | 2 +- src/gclue-service-client.c | 2 +- src/public-api/Makefile.am | 43 ------------------------------------ src/public-api/gclue-enums.h | 52 -------------------------------------------- 13 files changed, 115 insertions(+), 115 deletions(-) create mode 100644 public-api/Makefile.am create mode 100644 public-api/gclue-enums.h delete mode 100644 src/public-api/Makefile.am delete mode 100644 src/public-api/gclue-enums.h diff --git a/Makefile.am b/Makefile.am index a4220fe..c620e09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,7 @@ else LIBGEOCLUE_DIR = endif -SUBDIRS = build-aux src data $(LIBGEOCLUE_DIR) demo po docs +SUBDIRS = build-aux public-api src data $(LIBGEOCLUE_DIR) demo po docs INTLTOOL_FILES = \ intltool-extract.in \ diff --git a/configure.ac b/configure.ac index 142d7fb..b012b9c 100644 --- a/configure.ac +++ b/configure.ac @@ -227,7 +227,7 @@ AC_CONFIG_FILES([ src/geoclue-$GEOCLUE_API_VERSION.pc:src/geoclue.pc.in src/agent/Makefile src/geocode-glib/Makefile - src/public-api/Makefile + public-api/Makefile po/Makefile.in data/org.freedesktop.GeoClue2.conf data/org.freedesktop.GeoClue2.Agent.conf diff --git a/demo/Makefile.am b/demo/Makefile.am index 9f0d90c..b1ac99c 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -12,8 +12,8 @@ where_am_i_CFLAGS = $(GEOCLUE_CFLAGS) \ -DLOCALEDIR="\"$(datadir)/locale\"" \ -I$(top_srcdir)/libgeoclue \ -I$(top_builddir)/libgeoclue \ - -I$(top_srcdir)/src/public-api \ - -I$(top_builddir)/src/public-api + -I$(top_srcdir)/public-api \ + -I$(top_builddir)/public-api where_am_i_LDADD = $(GEOCLUE_LIBS) \ ../libgeoclue/libgeoclue-2.la @@ -46,8 +46,8 @@ agent_CFLAGS = $(DEMO_AGENT_CFLAGS) \ -I$(top_srcdir)/src \ -I$(top_builddir)/src/agent \ -I$(top_srcdir)/src/agent \ - -I$(top_builddir)/src/public-api \ - -I$(top_srcdir)/src/public-api + -I$(top_builddir)/public-api \ + -I$(top_srcdir)/public-api agent_LDADD = $(DEMO_AGENT_LIBS) \ $(top_builddir)/src/agent/libgeoclue-agent.la diff --git a/libgeoclue/Makefile.am b/libgeoclue/Makefile.am index 18b90e8..8642dfc 100644 --- a/libgeoclue/Makefile.am +++ b/libgeoclue/Makefile.am @@ -56,11 +56,11 @@ AM_CPPFLAGS = $(LIBGEOCLUE_CFLAGS) \ -DG_LOG_DOMAIN=\""Geoclue"\" \ -DABS_TOP_SRCDIR=\""$(abs_top_srcdir)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -I$(top_srcdir)/src/public-api \ - -I$(top_builddir)/src/public-api + -I$(top_srcdir)/public-api \ + -I$(top_builddir)/public-api -ENUMS_HEADER = $(top_srcdir)/src/public-api/gclue-enums.h -ENUMS_LIB = $(top_builddir)/src/public-api/libgeoclue-public-api.la +ENUMS_HEADER = $(top_srcdir)/public-api/gclue-enums.h +ENUMS_LIB = $(top_builddir)/public-api/libgeoclue-public-api.la libgeoclue_2_la_SOURCES = \ gclue-client.c \ @@ -102,8 +102,8 @@ Geoclue-2.0.gir: $(libgeoclue_2_la_SOURCES) $(geoclue_include_HEADERS) --pkg-export=libgeoclue-2.0 \ --libtool=$(top_builddir)/libtool \ -I$(srcdir) \ - -I$(top_srcdir)/src/public-api \ - -I$(top_builddir)/src/public-api \ + -I$(top_srcdir)/public-api \ + -I$(top_builddir)/public-api \ --c-include='geoclue.h' \ $^ \ $(ENUMS_HEADER) \ diff --git a/public-api/Makefile.am b/public-api/Makefile.am new file mode 100644 index 0000000..2bbcc1c --- /dev/null +++ b/public-api/Makefile.am @@ -0,0 +1,43 @@ +include $(top_srcdir)/Makefile.decl + +BUILT_SOURCES = \ + gclue-enum-types.h \ + gclue-enum-types.c \ + $(NULL) + +geoclue_includedir = $(includedir)/libgeoclue-$(GEOCLUE_API_VERSION) +geoclue_include_HEADERS = gclue-enums.h \ + gclue-enum-types.h \ + $(NULL) + +AM_CPPFLAGS = $(GEOCLUE_CFLAGS) \ + $(WARN_CFLAGS) \ + -DLOCALEDIR="\"$(datadir)/locale\"" \ + -DG_LOG_DOMAIN=\""Geoclue"\" \ + -DABS_TOP_SRCDIR=\""$(abs_top_srcdir)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" + +noinst_LTLIBRARIES = libgeoclue-public-api.la +libgeoclue_public_api_la_SOURCES = $(BUILT_SOURCES) + +CLEANFILES = $(BUILT_SOURCES) +EXTRA_DIST = gclue-enums.h + +# Enum types +GEOCLUE_ENUMS = \ + $(srcdir)/gclue-enums.h + +gclue-enum-types.h: Makefile.am $(GEOCLUE_ENUMS) $(top_srcdir)/build-aux/gclue-enums-template.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"gclue-enums.h\"\n#ifndef __GCLUE_ENUM_TYPES_H__\n#define __GCLUE_ENUM_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/gclue-enums-template.h \ + --ftail "#endif /* __GCLUE_ENUM_TYPES_H__ */\n" \ + $(GEOCLUE_ENUMS) > $@ + +gclue-enum-types.c: Makefile.am $(top_srcdir)/build-aux/gclue-enums-template.c gclue-enum-types.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"gclue-enum-types.h\"" \ + --template $(top_srcdir)/build-aux/gclue-enums-template.c \ + $(GEOCLUE_ENUMS) > $@ + +-include $(top_srcdir)/git.mk diff --git a/public-api/gclue-enums.h b/public-api/gclue-enums.h new file mode 100644 index 0000000..e16759f --- /dev/null +++ b/public-api/gclue-enums.h @@ -0,0 +1,52 @@ +/* vim: set et ts=8 sw=8: */ +/* gclue-enum.h + * + * Copyright (C) 2013 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + * + * Author: Zeeshan Ali (Khattak) + */ + +#ifndef GCLUE_ENUM_H +#define GCLUE_ENUM_H + +#include + +G_BEGIN_DECLS + +/** + * GClueAccuracyLevel: + * @GCLUE_ACCURACY_LEVEL_NONE: Accuracy level unknown or unset. + * @GCLUE_ACCURACY_LEVEL_COUNTRY: Country-level accuracy. + * @GCLUE_ACCURACY_LEVEL_CITY: City-level accuracy. + * @GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD: neighborhood-level accuracy. + * @GCLUE_ACCURACY_LEVEL_STREET: Street-level accuracy. + * @GCLUE_ACCURACY_LEVEL_EXACT: Exact accuracy. Typically requires GPS receiver. + * + * Used to specify level of accuracy requested by, or allowed for a client. + **/ +typedef enum {/*< underscore_name=gclue_accuracy_level>*/ + GCLUE_ACCURACY_LEVEL_NONE = 0, + GCLUE_ACCURACY_LEVEL_COUNTRY = 1, + GCLUE_ACCURACY_LEVEL_CITY = 4, + GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD = 5, + GCLUE_ACCURACY_LEVEL_STREET = 6, + GCLUE_ACCURACY_LEVEL_EXACT = 8, +} GClueAccuracyLevel; + +G_END_DECLS + +#endif /* GCLUE_ENUM_H */ diff --git a/src/Makefile.am b/src/Makefile.am index aa63d63..20c36c1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.decl libexec_PROGRAMS = geoclue -SUBDIRS = public-api agent geocode-glib +SUBDIRS = agent geocode-glib CLIENT_INTERFACE_XML = org.freedesktop.GeoClue2.Client.xml LOCATION_INTERFACE_XML = org.freedesktop.GeoClue2.Location.xml @@ -118,8 +118,8 @@ AM_CPPFLAGS = $(GEOCLUE_CFLAGS) \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -I$(srcdir)/agent \ -I$(builddir)/agent \ - -I$(srcdir)/public-api \ - -I$(builddir)/public-api + -I$(top_srcdir)/public-api \ + -I$(top_builddir)/public-api libgeoclue_internal_la_SOURCES = \ $(BUILT_SOURCES) \ @@ -190,7 +190,7 @@ geoclue_LDADD = $(GEOCLUE_LIBS) \ $(builddir)/libgeoclue-internal.la \ $(builddir)/agent/libgeoclue-agent.la \ $(builddir)/geocode-glib/libgeocode-glib.la \ - $(builddir)/public-api/libgeoclue-public-api.la + $(top_builddir)/public-api/libgeoclue-public-api.la CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = $(interface_DATA) \ diff --git a/src/gclue-location-source.h b/src/gclue-location-source.h index c3a547d..75604c1 100644 --- a/src/gclue-location-source.h +++ b/src/gclue-location-source.h @@ -24,7 +24,7 @@ #include #include -#include "public-api/gclue-enum-types.h" +#include "gclue-enum-types.h" #include "gclue-location.h" G_BEGIN_DECLS diff --git a/src/gclue-locator.h b/src/gclue-locator.h index 97e52e0..9274e34 100644 --- a/src/gclue-locator.h +++ b/src/gclue-locator.h @@ -25,7 +25,7 @@ #include #include "gclue-location.h" -#include "public-api/gclue-enum-types.h" +#include "gclue-enum-types.h" #include "gclue-location-source.h" G_BEGIN_DECLS diff --git a/src/gclue-nmea-source.c b/src/gclue-nmea-source.c index 30d2146..82b9729 100644 --- a/src/gclue-nmea-source.c +++ b/src/gclue-nmea-source.c @@ -26,7 +26,7 @@ #include "gclue-nmea-source.h" #include "gclue-location.h" #include "config.h" -#include "public-api/gclue-enum-types.h" +#include "gclue-enum-types.h" #include #include diff --git a/src/gclue-service-client.c b/src/gclue-service-client.c index 8f89247..1179930 100644 --- a/src/gclue-service-client.c +++ b/src/gclue-service-client.c @@ -25,7 +25,7 @@ #include "gclue-service-client.h" #include "gclue-service-location.h" #include "gclue-locator.h" -#include "public-api/gclue-enum-types.h" +#include "gclue-enum-types.h" #include "gclue-config.h" #define DEFAULT_ACCURACY_LEVEL GCLUE_ACCURACY_LEVEL_CITY diff --git a/src/public-api/Makefile.am b/src/public-api/Makefile.am deleted file mode 100644 index 2bbcc1c..0000000 --- a/src/public-api/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -include $(top_srcdir)/Makefile.decl - -BUILT_SOURCES = \ - gclue-enum-types.h \ - gclue-enum-types.c \ - $(NULL) - -geoclue_includedir = $(includedir)/libgeoclue-$(GEOCLUE_API_VERSION) -geoclue_include_HEADERS = gclue-enums.h \ - gclue-enum-types.h \ - $(NULL) - -AM_CPPFLAGS = $(GEOCLUE_CFLAGS) \ - $(WARN_CFLAGS) \ - -DLOCALEDIR="\"$(datadir)/locale\"" \ - -DG_LOG_DOMAIN=\""Geoclue"\" \ - -DABS_TOP_SRCDIR=\""$(abs_top_srcdir)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" - -noinst_LTLIBRARIES = libgeoclue-public-api.la -libgeoclue_public_api_la_SOURCES = $(BUILT_SOURCES) - -CLEANFILES = $(BUILT_SOURCES) -EXTRA_DIST = gclue-enums.h - -# Enum types -GEOCLUE_ENUMS = \ - $(srcdir)/gclue-enums.h - -gclue-enum-types.h: Makefile.am $(GEOCLUE_ENUMS) $(top_srcdir)/build-aux/gclue-enums-template.h - $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#include \"gclue-enums.h\"\n#ifndef __GCLUE_ENUM_TYPES_H__\n#define __GCLUE_ENUM_TYPES_H__\n" \ - --template $(top_srcdir)/build-aux/gclue-enums-template.h \ - --ftail "#endif /* __GCLUE_ENUM_TYPES_H__ */\n" \ - $(GEOCLUE_ENUMS) > $@ - -gclue-enum-types.c: Makefile.am $(top_srcdir)/build-aux/gclue-enums-template.c gclue-enum-types.h - $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#include \"gclue-enum-types.h\"" \ - --template $(top_srcdir)/build-aux/gclue-enums-template.c \ - $(GEOCLUE_ENUMS) > $@ - --include $(top_srcdir)/git.mk diff --git a/src/public-api/gclue-enums.h b/src/public-api/gclue-enums.h deleted file mode 100644 index e16759f..0000000 --- a/src/public-api/gclue-enums.h +++ /dev/null @@ -1,52 +0,0 @@ -/* vim: set et ts=8 sw=8: */ -/* gclue-enum.h - * - * Copyright (C) 2013 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - * - * Author: Zeeshan Ali (Khattak) - */ - -#ifndef GCLUE_ENUM_H -#define GCLUE_ENUM_H - -#include - -G_BEGIN_DECLS - -/** - * GClueAccuracyLevel: - * @GCLUE_ACCURACY_LEVEL_NONE: Accuracy level unknown or unset. - * @GCLUE_ACCURACY_LEVEL_COUNTRY: Country-level accuracy. - * @GCLUE_ACCURACY_LEVEL_CITY: City-level accuracy. - * @GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD: neighborhood-level accuracy. - * @GCLUE_ACCURACY_LEVEL_STREET: Street-level accuracy. - * @GCLUE_ACCURACY_LEVEL_EXACT: Exact accuracy. Typically requires GPS receiver. - * - * Used to specify level of accuracy requested by, or allowed for a client. - **/ -typedef enum {/*< underscore_name=gclue_accuracy_level>*/ - GCLUE_ACCURACY_LEVEL_NONE = 0, - GCLUE_ACCURACY_LEVEL_COUNTRY = 1, - GCLUE_ACCURACY_LEVEL_CITY = 4, - GCLUE_ACCURACY_LEVEL_NEIGHBORHOOD = 5, - GCLUE_ACCURACY_LEVEL_STREET = 6, - GCLUE_ACCURACY_LEVEL_EXACT = 8, -} GClueAccuracyLevel; - -G_END_DECLS - -#endif /* GCLUE_ENUM_H */ -- 2.5.0