diff -ur makeall.csh makeall.csh --- makeall.csh +++ makeall.csh @@ -17,7 +17,42 @@ cd csupport chmod u+x mkprodct.csh; ./mkprodct.csh cd .. + echo +echo Linking libcspice.dylib +echo +if (! $?TKCOMPILER) then + set TKCOMPILER=clang +endif +if (! $?TKLINKOPTIONS) then + # These options are both unnecessary, but they preserve the default used + # downstream, important because other things will be appended to + # TKLINKOPTIONS later, overriding the downstream default. + set TKLINKOPTIONS="-m64 -lm" +endif +if ($?DYLIB_INSTALL_PREFIX) then + set DYLIB_INSTALL_PREFIX=${DYLIB_INSTALL_PREFIX}/ +else + set DYLIB_INSTALL_PREFIX= +endif +if (! $?DYLIB_VERSION) then + set DYLIB_VERSION=`sed -En -e 's/^ *CSPICE\.+V\.N0*([0-9]+)$/\1/p' ../doc/version.txt`.0.0 +endif +$TKCOMPILER $TKLINKOPTIONS -dynamiclib -Wl,-all_load -install_name ${DYLIB_INSTALL_PREFIX}libcspice.${DYLIB_VERSION}.dylib -compatibility_version ${DYLIB_VERSION} -current_version ${DYLIB_VERSION} -o ../lib/libcspice.${DYLIB_VERSION}.dylib ../lib/cspice.a ../lib/csupport.a +ln -f -s libcspice.${DYLIB_VERSION}.dylib ../lib/libcspice.dylib + +# Subsequent links will produce executables. Replace the static libraries with +# empty libraries to avoid having to those linker invocations that expect these +# to exist, while ensuring that no code will be linked from the static +# libraries. Arrange for those links to link against libcspice.dylib instead. +rm ../lib/cspice.a ../lib/csupport.a +$TKCOMPILER -x c -c -o empty.o - < /dev/null +ar -crs ../lib/cspice.a empty.o +rm empty.o +cp ../lib/cspice.a ../lib/csupport.a +setenv TKLINKOPTIONS "${TKLINKOPTIONS} -L../../lib -lcspice" + +echo echo Creating brief_c echo cd brief_c @@ -126,4 +161,5 @@ chmod u+x mkprodct.csh; ./mkprodct.csh cd .. cd .. +rm lib/cspice.a lib/csupport.a echo Toolkit Build Complete