Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,10 @@ PREFIX=/var/zxid/$(ZXIDREL)
 ### well. N.B. Trailing / (forward slash) is needed.
 ZXID_PATH=/var/zxid/
 
+SHLIBLINK=libzxid.so
+SONAME=$(SHLIBLINK).0
+SHLIB=$(SONAME).0
+
 ###
 ### Module selection options (you should enable all, unless building embedded)
 ###
@@ -154,7 +158,7 @@ LIBS+= -lcurl -lssl -lcrypto -lz $(POSTL
 ### Where commands for build are found (override for cross compiler or Windows)
 
 #CC=ccache gcc
-CC?=gcc
+CC=gcc
 # If you want to override LD setting you must supply LD_ALT on command line or use localconf.mk
 LD_ALT?=$(CC)
 LD=$(LD_ALT)
@@ -699,7 +703,7 @@ precheck/chk-%$(EXE): precheck/chk-%.$(O
        @if $(LD) $(OUTOPT)$@ $< $(LDFLAGS) $(LIBS) ; then : ; else \
        echo Failed command:; echo '$(LD) $(OUTOPT)$@ $< $(LDFLAGS) $(LIBS)' ; false; fi
 
-%$(EXE): %.$(OBJ_EXT)
+%$(EXE): %.$(OBJ_EXT) $(SHLIBLINK)
        @echo "  Linking   $@"
        @if $(LD) $(OUTOPT)$@ $< $(LDFLAGS) $(LIBZXID) $(LIBS) ; then : ; else \
        echo Failed command:; echo '$(LD) $(OUTOPT)$@ $< $(LDFLAGS) $(LIBZXID) $(LIBS)' ; false; fi
@@ -716,7 +720,7 @@ export LC_COLLATE LC_NUMERIC
 
 DEFAULT_EXE= zxidhlo$(EXE) zxididp$(EXE) zxidhlowsf$(EXE) zxidsimple$(EXE) zxidwsctool$(EXE) zxlogview$(EXE) zxidhrxmlwsc$(EXE) zxidhrxmlwsp$(EXE) zxdecode$(EXE) zxcot$(EXE) zxpasswd$(EXE) zxcall$(EXE) zxencdectest$(EXE)
 
-ALL_EXE= smime$(EXE) zxidwspcgi$(EXE) zxid_httpd$(EXE) htpasswd$(EXE)
+ALL_EXE= smime$(EXE) zxidwspcgi$(EXE) zxid_httpd$(EXE) htpasswd$(EXE) zxbusd$(EXE) zxbustailf$(EXE) zxbuslist$(EXE)
 
 #$(info DEFAULT_EXE=$(DEFAULT_EXE))
 
@@ -1211,8 +1215,8 @@ endif
 
 # Overall
 
-samlmod Net/Makefile: Net/SAML_wrap.c Net/SAML.pm $(LIBZXID_A)
-       cd Net; $(PERL) Makefile.PL && $(MAKE)
+samlmod Net/Makefile: Net/SAML_wrap.c Net/SAML.pm $(SHLIBLINK)
+       cd Net; $(PERL) Makefile.PL INSTALLDIRS=vendor && $(MAKE)
 
 samlmod_install: Net/Makefile
        cd Net; $(MAKE) install
@@ -1284,9 +1288,9 @@ php/php_zxid$(SO): php/zxid_wrap.$(OBJ_E
 phpzxid: php/php_zxid$(SO)
 
 phpzxid_install: php/php_zxid$(SO)
-       @$(ECHO) Installing in `$(PHP_CONFIG) --extension-dir`
-       mkdir -p `$(PHP_CONFIG) --extension-dir`
-       $(CP) $< `$(PHP_CONFIG) --extension-dir`
+       @$(ECHO) Installing in $(DESTDIR)`$(PHP_CONFIG) --extension-dir`
+       mkdir -p $(DESTDIR)`$(PHP_CONFIG) --extension-dir`
+       $(CP) $< $(DESTDIR)`$(PHP_CONFIG) --extension-dir`
 
 #cp zxid.ini `$(PHP_CONFIG) --extension-dir`
 
@@ -1476,7 +1480,7 @@ ZxidServlet.class: ZxidServlet.java zxid
        $(JAVAC) $(JAVAC_FLAGS) -classpath $(SERVLET_PATH) zxidjava/*.java ZxidServlet.java
 
 zxidjava.jar: zxidjava/zxidjni.class zxidjava/README.zxid-java
-       $(CP) COPYING LICENSE-2.0.txt LICENSE.openssl LICENSE.ssleay LICENSE.curl zxidjava/
+       $(CP) COPYING LICENSE-2.0.txt zxidjava/
        $(JAR) cf zxidjava.jar zxidjava/*.class zxidjava/*.java zxidjava/COPYING zxidjava/LICENSE*
 
 zxiddemo.war: zxidjava.jar
@@ -1549,7 +1553,7 @@ precheck_apache:  precheck/chk-apache.$(
 apachezxid: precheck_apache precheck mod_auth_saml$(SO)
 
 apachezxid_install: mod_auth_saml$(SO)
-       $(CP) $< $(APACHE_MODULES)
+       $(CP) $< $(DESTDIR)$(APACHE_MODULES)
 
 mod_auth_saml: apachezxid
        @$(ECHO) "mod_auth_saml: not an official target. Use make apachezxid"
@@ -1587,7 +1591,7 @@ mini_httpd_zxid: $(MINI_HTTPD_DIR)/mini_
 ### zxid_httpd (derived from mini_httd).
 ###
 
-zxid_httpd$(EXE): zxid_httpd.$(OBJ_EXT) tdate_parse.$(OBJ_EXT) mini_httpd_filter.$(OBJ_EXT) $(LIBZXID_A)
+zxid_httpd$(EXE): zxid_httpd.$(OBJ_EXT) tdate_parse.$(OBJ_EXT) mini_httpd_filter.$(OBJ_EXT) $(SHLIBLINK)
        $(warning ZXID_HTTPD LINK)
        $(LD) $(LDFLAGS) $(OUTOPT)$@ $^ $(LIBS)
 
@@ -1597,7 +1601,7 @@ zxid_httpd$(EXE): zxid_httpd.$(OBJ_EXT)
 
 #zxid$(EXE): zxid.$(OBJ_EXT) $(LIBZXID_A)
 
-$(DEFAULT_EXE) $(ALL_EXE): $(LIBZXID_A)
+$(DEFAULT_EXE) $(ALL_EXE): $(SHLIBLINK) $(SONAME)
 
 zxcot-static-x64: zxcot.$(OBJ_EXT) $(LIBZXID_A)
        diet gcc $(OUTOPT)$@$(EXE) $< -static -L. -lzxid -pthread -lpthread -L$(DIET_ROOT)/lib -L$(DIET_ROOT)/ssl/lib-x86_64 -lcurl -lssl -lcrypto -lz
@@ -1653,7 +1657,7 @@ zxbustailf-static-x64: zxbustailf.$(OBJ_
 zxbuslist-static-x64: zxbuslist.$(OBJ_EXT) $(LIBZXID_A)
        diet gcc $(OUTOPT)$@ $< -static -L. -lzxid -pthread -lpthread -L$(DIET_ROOT)/lib -L$(DIET_ROOT)/ssl/lib-x86_64 -lcurl -lssl -lcrypto -lz
 
-zxbusd: $(ZXBUSD_OBJ) $(LIBZXID_A)
+zxbusd: $(ZXBUSD_OBJ) $(SHLIBLINK)
        $(CC) $(OUTOPT)$@ $^ $(LIBS)
 
 zxbusd-static-x64: $(ZXBUSD_OBJ) $(LIBZXID_A)
@@ -1691,8 +1695,11 @@ $(LIBZXID_A): $(ZX_OBJ) $(ZX_GEN_C:.c=.o
 endif
 endif
 
-libzxid.so.0.0: $(LIBZXID_A)
-       $(LD) $(OUTOPT)libzxid.so.0.0 $(SHARED_FLAGS) $^ $(SHARED_CLOSE) $(LIBS)
+$(SHLIB): $(ZX_OBJ) $(ZX_GEN_C:.c=.o) $(ZXID_LIB_OBJ) $(WSF_OBJ) $(OAUTH_OBJ) $(SMIME_LIB_OBJ)
+       $(LD) $(LDFLAGS) -Wl,-soname=$(SONAME) $(OUTOPT)libzxid.so.0.0 $(SHARED_FLAGS) $^ $(SHARED_CLOSE) $(LIBS)
+
+$(SHLIBLINK) $(SONAME): $(SHLIB)
+       ln -sf $< $@
 
 zxid.dll zxidimp.lib: $(LIBZXID_A)
        $(LD) $(OUTOPT)zxid.dll $(SHARED_FLAGS) -Wl,--output-def,zxid.def,--out-implib,zxidimp.lib $^ $(SHARED_CLOSE) $(SO_LIBS)
@@ -2000,13 +2007,11 @@ dirs: dir
 
 install_nodep:
        @$(ECHO) "===== Installing in $(PREFIX) (to change do make install PREFIX=/your/path)"
-       -mkdir -p $(PREFIX) $(PREFIX)/bin $(PREFIX)/lib $(PREFIX)/include/zxid $(PREFIX)/include/zx $(PREFIX)/doc
-       $(CP) zxmkdirs.sh zxcall zxpasswd zxcot zxlogview zxbusd zxbustailf zxbuslist zxdecode zxencdectest zxcleanlogs.sh zximport-htpasswd.pl zximport-ldif.pl xml-pretty.pl diffy.pl smime send.pl xacml2ldif.pl mockpdp.pl env.cgi zxid-java.sh zxidatsel.pl zxidnewuser.pl zxidcot.pl zxiddash.pl zxidexplo.pl zxidhlo zxidhlo.pl zxidhlo.php zxidhlo.sh zxidhlo-java.sh zxidhlocgi.php zxidhlowsf zxidhrxmlwsc zxidhrxmlwsp zxididp zxidsimple zxidwsctool zxidwspcgi zxtest.pl mini_httpd_zxid $(PREFIX)/bin
-       $(CP) $(LIBZXID_A) libzxid.so* $(PREFIX)/lib
-       $(CP) libzxid.so.0.0 $(PREFIX)/lib
-       $(CP) *.h c/*.h $(PREFIX)/include/zxid
-       $(CP) zx.h $(PREFIX)/include/zx
-       $(CP) *.pd *.dia $(PREFIX)/doc
+       -mkdir -p "$(DESTDIR)$(PREFIX)" "$(DESTDIR)$(PREFIX)/bin" "$(DESTDIR)$(PREFIX)/lib" "$(DESTDIR)$(PREFIX)/include/zx" "$(DESTDIR)$(PREFIX)/share/doc"
+       $(CP) zxmkdirs.sh zxcall zxpasswd zxcot zxlogview zxbusd zxbustailf zxbuslist zxdecode zxencdectest zxcleanlogs.sh zximport-htpasswd.pl zximport-ldif.pl xml-pretty.pl diffy.pl smime send.pl xacml2ldif.pl mockpdp.pl env.cgi zxid-java.sh zxidatsel.pl zxidnewuser.pl zxidcot.pl zxiddash.pl zxidexplo.pl zxidhlo zxidhlo.pl zxidhlo.php zxidhlo.sh zxidhlo-java.sh zxidhlocgi.php zxidhlowsf zxidhrxmlwsc zxidhrxmlwsp zxididp zxidsimple zxidwsctool zxidwspcgi zxtest.pl zxid_httpd $(DESTDIR)$(PREFIX)/bin
+       $(CP) $(LIBZXID_A) libzxid.so* $(DESTDIR)$(PREFIX)/lib
+       $(CP) $(SHLIB) $(DESTDIR)$(PREFIX)/lib
+       $(CP) *.h $(DESTDIR)$(PREFIX)/include/zx
        @$(ECHO) "You will need to copy zxidhlo binary where your web server can find it and"
        @$(ECHO) "make sure your web server is configured to recognize zxidhlo as a CGI script."
        @$(ECHO)