Commit Graph

230 Commits

Author SHA1 Message Date
Chris Hiszpanski 079e8d0f6c Add libiconv dep to meson build 2020-09-20 04:57:12 -07:00
Tomasz Kłoczko 47bab910ee Install psl executable and man pages.
Resolve #156
2020-08-05 18:38:11 +01:00
Nirbheek Chauhan 0c11bf19df meson: Fix running of psl-make-dafsa on Windows
`find_program()` evaluates to `python psl-make-dafsa` on Windows, so
running it with `python` evaluates to `python python psl-make-dafsa`,
causing this error on Windows:

```
"c:/python38/python.exe" "python" "C:/projects/repos/libpsl/src/psl-make-dafsa" "--output-format=binary" "C:/projects/repos/libpsl/list/public_suffix_list.dat" "tests/psl.dafsa"
c:/python38/python.exe: can't open file 'python': [Errno 2] No such file or directory
```
2020-04-06 20:18:45 +05:30
Matthew Waters a10c374dad meson: run python script against the meson version of python
Avoids using a python that may not exist in a python3 only distribution:

/usr/bin/env: ‘python’: No such file or directory
2020-04-02 15:16:20 +11:00
Tim Rühsen b9a190264f psl.c: Include strings.h only if it is available 2020-03-10 15:16:25 +01:00
Tim Rühsen d26a0acfd7
Merge pull request #148 from nirbheek/meson-port
meson: Use libtool library versioning, same as autotools
2020-02-28 14:01:36 +01:00
Nirbheek Chauhan 841ae6dddd meson: Use libtool library versioning, same as autotools
This helps maintain ABI compatibility with the Autotools build so it's
a drop-in replacement.
2020-02-28 13:20:23 +05:30
Tim Rühsen fca622f587 Include string.h in src/psl.c 2020-02-01 17:04:36 +01:00
Ross Burton b4fec5d0dd Makefile.am: use PYTHON when invoking psl-make-dafsa
In an environment where only Python 3 is installed, configure.ac finds and sets
PYTHON=python3 correctly but src/psl-make-dafsa is called directly, so the hashbang of
`#!/usr/bin/env python` is used which doesn't exist.

Fix this by explicitly running $(PYTHON) when using the tool.
2019-07-11 17:47:11 +01:00
Xavier Claessens 93e3bb3e29 Fix build when langinfo.h is not found 2019-06-03 15:52:48 -04:00
Tim Rühsen 999f28cc15 Use %NULL and %FILE overall in gtk-docs 2019-05-26 18:01:50 +02:00
Tim Rühsen 94a7e7c6ed Include meson build files into tarball 2019-04-17 12:05:00 +02:00
Jakub Adam c230a7b48b Windows: MSVC doesn't define ssize_t 2019-04-05 13:15:34 +02:00
carlo-bramini 7dcb69eb1d Windows: decrease minimum version to NT2000
Use WSAStringToAddressW() instead of inet_pton()

Undefine _WIN32_WINNT before (re)define it.
Fix if this macro is already declared somewhere.

Just add Winsock, no need to test anymore.

The number of characters must be used.

Use countof() macro instead

Improved fixes for Windows
2019-03-26 12:04:22 +01:00
Ignacio Casal Quinteiro 726d6773d4 meson: install the library 2018-12-31 17:01:00 +01:00
Tim Rühsen c9315f26bc Fix typos 2018-12-28 19:44:39 +01:00
Chun-wei Fan df873db543 meson: Ensure things build with Windows
We must link to ws2_32.lib for all Windows builds, and we need to use
workarounds for alloca() and snprintf() since Visual Studio uses
_alloca() for alloca() and provides snprintf() only on Visual Studio
2015 or later, meaning that we need to use _snprintf() here.

Also fix the parts where we run the Python scripts to generate items,
since those scripts already have shebang lines for Meson to pick up.
2018-12-11 09:28:51 +08:00
Xavier Claessens 77c10beab7 Add initial Meson build system 2018-12-07 09:54:20 -05:00
Xavier Claessens 1653897a49 Rename suffixes_dafsa.c to suffixes_dafsa.h
It is a generated file that we #include, so it makes more sense to have
.h extension. Also Meson tries to compile that file if it has .c
extension.
2018-12-06 09:11:02 -05:00
Tim Rühsen 9eedf5f246 Fix code broken by 2nd last patch 2018-10-29 14:56:27 +01:00
Tim Rühsen 1e1b9f5748 src/psl.c: Use C99 compliant defines 2018-10-29 13:17:59 +01:00
Tim Rühsen 9dba7e4f4c Use more C99 compliant file-scope variables 2018-10-29 12:16:52 +01:00
Tim Rühsen 8ee5c0993f Fix some issues found by lgtm.com 2018-10-15 17:40:29 +02:00
Tim Rühsen ab893d4e23 Rename _PSL_* macros to be POSIX compliant
Reported-by: Marc Lehmann
2018-10-14 20:24:45 +02:00
Tim Rühsen e87d463d04 Remove NLS / gettext from library code 2018-10-13 22:37:00 +02:00
Tim Rühsen e1104c58f3 Remove redundant code in _psl_is_public_suffix()
Reported-by: Marc Lehmann
2018-10-13 22:24:05 +02:00
Tim Rühsen 9d064cace8 Update to latest Public Suffix List 2018-10-07 21:15:07 +02:00
Tim Rühsen d691a3b941 Add Windows compatibility to fopen 2018-10-05 20:47:26 +02:00
Tim Rühsen b77d54469e Fix and cleanup build 2018-04-30 15:14:17 +02:00
Tim Rühsen a6397a0d62 Remove _HIDDEN from src/lookup_string_in_fixed_set.c 2018-04-26 16:45:15 +02:00
Chun-wei Fan 6a5da68ccf Add NMake Makefiles for Visual Studio builds
This adds a set of Visual Studio NMake Makefiles that can be used to
build libpsl, either as a DLL or as a static .lib.  Building of the psl
tool and the tests in tests/ (but not fuzz, since those tests use
fmemopen(), that is not supported on Windows) are also supported.

