#------------------------------------------------------------------------------
# The rest is private to this makefile.
-#DEBUG=:
-DEBUG=set -x
+#SET_X=:
+SET_X=set -x
top:
echo "Trying to use this makefile interactively? Don't."
fi
LINK_APP= \
- ( $(DEBUG); \
+ ( $(SET_X); \
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
$$LDCMD $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS )
LINK_SO= \
- ( $(DEBUG); \
+ ( $(SET_X); \
nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
$$SHAREDCMD $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
- $(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
+ $(SYMLINK_SO); ( $(SET_X); rm -f lib$(LIBNAME).exp )
SYMLINK_SO= \
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
if [ -n "$$SHLIB_COMPAT" ]; then \
for x in $$SHLIB_COMPAT; do \
- ( $(DEBUG); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
+ ( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
done; \
fi; \
if [ -n "$$SHLIB_SOVER" ]; then \
- ( $(DEBUG); rm -f $$SHLIB$$SHLIB_SUFFIX; \
+ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
fi; \
fi
LINK_SO_A_VIA_O= \
SHOBJECTS=lib$(LIBNAME).o; \
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
- ( $(DEBUG); \
+ ( $(SET_X); \
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
$(LINK_SO) && rm -f $(LIBNAME).o
LINK_SO_A_UNPACKED= \
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -dynamiclib"; \
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME); \
SHLIB_SUFFIX=.dylib; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS='-all_load'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -dynamiclib"; \
link_app.darwin:
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"; \
$(LINK_APP)
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
if [ -n "$$SHLIB_HIST" ]; then \
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
else \
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"
fi; \
$(LINK_APP)
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
$(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
else \
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=''; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
else \
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"; \
fi; \
$(LINK_APP)
link_o.aix:
@ $(CALC_VERSIONS); \
+ OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
+ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS='-bnogc'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
SHAREDCMD='$(CC)'; \
- $(LINK_SO_O)
+ $(LINK_SO_O); rm -rf lib$(LIBNAME).exp
link_a.aix:
@ $(CALC_VERSIONS); \
+ OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
+ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS='-bnogc'; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
link_app.aix:
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS) -blibpath:$(LIBRPATH)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"
$(LINK_APP)
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) -G'; \
@ $(CALC_VERSIONS); \
SHLIB=lib$(LIBNAME).so; \
SHLIB_SUFFIX=; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
ALLSYMSFLAGS=; \
NOALLSYMSFLAGS=''; \
SHAREDFLAGS='$(CFLAGS) -G'; \
link_app.reliantunix:
LDCMD=$(CC);\
LDFLAGS="$(CFLAGS)"; \
- LIBDEPS="$(LIBDEPS) -lc"; \
+ LIBDEPS="$(LIBDEPS)"; \
APPNAME="$(APPNAME)"
$(LINK_APP)