mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix znc-buildmod on cygwin when installed to not /usr
1. Use import library, so don't require -L/bin anymore
2. Move -lznc from LDFLAGS to LIBS
3. Fix variables in znc-buildmod. It worked before only because
${exec_prefix} was resolving to empty string, and /bin == /usr/bin on
cygwin.
This commit is contained in:
@@ -93,7 +93,7 @@ znc: $(BIN_OBJS) $(LIBZNC)
|
||||
|
||||
$(LIBZNC): $(LIB_OBJS)
|
||||
$(E) Linking $(LIBZNC)...
|
||||
$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS)
|
||||
$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS) -Wl,--out-implib=libznc.dll.a
|
||||
endif
|
||||
|
||||
unittest: $(LIB_OBJS) test/gtest-all.o test/gtest-main.o $(TESTS)
|
||||
@@ -188,6 +188,7 @@ install: znc $(LIBZNC)
|
||||
if test -n "$(LIBZNC)"; then \
|
||||
test -d $(DESTDIR)$(LIBZNCDIR) || $(INSTALL) -d $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
|
||||
$(INSTALL_PROGRAM) $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
|
||||
$(INSTALL_PROGRAM) libznc.dll.a $(DESTDIR)$(libdir) || exit 1 ; \
|
||||
fi
|
||||
@$(MAKE) -C man install DESTDIR=$(DESTDIR)
|
||||
@HAVE_SYSTEMD_TRUE@test -d $(DESTDIR)$(systemdsystemunitdir) || $(INSTALL) -d $(DESTDIR)$(systemdsystemunitdir)
|
||||
|
||||
@@ -63,7 +63,7 @@ C=
|
||||
endif
|
||||
|
||||
ifneq "$(LIBZNC)" ""
|
||||
LDFLAGS += -L.. -lznc-$(LIBZNC_VERSION) -Wl,-rpath,$(LIBZNCDIR)
|
||||
LIBS += -L.. -lznc-$(LIBZNC_VERSION) -Wl,-rpath,$(LIBZNCDIR)
|
||||
endif
|
||||
|
||||
CLEAN :=
|
||||
|
||||
@@ -44,7 +44,7 @@ modperl_all: modperl/ZNC.$(PERLCEXT_EXT) modperl/swigperlrun.h modperl/functions
|
||||
|
||||
modperl/ZNC.$(PERLCEXT_EXT): modperl/ZNC.o Makefile modperl.so
|
||||
$(E) Linking ZNC Perl bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PERL_LD) $(PERLDEPONMOD)
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PERL_LD) $(PERLDEPONMOD) $(LIBS)
|
||||
|
||||
modperl/ZNC.o: modperl/ZNC.cpp Makefile
|
||||
@mkdir -p modperl
|
||||
|
||||
@@ -52,7 +52,7 @@ modpython/_znc_core.o: modpython/_znc_core.cpp Makefile
|
||||
|
||||
modpython/_znc_core.$(PYCEXT_EXT): modpython/_znc_core.o Makefile modpython.so
|
||||
$(E) Linking ZNC python bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PY_LDFLAGS) $(PYDEPONMOD)
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PY_LDFLAGS) $(PYDEPONMOD) $(LIBS)
|
||||
|
||||
ifneq "$(SWIG)" ""
|
||||
include $(srcdir)/modpython/Makefile.gen
|
||||
|
||||
@@ -30,22 +30,19 @@ if test -z "$1"; then
|
||||
fi
|
||||
|
||||
CXXFLAGS="@CPPFLAGS@ @MODFLAGS@ -I@prefix@/include $CXXFLAGS"
|
||||
LIBS="@LIBS@ $LIBS"
|
||||
MODLINK="@MODLINK@ $MODLINK"
|
||||
VERSION="@PACKAGE_VERSION@"
|
||||
|
||||
# Ugly cygwin stuff :(
|
||||
LIBZNC="@LIBZNC@"
|
||||
LIBZNCDIR="@LIBZNCDIR@"
|
||||
LIBZNC_VERSION="@LIBZNC_VERSION@"
|
||||
if test "x" = "x$LIBZNC"; then
|
||||
LIBZNCFLAGS=""
|
||||
else
|
||||
LIBZNCFLAGS="-L$LIBZNCDIR -lznc-$LIBZNC_VERSION"
|
||||
if test -n "@LIBZNC@"; then
|
||||
prefix="@prefix@"
|
||||
exec_prefix="@exec_prefix@"
|
||||
LDFLAGS="-L@libdir@ $LDFLAGS"
|
||||
LIBS="-lznc $LIBS"
|
||||
fi
|
||||
|
||||
LDFLAGS="$LIBZNCFLAGS $LDFLAGS"
|
||||
|
||||
while test ! -z "$1"
|
||||
while test -n "$1"
|
||||
do
|
||||
FILE=$1
|
||||
shift
|
||||
|
||||
@@ -3,6 +3,7 @@ prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
datarootdir=@datarootdir@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
datadir=@datadir@
|
||||
includedir=@includedir@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user