Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated options from XC #372

Merged
merged 5 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export RANLIB = ranlib
# host tools and software are in unix/Makefile.
export CFLAGS ?= -g -O2
export XC_CFLAGS = $(CPPFLAGS) $(CFLAGS)
export XC_LFLAGS = $(LDFLAGS)

.PHONY: all sysgen clean test arch noao host novos core bindirs bin_links config inplace starttime

Expand Down
2 changes: 1 addition & 1 deletion test/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ ! -d $bin -a -d ${iraf}bin ] ; then
bin=${iraf}bin/
unset arch IRAFARCH
fi
export XC_CFLAGS=-w
export XC_CFLAGS="${XC_CFLAGS} -w"

TEST_FILES=""
IRAF_SHELLS=""
Expand Down
145 changes: 40 additions & 105 deletions unix/boot/spp/xc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,28 @@

#define XPP "xpp.e"
#define RPP "rpp.e"
#define EDSYM "edsym.e"
#define SHIMAGE "S.e"
#define LIBMAIN "libmain.o"
#define SHARELIB "libshare.a"
#define IRAFLIB1 "libex.a"
#define IRAFLIB2 "libsys.a"
#define IRAFLIB3 "libvops.a"
#define IRAFLIB4 "libos.a"
#define IRAFLIB5 "liblapack.a"
#define IRAFLIB6 "libfftpack.a"

char *fortlib[] = { "-lf2c", /* 0 */
"-lm", /* 1 */
"-lcurl", /* 2 */
"-lexpat", /* 3 */

char *iraflibs[] = { "libex.a",
"liblapack.a",
"libsys.a",
"libvops.a",
"libfftpack.a",
"libos.a",
NULL};

char *fortlib[] = { "-lf2c",
"-lm",
"-lcurl",
"-lexpat",
#if (defined (__linux__) || defined (__gnu_hurd__))
"-lpthread", /* 5 */
#else
"", /* 5 */
"-lpthread",
#endif
"-lz", /* 6 */
"", /* 7 */
"", /* 8 */
"", /* 9 */
0}; /* EOF */

char *opt_flags[] = { "-O2", /* 0 */
0}; /* EOF */
"-lz",
NULL};

int nopt_flags = 1; /* No. optimizer flags */
char *opt_flags[] = { "-O2",
NULL};

#define isxfile(str) (getextn(str) == 'x')
#define isffile(str) (getextn(str) == 'f')
Expand All @@ -101,12 +93,6 @@ int nopt_flags = 1; /* No. optimizer flags */
#define ispfile(str) (getextn(str) == 'P') /* func prototypes */


int usesharelib = NO;
int noedsym = YES;

int stripexe = NO;
int notvsym = NO;
int noshsym = NO;
int errflag = NO;
int objflags = NO;
int keepfort = NO;
Expand All @@ -123,7 +109,6 @@ int hostprog = NO;
int voslibs = YES;
int nolibc = NO;
int usef2c = YES;
int useg95 = NO;
int userincs = NO;
int host_c_main = NO;

Expand Down Expand Up @@ -245,7 +230,6 @@ main (int argc, char *argv[])
if ((s = os_getenv ("XC-F77")) || (s = os_getenv ("XC_F77")))
strcpy (f77comp, s);
usef2c = (strncmp (f77comp, "f77", 3) == 0 ? 1 : 0);
useg95 = (strncmp (f77comp, "g95", 3) == 0 ? 1 : 0);
if ((s = os_getenv ("XC-LINKER")) || (s = os_getenv ("XC_LINKER")))
strcpy (linker, s);

Expand Down Expand Up @@ -402,7 +386,6 @@ main (int argc, char *argv[])
/* Link a host program, but include the VOS libraries.
*/
hostprog++;
noedsym++;
nolibc++;
break;

