Attempt to unify hpux-shared rules. More adjustments might be required
[openssl.git] / Makefile.shared
index aee364b..f817d12 100644 (file)
@@ -548,8 +548,10 @@ link_o.irix:
                SHLIB=lib$(LIBNAME).so; \
                SHLIB_SUFFIX=; \
                LIBDEPS="$(LIBDEPS) -lc"; \
-               ALLSYMSFLAGS='-all'; \
-               NOALLSYMSFLAGS=''; \
+               MINUSWL=""; \
+               ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
+               ALLSYMSFLAGS="$${MINUSWL}-all"; \
+               NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
                SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
                SHAREDCMD='$(CC)'; \
        fi; \
@@ -562,8 +564,10 @@ link_a.irix:
                SHLIB=lib$(LIBNAME).so; \
                SHLIB_SUFFIX=; \
                LIBDEPS="$(LIBDEPS) -lc"; \
-               ALLSYMSFLAGS='-all'; \
-               NOALLSYMSFLAGS=''; \
+               MINUSWL=""; \
+               ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
+               ALLSYMSFLAGS="$${MINUSWL}-all"; \
+               NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
                SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
                SHAREDCMD='$(CC)'; \
        fi; \
@@ -593,27 +597,29 @@ link_o.hpux32:
        @ $(CALC_VERSIONS); \
        SHLIB=lib$(LIBNAME).sl; \
        SHLIB_SUFFIX=; \
-       LIBDEPS="$(LIBDEPS) -lc"; \
-       ALLSYMSFLAGS='-Fl'; \
+       LIBDEPS="$(LIBDEPS)"; \
+       ALLSYMSFLAGS='-Wl,-Fl'; \
        NOALLSYMSFLAGS=''; \
-       SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
-       SHAREDCMD='/usr/ccs/bin/ld'; \
+       expr $(PLATFORM) : '.*64' > /dev/null && ALLSYMFLAGS='-Wl,+forceload'; \
+       SHAREDFLAGS="-Wl,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
+       SHAREDCMD=$(CC); \
        $(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 link_a.hpux32:
        @ $(CALC_VERSIONS); \
        SHLIB=lib$(LIBNAME).sl; \
        SHLIB_SUFFIX=; \
-       LIBDEPS="$(LIBDEPS) -lc"; \
-       ALLSYMSFLAGS='-Fl'; \
+       LIBDEPS="$(LIBDEPS)"; \
+       ALLSYMSFLAGS='-Wl,-Fl'; \
        NOALLSYMSFLAGS=''; \
-       SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
-       SHAREDCMD='/usr/ccs/bin/ld'; \
+       expr $(PLATFORM) : '.*64' > /dev/null && ALLSYMFLAGS='-Wl,+forceload'; \
+       SHAREDFLAGS="-Wl,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
+       SHAREDCMD='$(CC)'; \
        $(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 link_app.hpux32:
        LDCMD=$(CC);\
        LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
-       LIBDEPS="$(LIBDEPS) -lc"; \
-       APPNAME="$(APPNAME)"
+       LIBDEPS="$(LIBDEPS)"; \
+       APPNAME="$(APPNAME)"; \
        $(LINK_APP)
 
 # HP-UX includes the full pathname of libs we depend on, so we would get