summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 36c2222..44a4167 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,10 +11,15 @@ posix_headers = onigposix.h
if ENABLE_POSIX_API
posix_sources = regposix.c regposerr.c
include_HEADERS += $(posix_headers)
+AM_CFLAGS += -DUSE_POSIX_API
else
posix_sources =
endif
+if ENABLE_BINARY_COMPATIBLE_POSIX_API
+AM_CFLAGS += -DUSE_BINARY_COMPATIBLE_POSIX_API
+endif
+
lib_LTLIBRARIES = $(libname)
@@ -45,13 +50,29 @@ libonig_la_SOURCES = regint.h regparse.h regenc.h st.h \
gb18030.c koi8_r.c cp1251.c \
onig_init.c
-libonig_la_LDFLAGS = -version-info $(LTVERSION)
-
EXTRA_DIST = koi8.c mktable.c \
unicode_fold_data.c unicode_property_data.c \
unicode_property_data_posix.c \
unicode_egcb_data.c unicode_wb_data.c
+
+libonig_la_LDFLAGS = $(EXTRA_LIBONIG_LDFLAGS) -version-info $(LTVERSION)
+
+if USE_LIBONIG_DEF_FILE
+
+libonig_la_LDFLAGS += -Wl,--output-def,$(LIBONIG_DEF_FILE)
+
+install-data-hook:
+ echo "$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_DATA) $(LIBONIG_DEF_FILE) $(DESTDIR)$(libdir)"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_DATA) $(LIBONIG_DEF_FILE) $(DESTDIR)$(libdir) || exit 1
+
+uninstall-hook:
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$(LIBONIG_DEF_FILE)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$(LIBONIG_DEF_FILE)"
+
+endif
+
+
dll:
$(CXX) -shared -Wl,--output-def,libonig.def -o libonig.dll *.o \
$(LIBS)