Expand Down Expand Up @@ -471,16 +454,16 @@ main (int argc, char *argv[])
if (bp - buffer >= SZ_BUFFER)
fatal ("Out of buffer space for options");
} else if (*ip == 'z') {
usesharelib = NO;
// compatibility entry (usesharelib = NO:)
} else if (*ip == 'e') {
noedsym = YES;
// compatibility entry ( noedsym = YES;)
} else if (*ip == 't') {
notvsym = YES;
// compatibility entry (notvsym = YES;)
} else if (*ip == 'T') {
noshsym = YES;
// compatibility entry (noshsym = YES;)
} else if (*ip == 's') {
stripexe = YES;
goto passflag;
// compatibility entry (stripexe = YES;)
// goto passflag;
} else if (*ip == 'N') {
/* "NFS" link option. Generate the output temp
* file in /tmp during the link, then move it to
Expand Down Expand Up @@ -615,15 +598,14 @@ passflag: mkobject = YES;
arglist[nargs++] = f2cpath;
}

#ifdef __i386__
arglist[nargs++] = "-m32";
#elif (__SIZEOF_LONG__ == 8 && __SIZEOF_POINTER__ == 8) /* ILP64 */
#if (__SIZEOF_LONG__ == 8 && __SIZEOF_POINTER__ == 8) /* ILP64 */
arglist[nargs++] = "-i8";
#endif

if (optimize) {
for (i=0; i < nopt_flags; i++)
for (i=0; opt_flags[i] != NULL; i++) {
arglist[nargs++] = opt_flags[i];
}
}

/* Add the user-defined flags last so they can override the
Expand Down Expand Up @@ -660,15 +642,14 @@ passflag: mkobject = YES;
arglist[nargs++] = f2cpath;
}

#ifdef __i386__
arglist[nargs++] = "-m32";
#elif (__SIZEOF_LONG__ == 8 && __SIZEOF_POINTER__ == 8) /* ILP64 */
#if (__SIZEOF_LONG__ == 8 && __SIZEOF_POINTER__ == 8) /* ILP64 */
arglist[nargs++] = "-i8";
#endif

if (optimize) {
for (i=0; i < nopt_flags; i++)
arglist[nargs++] = opt_flags[i];
for (i=0; opt_flags[i] != NULL; i++) {
arglist[nargs++] = opt_flags[i];
}
}

/* Add the user-defined flags last so they can override the
Expand Down Expand Up @@ -708,13 +689,10 @@ passflag: mkobject = YES;
arglist[nargs++] = ccomp;
arglist[nargs++] = "-c";

#ifdef __i386__
arglist[nargs++] = "-m32";
#endif

if (optimize) {
for (i=0; i < nopt_flags; i++)
for (i=0; opt_flags[i] != NULL; i++) {
arglist[nargs++] = opt_flags[i];
}
}

if (! nolibc) {
Expand Down Expand Up @@ -763,9 +741,6 @@ passflag: mkobject = YES;
if ((s = os_getenv("XC-LFLAGS")) || (s = os_getenv("XC_LFLAGS")))
addflags (s, arglist, &nargs);

#ifdef __i386__
arglist[nargs++] = "-m32";
#endif
arglist[nargs++] = "-o";

if (link_nfs) {
Expand Down Expand Up @@ -814,35 +789,22 @@ passflag: mkobject = YES;
arglist[nargs++] = mkfname (LIBMAIN);
}
if (voslibs) {
if (usesharelib) {
arglist[nargs++] = mkfname (SHARELIB);
arglist[nargs++] = mkfname (IRAFLIB4);
} else {
arglist[nargs++] = mkfname (IRAFLIB1);
arglist[nargs++] = mkfname (IRAFLIB5);
arglist[nargs++] = mkfname (IRAFLIB2);
arglist[nargs++] = mkfname (IRAFLIB3);
arglist[nargs++] = mkfname (IRAFLIB6);
arglist[nargs++] = mkfname (IRAFLIB4);
for (i=0; iraflibs[i] != NULL; i++) {
arglist[nargs++] = mkfname (iraflibs[i]);
}
}

/* Host libraries, searched after iraf libraries. */
for (i=0; i < nhlibs; i++)
for (i=0; i < nhlibs; i++) {
arglist[nargs++] = hlibs[i];
}

/* The remaining system libraries depend upon which version of
* the SunOS compiler we are using.
*/
addflags (fortlib[0], arglist, &nargs);
addflags (fortlib[1], arglist, &nargs);
addflags (fortlib[2], arglist, &nargs);
addflags (fortlib[3], arglist, &nargs);
addflags (fortlib[4], arglist, &nargs);
addflags (fortlib[5], arglist, &nargs);
addflags (fortlib[6], arglist, &nargs);
addflags (fortlib[7], arglist, &nargs);
addflags (fortlib[8], arglist, &nargs);
for (i=0; fortlib[i] != NULL; i++) {
addflags (fortlib[i], arglist, &nargs);
}
arglist[nargs] = NULL;

if (debug)
Expand Down Expand Up @@ -871,33 +833,6 @@ passflag: mkobject = YES;
}
errflag += status;