A simplified "install" target is provided that copies the build
results to a default or set prefix with the pkg-config file so that
other packages (such as libsoup) with build systems that depend on this
.pc file can be built.

These files make use of autotools stuff so that they have the up-to-date
version info upon a release.

Currently, only builds using the ICU runtime/builtin or with no
runtime/builtin are supported with Visual Studio builds.
2018-04-26 17:09:28 +08:00
Tim Rühsen 1a59430862 Add LTLIBICONV and LTLIBINTL to libpsl build 2018-04-25 16:00:12 +02:00
Tim Rühsen 64db5a57da Add support for native Win32 builds 2018-04-25 15:56:00 +02:00
Tim Rühsen b220ffb0b9 Fix MinGW cros build on Linux 2018-04-21 11:30:22 +02:00
Tim Rühsen 6244c731b9 Extend visibility support
Also renamed PSL_PUBLIC -> PSL_API (conforming to other known libraries).
2018-04-19 10:07:10 +02:00
Chun-wei Fan 859b307593 src/psl.c: Make code compilable on native Windows
Include the Windows/Winsock2 counterparts of the networking headers on
Windows and avoid including *NIX-specific headers on Windows.

Also remove the small bits of C99isms from the code.
2018-04-19 09:37:37 +02:00
Emmanuele Bassi c9a550e93c Fix non-srcdir builds
We need to modify the various paths we reference to include the build
directory, in the case when the build directory is not the source
directory.
2018-04-06 18:26:07 +01:00
Daniel Kahn Gillmor 2c66c15a99 fix spelling errors 2018-03-23 11:33:55 +00:00
Tim Rühsen f7e0d9441a Fix --disable-builtin configure option 2018-03-05 11:25:06 +01:00
Tim Rühsen e0c1ed0e7a Improve docs for PSL_TYPE_NO_STAR_RULE 2018-02-26 11:45:57 +01:00
Tim Rühsen 8fd480584e Fix PSL_TYPE_NO_STAR_RULE and improve test suite
Reported-by: Daniel Kahn Gillmor
2018-02-23 12:09:07 +01:00
Tim Rühsen 43ec750b40 Update copyrights 2018-02-22 10:04:00 +01:00
Tim Rühsen aaacdae977 Add TLDs to (DAFSA) data to allow skipping the star rule 2018-02-21 20:49:26 +01:00
Claudio Saavedra 9e9341f5b9 psl_is_public_suffix2(): allow checking for suffixes not in the list
Add a PSL_TYPE_NO_STAR_RULE type to check for suffixes without the '*'
rule. This allows checking for suffixes that are not in the PSL.
2018-02-21 17:11:01 +02:00
Tim Rühsen 819486edd1 Remove C99 loop construct 2018-02-21 15:56:58 +01:00
Tim Rühsen 179ca703b2 Limit CPU wasting on large inputs
Large inputs on psl_registrable_domain() and psl_unregistrable_domain()
suffer from a O(N^2) behavior. This change limits N to avoid excessive
CPU usage.

At the same time we limit the fuzz corpora size to 64k which is far more
then we expect any real life domain to be.

Reported-by: OSS-Fuzz
2018-02-13 15:42:17 +01:00
Tim Rühsen 1c44781718 Fix unsigned integer overflow in _mem_is_ascii()
Found by OSS-Fuzz. It has no impact.
2017-11-03 12:10:05 +01:00
Tim Rühsen 4e51142022 psl_*_count() return -1 if information is not available 2017-09-15 17:14:32 +02:00
Tim Rühsen c7a48a0bf8 Amend start of comments in lookup_string_in_fixed_set.c 2017-09-15 17:14:32 +02:00
Tim Rühsen a12bd1d2a6 Fix input encoding for python3 2017-09-14 20:25:59 +02:00