Commit abbcceab authored by Jürg Billeter's avatar Jürg Billeter

Add version suffix to installed files to allow parallel installation

parent 294b374a
......@@ -34,7 +34,10 @@ DIST_SUBDIRS = \
$(NULL)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = vala-1.0.pc
pkgconfig_DATA = vala@PACKAGE_SUFFIX@.pc
vala@PACKAGE_SUFFIX@.pc: vala.pc
cp $< $@
.PHONY: bootstrap
bootstrap: all
......@@ -89,11 +92,15 @@ gen-ChangeLog:
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
CLEANFILES = \
vala@PACKAGE_SUFFIX@.pc
$(NULL)
EXTRA_DIST = \
ChangeLog.pre-0-4 \
ChangeLog.pre-0-5-7 \
MAINTAINERS \
vala-1.0.pc.in \
vala.pc.in \
.version \
build-aux/git-version-gen \
build-aux/gitlog-to-changelog \
......
......@@ -70,7 +70,7 @@ libvalaccode_la_SOURCES = \
$(libvalaccode_la_VALASOURCES:.vala=.c) \
$(NULL)
ccodeincludedir = $(includedir)/vala-1.0
ccodeincludedir = $(includedir)/vala@PACKAGE_SUFFIX@
ccodeinclude_HEADERS = \
valaccode.h \
......
......@@ -11,7 +11,7 @@ AM_CPPFLAGS = \
BUILT_SOURCES = codegen.vala.stamp
lib_LTLIBRARIES = \
libvala.la
libvala@PACKAGE_SUFFIX@.la
$(NULL)
libvala_la_VALASOURCES = \
......@@ -62,12 +62,12 @@ libvala_la_VALASOURCES = \
valatyperegisterfunction.vala \
$(NULL)
libvala_la_SOURCES = \
libvala@PACKAGE_SUFFIX@_la_SOURCES = \
codegen.vala.stamp \
$(libvala_la_VALASOURCES:.vala=.c) \
$(NULL)
codegenincludedir = $(includedir)/vala-1.0
codegenincludedir = $(includedir)/vala@PACKAGE_SUFFIX@
codegeninclude_HEADERS = \
valacodegen.h \
......@@ -77,9 +77,9 @@ codegen.vapi codegen.vala.stamp: $(libvala_la_VALASOURCES)
$(VALA_V)$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 --vapidir $(srcdir)/../gee --pkg gee --vapidir $(srcdir)/../ccode --pkg ccode --vapidir $(srcdir)/../vala --pkg vala -H valacodegen.h --library codegen $^
@touch $@
libvala_la_LDFLAGS = -no-undefined
libvala@PACKAGE_SUFFIX@_la_LDFLAGS = -no-undefined
libvala_la_LIBADD = \
libvala@PACKAGE_SUFFIX@_la_LIBADD = \
$(COVERAGE_LIBS) \
$(GLIB_LIBS) \
../vala/libvalacore.la \
......
......@@ -32,13 +32,17 @@ valac.vala.stamp: $(valac_VALASOURCES)
valac_LDADD = \
$(COVERAGE_LIBS) \
$(GLIB_LIBS) \
../codegen/libvala.la \
../codegen/libvala@PACKAGE_SUFFIX@.la \
$(NULL)
EXTRA_DIST = $(valac_VALASOURCES) valac.vala.stamp
install-exec-hook:
cd $(DESTDIR)$(bindir) && $(LN_S) -f valac$(EXEEXT) vala$(EXEEXT)
cd $(DESTDIR)$(bindir) && $(LN_S) -f valac@PACKAGE_SUFFIX@$(EXEEXT) vala@PACKAGE_SUFFIX@$(EXEEXT)
if ENABLE_UNVERSIONED
cd $(DESTDIR)$(bindir) && $(LN_S) -f valac@PACKAGE_SUFFIX@$(EXEEXT) valac$(EXEEXT)
cd $(DESTDIR)$(bindir) && $(LN_S) -f vala@PACKAGE_SUFFIX@$(EXEEXT) vala$(EXEEXT)
endif
MAINTAINERCLEANFILES = \
$(valac_VALASOURCES:.vala=.c) \
......
......@@ -675,7 +675,7 @@ class Vala.Compiler {
}
static int main (string[] args) {
if (Path.get_basename (args[0]) == "vala") {
if (Path.get_basename (args[0]) == "vala" || Path.get_basename (args[0]) == "vala" + Config.PACKAGE_SUFFIX) {
return run_source (args);
}
......
......@@ -6,6 +6,14 @@ AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
PACKAGE_SUFFIX=-0.10
AC_SUBST(PACKAGE_SUFFIX)
AC_DEFINE_UNQUOTED(PACKAGE_SUFFIX, "$PACKAGE_SUFFIX", [Define to the suffix of this package])
program_transform_name="s,\$\$,${PACKAGE_SUFFIX},"
AC_SUBST(pkgdatadir, [${datadir}/vala${PACKAGE_SUFFIX}])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
......@@ -31,6 +39,9 @@ AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)
......@@ -51,9 +62,9 @@ AC_ARG_ENABLE(vapigen, AS_HELP_STRING([--enable-vapigen], [Enable VAPI generator
AM_CONDITIONAL(ENABLE_VAPIGEN, test x$enable_vapigen = xyes)
if test "$enable_vapigen" = "yes"; then
vapigen_decl='vapigen=${bindir}/vapigen'
gen_introspect_decl='gen_introspect=${libdir}/vala/gen-introspect'
vala_gen_introspect_decl='vala_gen_introspect=${bindir}/vala-gen-introspect'
vapigen_decl="vapigen=\${bindir}/vapigen${PACKAGE_SUFFIX}"
gen_introspect_decl="gen_introspect=\${libdir}/vala${PACKAGE_SUFFIX}/gen-introspect${PACKAGE_SUFFIX}"
vala_gen_introspect_decl="vala_gen_introspect=\${bindir}/vala-gen-introspect${PACKAGE_SUFFIX}"
else
vapigen_decl=''
gen_introspect_decl=''
......@@ -86,7 +97,7 @@ AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_FILES([Makefile
vala-1.0.pc
vala.pc
gee/Makefile
ccode/Makefile
vala/Makefile
......
......@@ -22,3 +22,11 @@ EXTRA_DIST = \
vapigen.1 \
$(NULL)
if ENABLE_UNVERSIONED
install-data-hook:
cd $(DESTDIR)$(man1dir) && $(LN_S) -f valac@PACKAGE_SUFFIX@.1 valac.1
if ENABLE_VAPIGEN
cd $(DESTDIR)$(man1dir) && $(LN_S) -f vala-gen-introspect@PACKAGE_SUFFIX@.1 vala-gen-introspect.1
cd $(DESTDIR)$(man1dir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@.1 vapigen.1
endif
endif
NULL =
bookdir=$(datadir)/devhelp/books/vala
bookdir=$(datadir)/devhelp/books/vala@PACKAGE_SUFFIX@
chapter_data = \
overview.html \
......
......@@ -29,7 +29,7 @@ libgee_la_SOURCES = \
$(libgee_la_VALASOURCES:.vala=.c) \
$(NULL)
geeincludedir = $(includedir)/vala-1.0
geeincludedir = $(includedir)/vala@PACKAGE_SUFFIX@
geeinclude_HEADERS = \
valagee.h \
......
......@@ -25,7 +25,7 @@ libgidl_la_LIBADD = \
$(GMODULE_LIBS) \
$(NULL)
pkglibexecdir = $(libdir)/vala
pkglibexecdir = $(libdir)/vala@PACKAGE_SUFFIX@
pkglibexec_PROGRAMS = gen-introspect
BUILT_SOURCES = scannerparser.h
......
......@@ -5,7 +5,7 @@ bindir=@bindir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
vapidir=@datadir@/vala/vapi
vapidir=@datadir@/vala@PACKAGE_SUFFIX@/vapi
@vapigen_decl@
@gen_introspect_decl@
......@@ -15,5 +15,5 @@ Name: Vala
Description: The Vala compiler library
Version: @VERSION@
Requires: glib-2.0 gobject-2.0
Libs: -L${libdir} -lvala
Cflags: -I${includedir}/vala-1.0
Libs: -L${libdir} -lvala@PACKAGE_SUFFIX@
Cflags: -I${includedir}/vala@PACKAGE_SUFFIX@
......@@ -167,7 +167,7 @@ libvalacore_la_SOURCES = \
$(libvalacore_la_VALASOURCES:.vala=.c) \
$(NULL)
valaincludedir = $(includedir)/vala-1.0
valaincludedir = $(includedir)/vala@PACKAGE_SUFFIX@
valainclude_HEADERS = \
vala.h \
......
......@@ -315,7 +315,7 @@ public class Vala.CodeContext {
}
public string? get_package_path (string pkg, string[] directories) {
var path = get_file_path (pkg + ".vapi", "vala/vapi", directories);
var path = get_file_path (pkg + ".vapi", "vala" + Config.PACKAGE_SUFFIX + "/vapi", "vala/vapi", directories);
if (path == null) {
/* last chance: try the package compiled-in vapi dir */
......@@ -329,10 +329,10 @@ public class Vala.CodeContext {
}
public string? get_gir_path (string gir, string[] directories) {
return get_file_path (gir + ".gir", "gir-1.0", directories);
return get_file_path (gir + ".gir", "gir-1.0", null, directories);
}
string? get_file_path (string basename, string data_dir, string[] directories) {
string? get_file_path (string basename, string versioned_data_dir, string? data_dir, string[] directories) {
string filename = null;
if (directories != null) {
......@@ -345,12 +345,21 @@ public class Vala.CodeContext {
}
foreach (string dir in Environment.get_system_data_dirs ()) {
filename = Path.build_filename (dir, data_dir, basename);
filename = Path.build_filename (dir, versioned_data_dir, basename);
if (FileUtils.test (filename, FileTest.EXISTS)) {
return filename;
}
}
if (data_dir != null) {
foreach (string dir in Environment.get_system_data_dirs ()) {
filename = Path.build_filename (dir, data_dir, basename);
if (FileUtils.test (filename, FileTest.EXISTS)) {
return filename;
}
}
}
return null;
}
}
vala-1.0.vapi
vala-*.vapi
......@@ -2,7 +2,7 @@ NULL =
vapidir = $(pkgdatadir)/vapi
vala-1.0.vapi: ../gee/gee.vapi ../ccode/ccode.vapi ../vala/vala.vapi ../codegen/codegen.vapi
vala@PACKAGE_SUFFIX@.vapi: ../gee/gee.vapi ../ccode/ccode.vapi ../vala/vala.vapi ../codegen/codegen.vapi
cat $^ > $@
dist_vapi_DATA = \
......@@ -205,7 +205,7 @@ dist_vapi_DATA = \
unique-1.0.deps \
unique-1.0.vapi \
v4l2.vapi \
vala-1.0.vapi \
vala@PACKAGE_SUFFIX@.vapi \
vte.deps \
vte.vapi \
webkit-1.0.deps \
......
/* config.vala
*
* Copyright (C) 2006-2007 Jürg Billeter
* Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -25,4 +25,5 @@ namespace Config {
[CCode (cheader_filename = "version.h")]
public const string BUILD_VERSION;
public const string PACKAGE_DATADIR;
public const string PACKAGE_SUFFIX;
}
......@@ -50,18 +50,24 @@ vapicheck.vala.stamp: $(vapicheck_VALASOURCES)
vapigen_LDADD = \
$(GLIB_LIBS) \
../codegen/libvala.la \
../codegen/libvala@PACKAGE_SUFFIX@.la \
../gobject-introspection/libgidl.la \
$(NULL)
vapicheck_LDADD = \
$(GLIB_LIBS) \
../codegen/libvala.la \
../codegen/libvala@PACKAGE_SUFFIX@.la \
../gobject-introspection/libgidl.la \
$(NULL)
EXTRA_DIST = $(vapigen_VALASOURCES) $(vapicheck_VALASOURCES) vapigen.vala.stamp vapicheck.vala.stamp
if ENABLE_UNVERSIONED
install-exec-hook:
cd $(DESTDIR)$(bindir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@$(EXEEXT) vapigen$(EXEEXT)
cd $(DESTDIR)$(bindir) && $(LN_S) -f vapicheck@PACKAGE_SUFFIX@$(EXEEXT) vapicheck$(EXEEXT)
endif
MAINTAINERCLEANFILES = \
$(vapigen_VALASOURCES:.vala=.c) \
$(vapicheck_VALASOURCES:.vala=.c) \
......
......@@ -8,3 +8,7 @@ EXTRA_DIST = \
vala-gen-introspect.in
$(NULL)
if ENABLE_UNVERSIONED
install-exec-hook:
cd $(DESTDIR)$(bindir) && $(LN_S) -f vala-gen-introspect@PACKAGE_SUFFIX@$(EXEEXT) vala-gen-introspect$(EXEEXT)
endif
......@@ -3,7 +3,7 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
pkglibdir=${libdir}/vala
pkglibdir=${libdir}/vala@PACKAGE_SUFFIX@
if [ $# -ne 2 ]
then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment