diff --git a/pkg/cl/unop.c b/pkg/cl/unop.c index 45d64b9..44004c5 100644 --- a/pkg/cl/unop.c +++ b/pkg/cl/unop.c @@ -260,7 +260,7 @@ int opcode; break; case OP_NINT: if (in_type == OT_REAL) - iresult = nint (rval); + iresult = (int)(rval + 0.5); else iresult = ival; break; diff --git a/pkg/ecl/unop.c b/pkg/ecl/unop.c index 1e944b5..862bd8d 100644 --- a/pkg/ecl/unop.c +++ b/pkg/ecl/unop.c @@ -294,7 +294,7 @@ unop (int opcode) break; case OP_NINT: if (in_type == OT_REAL) - iresult = nint (rval); + iresult = (int)(rval + 0.5); else iresult = ival; break; diff --git a/pkg/vocl/unop.c b/pkg/vocl/unop.c index 9289341..8427bd44 100644 --- a/pkg/vocl/unop.c +++ b/pkg/vocl/unop.c @@ -294,7 +294,7 @@ unop (int opcode) break; case OP_NINT: if (in_type == OT_REAL) - iresult = nint (rval); + iresult = (int)(rval + 0.5); else iresult = ival; break; diff --git a/unix/boot/spp/xc.c b/unix/boot/spp/xc.c index 813df0e..f901638 100644 --- a/unix/boot/spp/xc.c +++ b/unix/boot/spp/xc.c @@ -1213,7 +1213,12 @@ passflag: mkobject = YES; arglist[nargs++] = mkfname (IRAFLIB6); } } - +#ifdef HOST_CURL + arglist[nargs++] = "-lcurl"; +#endif +#ifdef HOST_EXPAT + arglist[nargs++] = "-lexpat"; +#endif /* Host libraries, searched after iraf libraries. */ for (i=0; i < nhlibs; i++) arglist[nargs++] = hlibs[i]; @@ -1360,6 +1365,7 @@ int *p_nargs; link_static = 1; } else if (strcmp (lflag, F_SHARED) == 0) { link_static = 0; +#ifndef HOST_F2C #if defined(LINUX) || defined(BSD) || defined(X86) || defined(MACOSX) } else if ((strcmp (lflag, "-lf2c") == 0) || (strcmp (lflag, "-lcompat") == 0)) { @@ -1369,8 +1375,10 @@ int *p_nargs; arglist[nargs++] = mkfname (lflag); *p_nargs = nargs; return (1); - } #endif +#endif + } + #ifdef SOLARIS else if (strcmp (lflag, "-ldl") == 0) { /* This beastie has to be linked dynamic on Solaris, but diff --git a/unix/hlib/irafuser.csh b/unix/hlib/irafuser.csh index a72270a..0bd6ee7 100644 --- a/unix/hlib/irafuser.csh +++ b/unix/hlib/irafuser.csh @@ -1,59 +1,8 @@ # IRAF definitions for the UNIX/csh user. The additional variables iraf$ and # home$ should be defined in the user's .login file. - -set old_method = 0 - -if ($old_method == 1) then - -setenv OS_MACH `uname -s | tr '[A-Z]' '[a-z]' | cut -c1-6` - -if (`uname -m` == "x86_64") then - if ($OS_MACH == "darwin") then - setenv MACH darwin - setenv IRAFARCH darwin - else - setenv MACH linux64 - setenv IRAFARCH linux64 - endif -else if (-f /etc/redhat-release) then - setenv MACH redhat -else - setenv MACH `uname -s | tr '[A-Z]' '[a-z]'` -endif - -if ($MACH == "darwin") then - # Let the IRAFARCH override the machine to support cross compilation. - if ($?IRAFARCH) then - if ("$IRAFARCH" == "macosx") then - setenv MACH macosx - else if ("$IRAFARCH" == "macintel") then - setenv MACH macintel - endif - else - if ("`uname -m`" == "i386") then - setenv MACH macosx - setenv IRAFARCH macosx - else if ("`uname -m`" == "x86_64") then - setenv MACH macintel - setenv IRAFARCH macintel - else - setenv MACH ipad - setenv IRAFARCH ipad - endif - endif -else if ($OS_MACH == "cygwin") then - setenv MACH cygwin -endif - -else # old_method - - setenv MACH `$iraf/unix/hlib/irafarch.csh` - setenv IRAFARCH `$iraf/unix/hlib/irafarch.csh` - -endif # old_method - - +setenv MACH `$iraf/unix/hlib/irafarch.csh` +setenv IRAFARCH `$iraf/unix/hlib/irafarch.csh` setenv hostid unix setenv host ${iraf}unix/ @@ -64,7 +13,7 @@ setenv tmp /tmp/ # Default to GCC for compilation. setenv CC gcc setenv F77 $hlib/f77.sh -setenv F2C $hbin/f2c.e +setenv F2C /usr/bin/f2c setenv RANLIB ranlib switch ($MACH) @@ -123,7 +72,7 @@ case ipad: breaksw case linux64: - setenv HSI_CF "-g -DLINUX -DREDHAT -DPOSIX -DSYSV -DLINUX64 -DMACH64 -w -m64" + setenv HSI_CF "-g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -DLINUX64 -DMACH64 -w -m64 -DNOLIBCNAMES -DHOST_F2C -DHOST_CURL -DHOST_EXPAT" setenv HSI_XF "-g -Inolibc -w -/m64 -/Wunused" setenv HSI_FF "-g -m64 -DBLD_KERNEL" setenv HSI_LF "-m64 " @@ -135,7 +84,7 @@ case linux64: case linux: case redhat: - setenv HSI_CF "-O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused" + setenv HSI_CF "-g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused" setenv HSI_XF "-Inolibc -w -/Wunused -/m32" setenv HSI_FF "-O -DBLD_KERNEL -m32" setenv HSI_LF "-m32" @@ -191,10 +140,10 @@ setenv HSI_XF "-I${HOME}/.iraf/ $HSI_XF" # The following determines whether or not the VOS is used for filename mapping. if (-f ${iraf}lib/libsys.a) then setenv HSI_LIBS\ - "${hlib}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a ${hlib}libos.a ${hbin}libf2c.a -lm" + "${hbin}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a -lf2c ${hbin}libos.a" else setenv HSI_CF "$HSI_CF -DNOVOS" - setenv HSI_LIBS "${hlib}libboot.a ${hlib}libos.a" + setenv HSI_LIBS "${hbin}libboot.a ${hbin}libos.a" endif setenv HSI_LIBS "$HSI_LIBS $HSI_OSLIBS" index 9e5ee88..9e8b7a4 100644 --- a/unix/hlib/libc/iraf.h +++ b/unix/hlib/libc/iraf.h @@ -5,6 +5,8 @@ * scans this file at run time to get the logical directory definitions. */ +#undef abs + #ifndef D_iraf /* ### Start of run time definitions */ #define HOST "/iraf/iraf/unix/" @@ -12,7 +14,7 @@ #define TMP "/tmp/" /* ### End of run time definitions */ -/* Compile time definitions (for C #ifdefs). +/* Compile time definitions */ /* #define BSDUNIX */ /* #define SUNOS4 */ @@ -20,89 +22,90 @@ #define D_iraf #endif -/* Include any header files specified in "#define import_XXX" statements +/* Include any header files specified in #define import_XXX statements * before we were called. */ #ifdef import_libc #ifndef D_libc -#include "/iraf/iraf/unix/hlib/libc/libc.h" +#include "libc.h" #endif #undef import_libc #endif #ifdef import_spp #ifndef D_spp -#include "/iraf/iraf/unix/hlib/libc/spp.h" +#include "spp.h" #endif #undef import_spp #endif #ifdef import_main #ifndef D_main -#include "/iraf/iraf/unix/hlib/libc/main.h" +#include "main.h" #endif #undef import_main #endif #ifdef import_stdio #ifndef D_stdio -#include "/iraf/iraf/unix/hlib/libc/stdio.h" + +#include "iraf/stdio.h" #endif #undef import_stdio #endif #ifdef import_error #ifndef D_error -#include "/iraf/iraf/unix/hlib/libc/error.h" +#include "error.h" #endif #undef import_error #endif #ifdef import_ctype #ifndef D_ctype -#include "/iraf/iraf/unix/hlib/libc/ctype.h" +#include "iraf/ctype.h" #endif #undef import_ctype #endif #ifdef import_finfo #ifndef D_finfo -#include "/iraf/iraf/unix/hlib/libc/finfo.h" +#include "finfo.h" #endif #undef import_finfo #endif #ifdef import_fset #ifndef D_fset -#include "/iraf/iraf/unix/hlib/libc/fset.h" +#include "fset.h" #endif #undef import_fset #endif #ifdef import_fpoll #ifndef D_fpoll -#include "/iraf/iraf/unix/hlib/libc/fpoll.h" +#include "fpoll.h" #endif #undef import_fpoll #endif #ifdef import_kernel #ifndef D_kernel -#include "/iraf/iraf/unix/hlib/libc/kernel.h" +#include "kernel.h" #endif #undef import_kernel #endif #ifdef import_xnames #ifndef D_xnames -#include "/iraf/iraf/unix/hlib/libc/xnames.h" +#include "xnames.h" #endif #undef import_xnames #endif #ifdef import_knames #ifndef D_knames -#include "/iraf/iraf/unix/hlib/libc/knames.h" +#include "knames.h" /* #include "/iraf/iraf/unix/hlib/libc/kproto.h" */ @@ -112,77 +115,77 @@ #ifdef import_setjmp #ifndef D_setjmp -#include "/iraf/iraf/unix/hlib/libc/setjmp.h" +#include #endif #undef import_setjmp #endif #ifdef import_xwhen #ifndef D_xwhen -#include "/iraf/iraf/unix/hlib/libc/xwhen.h" +#include "xwhen.h" #endif #undef import_xwhen #endif #ifdef import_protect #ifndef D_protect -#include "/iraf/iraf/unix/hlib/libc/protect.h" +#include "protect.h" #endif #undef import_protect #endif #ifdef import_prtype #ifndef D_prtype -#include "/iraf/iraf/unix/hlib/libc/prtype.h" +#include "prtype.h" #endif #undef import_prtype #endif #ifdef import_zfstat #ifndef D_zfstat -#include "/iraf/iraf/unix/hlib/libc/zfstat.h" +#include "zfstat.h" #endif #undef import_zfstat #endif #ifdef import_alloc #ifndef D_alloc -#include "/iraf/iraf/unix/hlib/libc/alloc.h" +#include "alloc.h" #endif #undef import_alloc #endif #ifdef import_math #ifndef D_math -#include "/iraf/iraf/unix/hlib/libc/math.h" +#include #endif #undef import_math #endif #ifdef import_prstat #ifndef D_prstat -#include "/iraf/iraf/unix/hlib/libc/prstat.h" +#include "prstat.h" #endif #undef import_prstat #endif #ifdef import_lexnum #ifndef D_lexnum -#include "/iraf/iraf/unix/hlib/libc/lexnum.h" +#include "lexnum.h" #endif #undef import_lexnum #endif #ifdef import_ttset #ifndef D_ttset -#include "/iraf/iraf/unix/hlib/libc/ttset.h" +#include "ttset.h" #endif #undef import_ttset #endif #ifdef import_stdarg #ifndef D_stdarg -#include "/iraf/iraf/unix/hlib/libc/stdarg.h" +#include #endif #undef import_stdarg #endif diff --git a/unix/hlib/libc/libc.h b/unix/hlib/libc/libc.h index cf3b1c1..747b370 100644 --- a/unix/hlib/libc/libc.h +++ b/unix/hlib/libc/libc.h @@ -42,7 +42,7 @@ extern char MEMCOM[]; /* External names. */ -#ifndef NOLIBCNAMES +#ifndef NOLIBCNAMES*/ #define getenv envget #define sys_nerr u_sysnerr @@ -320,8 +320,9 @@ extern void c_xwhen (int exception, PFI new_handler, PFI *old_handler); /* */ -#include "/iraf/iraf/unix/bin/f2c.h" -#include "/iraf/iraf/unix/hlib/libc/vosproto.h" +#include "f2c.h" +#undef abs +#include "vosproto.h" #define D_libc #define D_libc_proto diff --git a/unix/mkpkg.sh b/unix/mkpkg.sh index 3ea7596..cc78b29 100644 --- a/unix/mkpkg.sh +++ b/unix/mkpkg.sh @@ -22,3 +22,8 @@ echo "----------------------- GDEV ---------------------------" # Install the newly created executables. echo "install HSI executables in $host/bin.$MACH" mv -f hlib/*.e bin.$MACH +pushd bin.$MACH +for i in *.e +do ln -sf $i ${i%.*} +done +popd diff --git a/unix/os/zzstrt.c b/unix/os/zzstrt.c index a6f5808..33791ed 100644 --- a/unix/os/zzstrt.c +++ b/unix/os/zzstrt.c @@ -101,7 +101,12 @@ int BSS_kludge[256]; void ready_ (void); - +#ifdef HOST_F2C +extern int MAIN__(); +int MAIN__() { + exit(0); +} +#endif /* ZZSTRT -- Initialize the IRAF kernel at process startup time. */ diff --git a/vendor/voclient/Makefile b/vendor/voclient/Makefile index 7c3d59a..7bf23c1 100644 --- a/vendor/voclient/Makefile +++ b/vendor/voclient/Makefile @@ -37,50 +37,55 @@ LIBS = -lm -lc -lpthread all: - (cd common ; make all ; make install) - (cd libvotable ; make all ; make install) - (cd libsamp ; make all ; make install) - (cd libvoclient ; make all ; make install) - (cd voapps ; make all ; make install) - (cd libvo ; make all ; make install) + (cd common ; ${MAKE} all ; ${MAKE} install) + (cd libvotable ; ${MAKE} all ; ${MAKE} install) + (cd libsamp ; ${MAKE} all ; ${MAKE} install) + (cd libvoclient ; ${MAKE} all ; ${MAKE} install) + (cd voapps ; ${MAKE} all ; ${MAKE} install) + (cd libvo ; ${MAKE} all ; ${MAKE} install) libs: - (cd common ; make libs) - (cd libvotable ; make libs) - (cd libsamp ; make libs) - (cd libvoclient ; make libs) - (cd voapps ; make libs) - (cd libvo ; make libs) + +mylib: +# (cd common ; ${MAKE} ) + (cd libsamp ; ${MAKE} .BASE lib ; cp *.h ../include ; cp *.a ../lib ) + (cd libvoclient ; ${MAKE} install ) + cp libsamp/cfitsio/*.h include + cp libsamp/libxrpc/*.h include + cp -r libsamp/libxrpc/include/xmlrpc-c include + (cd libvotable ; ${MAKE} install) + (cd voapps ; ${MAKE} lib ; cp *.a ../lib ) + (rm -f *.o ; cd libvo ; ${MAKE} HOST_CURL=1 lib) apps: - (cd common ; make apps) - (cd libvotable ; make apps) - (cd libsamp ; make apps) - (cd libvoclient ; make apps) - (cd voapps ; make apps) + (cd common ; ${MAKE} apps) + (cd libvotable ; ${MAKE} apps) + (cd libsamp ; ${MAKE} apps) + (cd libvoclient ; ${MAKE} apps) + (cd voapps ; ${MAKE} apps) examples: - (cd common ; make examples) - (cd libvotable ; make examples) - (cd libsamp ; make examples) - (cd libvoclient ; make examples) - (cd voapps ; make examples) + (cd common ; ${MAKE} examples) + (cd libvotable ; ${MAKE} examples) + (cd libsamp ; ${MAKE} examples) + (cd libvoclient ; ${MAKE} examples) + (cd voapps ; ${MAKE} examples) install: - (cd common ; make install) - (cd libvotable ; make install) - (cd libsamp ; make install) - (cd libvoclient ; make install) - (cd voapps ; make install) - (cd libvo ; make install) + (cd common ; ${MAKE} install) + (cd libvotable ; ${MAKE} install) + (cd libsamp ; ${MAKE} install) + (cd libvoclient ; ${MAKE} install) + (cd voapps ; ${MAKE} install) + (cd libvo ; ${MAKE} install) clean: - (cd common ; make clean) - (cd libvotable ; make clean) - (cd libsamp ; make clean) - (cd libvoclient ; make clean) - (cd voapps ; make clean) - (cd libvo ; make clean) + (cd common ; ${MAKE} clean) + (cd libvotable ; ${MAKE} clean) + (cd libsamp ; ${MAKE} clean) + (cd libvoclient ; ${MAKE} clean) + (cd voapps ; ${MAKE} clean) + (cd libvo ; ${MAKE} clean) /bin/rm -rf voclient/lib/libvoclient.* /bin/rm -rf bin/* lib/* include/* spool diff --git a/vendor/voclient/libsamp/Makefile b/vendor/voclient/libsamp/Makefile index c74affb..def14cc 100644 --- a/vendor/voclient/libsamp/Makefile +++ b/vendor/voclient/libsamp/Makefile @@ -26,7 +26,7 @@ SHAREDLIB = $(LIBDIR)/$(LIBBASE).so.$(VERSION) # includes, flags and libraries CC = gcc -CINCS = -I$(INCDIR) -I. +CINCS = -I$(INCDIR) -I. -Ilibxrpc/include -Ilibxrpc ifeq ("$(PLATFORM)", "Darwin") ifeq ("$(PLMACH)", "macintel") diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c index 526a4db..5503b9f 100644 --- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c +++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c @@ -17,7 +17,6 @@ #endif #include -#include #include #include diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c index 630f318..3086435 100644 --- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c +++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c @@ -15,7 +15,6 @@ #include "version.h" #include -#include #include #include "curlversion.h" diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c index 526381d..9b7b530 100644 --- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c +++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c @@ -83,7 +83,6 @@ #include "xmlrpc-c/time_int.h" #include -#include #include #include diff --git a/vendor/voclient/libvo/Makefile b/vendor/voclient/libvo/Makefile index 69067e8..d680702 100644 --- a/vendor/voclient/libvo/Makefile +++ b/vendor/voclient/libvo/Makefile @@ -70,11 +70,14 @@ zztest: zztest.o $(OBJS) #################################### lib: objs $(INCS) + rm -f *.o ar x ../lib/libsamp.a ar x ../lib/libVOTable.a ar x ../lib/libVOClient.a ar x ../lib/libVOApps.a +ifndef HOST_CURL ar x ../lib/libcurl.a +endif chmod 644 *.o ar rv libVO.a *.o /bin/rm -f *.o __* diff --git a/vendor/voclient/libvotable/Makefile b/vendor/voclient/libvotable/Makefile index 6ee6e95..3eb3351 100644 --- a/vendor/voclient/libvotable/Makefile +++ b/vendor/voclient/libvotable/Makefile @@ -15,7 +15,6 @@ BINDIR := ../bin/ LIBDIR := ../lib/ INCDIR := ../include/ - # secondary dependencies LIBBASE = lib$(NAME) @@ -48,9 +47,11 @@ OBJS = votParse.o votParse_f77.o votParse_spp.o \ votExpatCB.o votElement.o votAttr.o votStack.o votHandle.o INCS = votParse.h +ifneq ($(NOVOS),1) SPP_SRCS = votUtil_spp.x SPP_OBJS = votUtil_spp.o SPP_INCS = votParse_spp.h +endif INCS_PRIV = votParseP.h LIBS = lib$(NAME).a @@ -105,7 +106,7 @@ lib: objs ############################################################################### votUtil_spp.o: votUtil_spp.x votParse_spp.h - xc -c votUtil_spp.x + xc -c -w votUtil_spp.x ############################################################################### diff --git a/util/mksysvos b/util/mksysvos new file mode 100755 index 0000000..88a8ec0 --- /dev/null +++ b/util/mksysvos @@ -0,0 +1,41 @@ +#!/bin/csh -f +# + +if (! $?iraf) then + #echo "" + #echo "Error: You must have the iraf env variable defined !" + #echo "" + #exit 1 + + set iraf = $cwd/ +endif + + +set c_start = `date` +/bin/rm -f spool */spool + + +#$iraf/util/mkclean # clean old binaries + +echo "=== VOS bootstrap ===" +cd $iraf/unix # VOS bootstrap +source hlib/irafuser.csh +sh -x mkpkg.sh |& tee -a spool + +echo "=== VOS core ===" +cd $iraf/ # build core system +mkpkg |& tee -a spool + +echo "=== NOAO ===" +cd $iraf/noao # build NOAO package +setenv noao $cwd/ +mkpkg -p noao |& tee -a spool + +set c_end = `date` + + +echo "" +echo "" +echo "" +echo "Start: $c_start" +echo " End: $c_end" diff --git a/util/mksysnovos b/util/mksysnovos new file mode 100755 index 0000000..6fd2735 --- /dev/null +++ b/util/mksysnovos @@ -0,0 +1,34 @@ +#!/bin/csh -f +# + +if (! $?iraf) then + #echo "" + #echo "Error: You must have the iraf env variable defined !" + #echo "" + #exit 1 + + set iraf = $cwd/ +endif + + +set c_start = `date` +/bin/rm -f spool */spool + + +#$iraf/util/mkclean # clean old binaries + +echo "=== NOVOS bootstrap ===" +cd $iraf/unix # NOVOS bootstrap +source hlib/irafuser.csh +sh -x mkpkg.sh |& tee -a spool + +echo "=== NOVOS build ===" +cd $iraf/ # build NOVOS +mkpkg |& tee -a spool +set c_end = `date` + +echo "" +echo "" +echo "" +echo "Start: $c_start" +echo " End: $c_end" diff --git a/vendor/voclient/common/Makefile b/vendor/voclient/common/Makefile index 5d29ba2..ed6e2da 100644 --- a/vendor/voclient/common/Makefile +++ b/vendor/voclient/common/Makefile @@ -38,28 +38,28 @@ all:: curl expat libs:: (/bin/csh -f mklibs) - (cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib) + (cd expat ; ./configure --prefix=${HERE}/.. ; $(MAKE) ; $(MAKE) installlib) curl:: (/bin/csh -f mklibs) expat:: - (cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib) + (cd expat ; ./configure --prefix=${HERE}/.. ; $(MAKE) ; $(MAKE) installlib) apps: install: - (cd curl ; make install) - #(cd expat ; make install) + (cd curl ; $(MAKE) install) + #(cd expat ; $(MAKE) install) (/bin/rm -rf ../man ../share) clean: - (cd curl ; make clean) - (cd expat ; make clean) + (cd curl ; $(MAKE) clean) + (cd expat ; $(MAKE) clean) distclean: - (cd curl ; make distclean) - (cd expat ; make distclean) + (cd curl ; $(MAKE) distclean) + (cd expat ; $(MAKE) distclean)