Skip to content

Commit f3062b8

Browse files
committed
Clean up a bunch of the versioning and variable mess; Fix pkg-config to not pass through libxml2 and other unrelated args; Snip lttoolbox_config.h
1 parent 841a0e9 commit f3062b8

File tree

7 files changed

+39
-51
lines changed

7 files changed

+39
-51
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project(lttoolbox
55
LANGUAGES CXX C
66
)
77
set(VERSION ${PROJECT_VERSION})
8+
set(MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
89
set(API_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
910
set(SOVERSION 1.0.0)
1011
set(PACKAGE_BUGREPORT "[email protected]")
@@ -82,9 +83,9 @@ else()
8283

8384
# Generate pkg-config file
8485
set(prefix ${CMAKE_INSTALL_PREFIX})
85-
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
86-
set(libdir ${CMAKE_INSTALL_LIBDIR})
87-
set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
86+
set(exec_prefix "\${prefix}")
87+
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
88+
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
8889
configure_file(lttoolbox.pc.in lttoolbox.pc @ONLY)
8990
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lttoolbox.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
9091
endif()

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ACLOCAL_AMFLAGS=-I m4
22

3-
SUBDIRS = $(GENERIC_LIBRARY_NAME)
4-
DIST_SUBDIRS = $(GENERIC_LIBRARY_NAME)
3+
SUBDIRS = $(PACKAGE_NAME)
4+
DIST_SUBDIRS = $(PACKAGE_NAME)
55

66
if HAVE_PYTHON_BINDINGS
77
SUBDIRS += python

configure.ac

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
11
AC_PREREQ(2.52)
2-
AC_INIT([lttoolbox/lttoolbox.h], [3.5.2], [[email protected]])
32

4-
AC_CANONICAL_SYSTEM
3+
m4_define([PKG_MAJOR_VERSION], [3])
4+
m4_define([PKG_MINOR_VERSION], [5])
5+
m4_define([PKG_PATCH_VERSION], [2])
56

6-
GENERIC_LIBRARY_NAME=lttoolbox
7+
AC_INIT([lttoolbox], [PKG_MAJOR_VERSION.PKG_MINOR_VERSION.PKG_PATCH_VERSION], [[email protected]], [lttoolbox], [https://wiki.apertium.org/wiki/Lttoolbox])
78

8-
# Release versioning
9-
GENERIC_MAJOR_VERSION=3
10-
GENERIC_MINOR_VERSION=5
11-
GENERIC_MICRO_VERSION=2
9+
VERSION=$PACKAGE_VERSION
10+
MAJOR_VERSION=PKG_MAJOR_VERSION
11+
API_VERSION=PKG_MAJOR_VERSION.PKG_MINOR_VERSION
12+
SOVERSION=1:0:0
1213

13-
# API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
14-
GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
15-
AC_SUBST(GENERIC_API_VERSION)
16-
AC_SUBST(GENERIC_MAJOR_VERSION)
14+
AC_SUBST(PACKAGE_NAME)
15+
AC_SUBST(PACKAGE_VERSION)
16+
AC_SUBST(MAJOR_VERSION)
17+
AC_SUBST(API_VERSION)
18+
AC_SUBST(SOVERSION)
1719

18-
# Shared library versioning
19-
GENERIC_LIBRARY_VERSION=1:0:0
20-
21-
AC_SUBST(GENERIC_LIBRARY_VERSION)
22-
PACKAGE=$GENERIC_LIBRARY_NAME
23-
AC_SUBST(GENERIC_LIBRARY_NAME)
24-
25-
GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
26-
GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
27-
AC_SUBST(GENERIC_RELEASE)
28-
AC_SUBST(GENERIC_VERSION)
29-
30-
VERSION=$GENERIC_VERSION
31-
32-
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
20+
AM_INIT_AUTOMAKE
3321
AC_CONFIG_MACRO_DIR([m4])
3422

3523
AC_CANONICAL_HOST

lttoolbox.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ includedir=@includedir@
66
Name: lttoolbox
77
Description: Augmented letter transducer tools for natural language processing
88
Version: @VERSION@
9-
Libs: -L${libdir} -l@GENERIC_LIBRARY_NAME@@GENERIC_MAJOR_VERSION@ @LTTOOLBOX_LIBS@
10-
Cflags: -I${includedir}/@GENERIC_LIBRARY_NAME@-@GENERIC_API_VERSION@ -I${libdir}/@GENERIC_LIBRARY_NAME@-@GENERIC_API_VERSION@/include @LTTOOLBOX_CFLAGS@
9+
Libs: -L${libdir} -llttoolbox@MAJOR_VERSION@
10+
Cflags: -I${includedir}/lttoolbox-@API_VERSION@

lttoolbox/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ endif()
7474
set(LibLttoolbox "lttoolbox${PROJECT_VERSION_MAJOR}-${API_VERSION}")
7575
add_library(${LibLttoolbox} ${LIBLTTOOLBOX_SOURCES})
7676
target_compile_definitions(${LibLttoolbox} PRIVATE LTTOOLBOX_EXPORTS)
77-
set_target_properties(${LibLttoolbox} PROPERTIES SOVERSION ${SOVERSION})
77+
set_target_properties(${LibLttoolbox} PROPERTIES SOVERSION ${SOVERSION} VERSION ${VERSION})
7878
target_link_libraries(${LibLttoolbox} ${LIBXML2_LIBRARIES})
7979

8080
add_executable(lt-print lt_print.cc)

lttoolbox/Makefile.am

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ cc_sources = alphabet.cc att_compiler.cc compiler.cc compression.cc entry_token.
1111
regexp_compiler.cc sorted_vector.cc state.cc transducer.cc \
1212
trans_exe.cc xml_parse_util.cc tmx_compiler.cc
1313

14-
library_includedir = $(includedir)/$(GENERIC_LIBRARY_NAME)-$(GENERIC_API_VERSION)/$(GENERIC_LIBRARY_NAME)
14+
library_includedir = $(includedir)/$(PACKAGE_NAME)-$(API_VERSION)/$(PACKAGE_NAME)
1515
library_include_HEADERS = $(h_sources)
1616

1717
bin_PROGRAMS = lt-comp lt-proc lt-expand lt-tmxcomp lt-tmxproc lt-print lt-trim
1818
instdir = lttoolbox
1919

2020
lib_LTLIBRARIES= liblttoolbox3.la
2121
liblttoolbox3_la_SOURCES= $(h_sources) $(cc_sources)
22-
liblttoolbox3_la_LDFLAGS= -version-info $(GENERIC_LIBRARY_VERSION) -release $(GENERIC_RELEASE)
22+
liblttoolbox3_la_LDFLAGS= -version-info $(SOVERSION) -release $(API_VERSION)
2323

2424
lttoolboxdir = $(prefix)/share/lttoolbox
2525
lttoolboxinclude = $(prefix)/include
@@ -28,32 +28,32 @@ lttoolboxlib = $(prefix)/lib
2828
lttoolbox_DATA = dix.dtd dix.rng dix.rnc acx.rng xsd/dix.xsd xsd/acx.xsd
2929

3030
lt_print_SOURCES = lt_print.cc
31-
lt_print_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
32-
lt_print_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
31+
lt_print_LDADD = liblttoolbox$(MAJOR_VERSION).la
32+
lt_print_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
3333

3434
lt_trim_SOURCES = lt_trim.cc
35-
lt_trim_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
36-
lt_trim_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
35+
lt_trim_LDADD = liblttoolbox$(MAJOR_VERSION).la
36+
lt_trim_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
3737

3838
lt_comp_SOURCES = lt_comp.cc
39-
lt_comp_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
40-
lt_comp_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
39+
lt_comp_LDADD = liblttoolbox$(MAJOR_VERSION).la
40+
lt_comp_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
4141

4242
lt_proc_SOURCES = lt_proc.cc
43-
lt_proc_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
44-
lt_proc_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
43+
lt_proc_LDADD = liblttoolbox$(MAJOR_VERSION).la
44+
lt_proc_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
4545

4646
lt_expand_SOURCES = lt_expand.cc
47-
lt_expand_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
48-
lt_expand_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
47+
lt_expand_LDADD = liblttoolbox$(MAJOR_VERSION).la
48+
lt_expand_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
4949

5050
lt_tmxcomp_SOURCES = lt_tmxcomp.cc
51-
lt_tmxcomp_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
52-
lt_tmxcomp_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
51+
lt_tmxcomp_LDADD = liblttoolbox$(MAJOR_VERSION).la
52+
lt_tmxcomp_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
5353

5454
lt_tmxproc_SOURCES = lt_tmxproc.cc
55-
lt_tmxproc_LDADD = liblttoolbox$(GENERIC_MAJOR_VERSION).la
56-
lt_tmxproc_LDFLAGS = -llttoolbox$(GENERIC_MAJOR_VERSION) $(LTTOOLBOX_LIBS)
55+
lt_tmxproc_LDADD = liblttoolbox$(MAJOR_VERSION).la
56+
lt_tmxproc_LDFLAGS = -llttoolbox$(MAJOR_VERSION) $(LTTOOLBOX_LIBS)
5757

5858
#lt-validate-dictionary: Makefile.am validate-header.sh
5959
# @echo "Creating lt-validate-dictionary script"

python/lttoolbox.i.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
%inline%{
3535
#define SWIG_FILE_WITH_INIT
3636
#include <lttoolbox/fst_processor.h>
37-
#include <lttoolbox/lttoolbox_config.h>
3837
#include <lttoolbox/my_stdio.h>
3938
#include <lttoolbox/lt_locale.h>
4039

0 commit comments

Comments
 (0)