From 09b4e2ba2f4205baf2f91bbc5ca5668e0ede8422 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 21 Dec 2016 14:39:27 -0500 Subject: [PATCH] [build] pulling in change from parser-data that allows user to pass CFLAGS --- src/Makefile.am | 9 +++++++-- src/sparkey/Makefile.am | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7d5c0835..79f2fd0f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,13 +1,18 @@ SUBDIRS = sparkey -CFLAGS_BASE = -Wfloat-equal -Wpointer-arith -DLIBPOSTAL_DATA_DIR='"$(datadir)/libpostal"' +# Inherited from autoconf / user-specified +CFLAGS_CONF = @CFLAGS@ +CFLAGS_BASE = -Wfloat-equal -Wpointer-arith -DLIBPOSTAL_DATA_DIR='"$(datadir)/libpostal"' -g $(CFLAGS_CONF) + CFLAGS_O0 = $(CFLAGS_BASE) -O0 CFLAGS_O1 = $(CFLAGS_BASE) -O1 CFLAGS_O2 = $(CFLAGS_BASE) -O2 CFLAGS_O3 = $(CFLAGS_BASE) -O3 DEFAULT_INCLUDES = -I.. -I/usr/local/include -CFLAGS = $(CFLAGS_BASE) +# Wonky but have to be able to override the user's optimization level to compile the scanner +# as it takes an unreasonably long time to compile with the optimizer on. +CFLAGS = lib_LTLIBRARIES = libpostal.la libpostal_la_SOURCES = libpostal.c address_dictionary.c transliterate.c tokens.c trie.c trie_search.c trie_utils.c string_utils.c file_utils.c numex.c utf8proc/utf8proc.c cmp/cmp.c geodb.c geo_disambiguation.c normalize.c bloom.c features.c geonames.c geohash/geohash.c unicode_scripts.c msgpack_utils.c address_parser.c address_parser_io.c averaged_perceptron.c sparse_matrix.c averaged_perceptron_tagger.c graph.c graph_builder.c language_classifier.c language_features.c logistic_regression.c logistic.c matrix.c minibatch.c float_utils.c diff --git a/src/sparkey/Makefile.am b/src/sparkey/Makefile.am index 2fee3a2b..5f92673f 100644 --- a/src/sparkey/Makefile.am +++ b/src/sparkey/Makefile.am @@ -1,4 +1,5 @@ -CFLAGS = -I/usr/local/include -O2 -Wall -Wextra -Wfloat-equal -Wshadow -Wpointer-arith -Werror -pedantic +CFLAGS_CONF = @CFLAGS@ +CFLAGS = -I/usr/local/include -O2 -Wall -Wextra -Wfloat-equal -Wshadow -Wpointer-arith -Werror -pedantic $(CFLAGS_CONF) noinst_LTLIBRARIES = libsparkey.la libsparkey_la_SOURCES = endiantools.h hashheader.h logheader.h \ @@ -7,4 +8,4 @@ logreader.c returncodes.c util.c buf.h hashalgorithms.h hashiter.h \ sparkey.h util.h endiantools.c \ hashheader.c hashreader.c logheader.c logwriter.c MurmurHash3.c \ sparkey-internal.h -libsparkey_la_LDFLAGS = -L/usr/local/lib \ No newline at end of file +libsparkey_la_LDFLAGS = -L/usr/local/lib