Merge pull request #114 from xclaesse/prepare-for-meson

Prepare for meson
This commit is contained in:
Tim Rühsen 2018-12-06 16:05:03 +01:00 committed by GitHub
commit aae1995ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 13 deletions

2
.gitignore vendored
View File

@ -79,7 +79,7 @@ po/remove-potcdate.sed
po/stamp-po po/stamp-po
src/psl2c src/psl2c
src/suffixes.c src/suffixes.c
src/suffixes_dafsa.c src/suffixes_dafsa.h
stamp-h1 stamp-h1
test-driver test-driver
tests/*.log tests/*.log

View File

@ -24,8 +24,8 @@ $<
$< $<
<< <<
# Make sure we generate suffixes_dafsa.c before trying to compile psl.c # Make sure we generate suffixes_dafsa.h before trying to compile psl.c
$(CFG)\$(PLAT)\libpsl\psl.obj: $(CFG)\$(PLAT)\libpsl\suffixes_dafsa.c $(CFG)\$(PLAT)\libpsl\psl.obj: $(CFG)\$(PLAT)\libpsl\suffixes_dafsa.h
# Inference rules for building the test programs # Inference rules for building the test programs
# Used for programs with a single source file. # Used for programs with a single source file.
@ -104,7 +104,7 @@ clean:
@-del /f /q $(CFG)\$(PLAT)\*.ilk @-del /f /q $(CFG)\$(PLAT)\*.ilk
@-if exist $(CFG)\$(PLAT)\tests del /f /q $(CFG)\$(PLAT)\tests\*.obj @-if exist $(CFG)\$(PLAT)\tests del /f /q $(CFG)\$(PLAT)\tests\*.obj
@-del /f /q $(CFG)\$(PLAT)\libpsl\*.obj @-del /f /q $(CFG)\$(PLAT)\libpsl\*.obj
@-del /f /q $(CFG)\$(PLAT)\libpsl\suffixes_dafsa.c @-del /f /q $(CFG)\$(PLAT)\libpsl\suffixes_dafsa.h
@-del /f /q ..\config.h @-del /f /q ..\config.h
@-del /f /q vc$(PDBVER)0.pdb @-del /f /q vc$(PDBVER)0.pdb
@-rmdir /s /q $(CFG)\$(PLAT) @-rmdir /s /q $(CFG)\$(PLAT)

View File

@ -9,7 +9,7 @@ $(CFG)\$(PLAT)\psl \
$(CFG)\$(PLAT)\tests: $(CFG)\$(PLAT)\tests:
@-md $@ @-md $@
$(CFG)\$(PLAT)\libpsl\suffixes_dafsa.c: $(CFG)\$(PLAT)\libpsl $(PSL_FILE) ..\src\psl-make-dafsa $(CFG)\$(PLAT)\libpsl\suffixes_dafsa.h: $(CFG)\$(PLAT)\libpsl $(PSL_FILE) ..\src\psl-make-dafsa
@echo Generating $@ @echo Generating $@
$(PYTHON) ..\src\psl-make-dafsa --output-format=cxx+ "$(PSL_FILE_INPUT)" $@ $(PYTHON) ..\src\psl-make-dafsa --output-format=cxx+ "$(PSL_FILE_INPUT)" $@

View File

@ -1,10 +1,10 @@
include libpsl-srcs.mk include libpsl-srcs.mk
# suffixes.c must be created before psl.c is compiled # suffixes.c must be created before psl.c is compiled
BUILT_SOURCES = suffixes_dafsa.c BUILT_SOURCES = suffixes_dafsa.h
# suffixes.c is a built source that must be cleaned # suffixes.c is a built source that must be cleaned
CLEANFILES = suffixes_dafsa.c CLEANFILES = suffixes_dafsa.h
lib_LTLIBRARIES = libpsl.la lib_LTLIBRARIES = libpsl.la
@ -18,8 +18,8 @@ libpsl_la_LDFLAGS = -no-undefined -version-info $(LIBPSL_SO_VERSION)
# Build rule for suffix_dafsa.c # Build rule for suffix_dafsa.c
# PSL_FILE can be set by ./configure --with-psl-file=[PATH] # PSL_FILE can be set by ./configure --with-psl-file=[PATH]
suffixes_dafsa.c: $(PSL_FILE) $(srcdir)/psl-make-dafsa suffixes_dafsa.h: $(PSL_FILE) $(srcdir)/psl-make-dafsa
$(srcdir)/psl-make-dafsa --output-format=cxx+ "$(PSL_FILE)" suffixes_dafsa.c $(srcdir)/psl-make-dafsa --output-format=cxx+ "$(PSL_FILE)" suffixes_dafsa.h
EXTRA_DIST = psl-make-dafsa LICENSE.chromium EXTRA_DIST = psl-make-dafsa LICENSE.chromium

View File

@ -159,7 +159,7 @@ struct psl_ctx_st {
/* include the PSL data generated by psl-make-dafsa */ /* include the PSL data generated by psl-make-dafsa */
#if defined(BUILTIN_GENERATOR_LIBICU) || defined(BUILTIN_GENERATOR_LIBIDN2) || defined(BUILTIN_GENERATOR_LIBIDN) #if defined(BUILTIN_GENERATOR_LIBICU) || defined(BUILTIN_GENERATOR_LIBIDN2) || defined(BUILTIN_GENERATOR_LIBIDN)
#include "suffixes_dafsa.c" #include "suffixes_dafsa.h"
#else #else
static const unsigned char kDafsa[] = ""; static const unsigned char kDafsa[] = "";
static time_t _psl_file_time = 0; static time_t _psl_file_time = 0;

View File

@ -1,4 +1,9 @@
DEFS = @DEFS@ -DSRCDIR=\"$(srcdir)\" -DPSL_FILE=\"$(PSL_FILE)\" -DPSL_TESTFILE=\"$(PSL_TESTFILE)\" DEFS = @DEFS@ \
-DSRCDIR=\"$(srcdir)\" \
-DPSL_FILE=\"$(PSL_FILE)\" \
-DPSL_TESTFILE=\"$(PSL_TESTFILE)\" \
-DPSL_DAFSA=\"psl.dafsa\" \
-DPSL_ASCII_DAFSA=\"psl_ascii.dafsa\"
AM_CPPFLAGS = -I$(top_srcdir)/include AM_CPPFLAGS = -I$(top_srcdir)/include
LDADD = ../src/libpsl.la LDADD = ../src/libpsl.la
AM_LDFLAGS = -no-install AM_LDFLAGS = -no-install

View File

@ -146,12 +146,12 @@ static void test_psl(void)
psl2 = psl_builtin(); psl2 = psl_builtin();
printf("builtin PSL has %d suffixes and %d exceptions\n", psl_suffix_count(psl2), psl_suffix_exception_count(psl2)); printf("builtin PSL has %d suffixes and %d exceptions\n", psl_suffix_count(psl2), psl_suffix_exception_count(psl2));
if (!(psl3 = psl_load_file("psl.dafsa"))) { if (!(psl3 = psl_load_file(PSL_DAFSA))) {
fprintf(stderr, "Failed to load 'psl.dafsa'\n"); fprintf(stderr, "Failed to load 'psl.dafsa'\n");
failed++; failed++;
} }
if (!(psl4 = psl_load_file("psl_ascii.dafsa"))) { if (!(psl4 = psl_load_file(PSL_ASCII_DAFSA))) {
fprintf(stderr, "Failed to load 'psl_ascii.dafsa'\n"); fprintf(stderr, "Failed to load 'psl_ascii.dafsa'\n");
failed++; failed++;
} }