/* If we are linking against the iraf shared library and symbol editing
* has not been disabled, edit the symbol table of the new executable
* to provide symbols within the shared image.
*/
if (usesharelib && !noedsym && !stripexe) {
char shlib[SZ_PATHNAME+1];
char edsym[SZ_PATHNAME+1];
char command[SZ_CMDBUF];

/* The os_sysfile(SHIMAGE) below assumes the existence of a file
* entry "S.e" in the directory containing the real shared image
* "S<n>.e". We can't easily look directly for S<n>.e because
* the process symbol table and image has to be examined to
* determine the shared image version number.
*/
if (os_sysfile (SHIMAGE, shlib, SZ_PATHNAME) > 0) {
if (os_sysfile (EDSYM, edsym, SZ_PATHNAME) > 0) {
sprintf (command, "%s %s %s", edsym, outfile, shlib);
if (noshsym)
strcat (command, " -T");
else if (notvsym)
strcat (command, " -t");
status = sys (command);
}
}
}
errflag += status;
done (errflag);

return (0);
Expand Down
18 changes: 4 additions & 14 deletions unix/boot/spp/xc.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Causes debug messages to be printed during execution.
.ls 10 -F, -f
Do not delete the Fortran translation of an SPP source file.
.le
.ls 10 -g
Generates debugging information.
.le
.ls 10 -h
Causes the executable to be linked as a host program, i.e., without the
IRAF main and without searching the IRAF libraries, unless explicitly
Expand Down Expand Up @@ -66,7 +63,7 @@ the link down excessively.
.ls 10 -Nh [filename]
This tells xpp that the foreign definitions in the
file specified should be used in preference to
standard include files.
standard include files.
.le
.ls 10 -o
This flag redirects the output of the compile if used in
Expand All @@ -91,21 +88,14 @@ package.
Disable optimization. Opposite of -O. Object code will be optimized
by default.
.le
.ls 10 -s
Strips all symbols and debugging information.
.le
.ls 10 -v
Verbose mode. Causes messages to be printed during execution telling
what the \fIxc\fR program is doing.
.le
.ls 10 -w
Suppress warnings.
Suppress warnings. Forwarded to the compiler and linker.
.le
.ls 10 -x
Compile and link for debugging.
.le
.ls 10 -z
Create a non-shareable image (default).
.ls 10 -z, -e, -t, -T, -s
Ignored. Provided for backward compatibility.
.le
.ls 10 -V
Print XC version identification.
Expand Down
30 changes: 10 additions & 20 deletions unix/boot/spp/xc.man
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Hey, EMACS: -*- nroff -*-
.TH XC "1" "June 2021" "IRAF 2.17" "IRAF commands"
.SH NAME
xc \- portable IRAF compile/link utility
Expand Down Expand Up @@ -44,9 +44,6 @@ Causes debug messages to be printed during execution.
.B -F\fR,\fB -f
Do not delete the Fortran translation of an SPP source file.
.TP
.B -g
Generates debugging information .
.TP
.B -h
Causes the executable to be linked as a host program, i.e., without
the IRAF main and without searching the IRAF libraries, unless
Expand Down Expand Up @@ -84,7 +81,7 @@ besides the standard ones to include. These must be either on the current
directory, or in an IRAF system library (lib$ or hlib$).
The library specification must be immediately after the option as in
"-lxtools". No other option may follow the 'l' option in the same
argument as in -lxtoolsO.
argument as in -lxtoolsO.
.TP
.B -N
Generates the output temp file in /tmp during the link, then moves it
Expand All @@ -107,7 +104,7 @@ Optimize object code produced; this is now the default, but this
switch is still provided for backwards compatibility.
.TP
.B -p \fIpkgname
Load the package environment for the named external package, e.g.,
Load the package environment for the named external package, e.g.,
"xc \-c \-p noao file.x". If the same package is always specified the
environment variable or logical name PKGENV may be defined at the host
level to accomplish the same thing. The package name \fImust\fR be
Expand All @@ -118,23 +115,16 @@ package.
Disable optimization. Opposite of \-O. Object code will be optimized
by default.
.TP
.B -s
Strips all symbols and debugging information.
.TP
.B -S
Same as \-s for VMS.
.TP
.B -v
Verbose mode. Causes messages to be printed during execution telling
what the \fBxc\fR program is doing.
.TP
.B -w
Suppress warnings.
Suppress warnings. Forwarded to the compiler and linker.
.TP
.B -x
Compile and link for debugging.
.TP
.B -z
Create a non-shareable image (default).
.B -z\fR,\fB -e\fR,\fB -t\fR,\fB -T\fR,\fB -s
Ignored. Provided for backward compatibility.
.TP
.B V
.B -V
Print XC version identification.

.SH SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion unix/hlib/mkpkg.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $set SITEID = noao # site name

$set XFLAGS = "-c -w" # default XC compile flags
$set XVFLAGS = "-c -w" # VOPS XC compile flags
$set LFLAGS = "-Nz" # default XC link flags
$set LFLAGS = "" # default XC link flags

$set USE_LIBMAIN = yes # update lib$libmain.o (root object)
$set USE_KNET = yes # use the KI (network interface)
Expand Down