Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 930e57e

Browse files
author
rkowen
committed
A whole slew of changes progressing to deap modulefile directories.
The current is not usuable, but will eventually be. These changes are checked in for safe keeping while R.K.Owen is on vacation.
1 parent e391c85 commit 930e57e

25 files changed

Lines changed: 1358 additions & 816 deletions

Makefile.am

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###########################################################################
22
##
33
## File: ./Makefile.am
4-
## Versions: $Id: Makefile.am,v 1.6 2002/06/14 21:57:03 rkowen Exp $
4+
## Versions: $Id: Makefile.am,v 1.7 2002/08/02 22:11:23 rkowen Exp $
55
## Created: 2002/06/14
66
##
77
###########################################################################
@@ -16,12 +16,14 @@ AUTOMAKE_OPTIONS=foreign dejagnu no-installinfo
1616

1717
ACLOCAL_AMFLAGS= -I config
1818

19+
SUBDIRS = lib . init modulefiles @EXTDIR@
20+
INCLUDES = -I$(srcdir)/lib -I$(srcdir)
21+
1922
man_MANS = doc/module.1 doc/modulefile.4
20-
SUBDIRS =. init modulefiles @EXTDIR@
2123
bin_PROGRAMS = modulecmd
2224
# bin_SCRIPTS = etc/mkroot etc/add.modules ext/add.ext
2325
modulecmd_CFLAGS=
24-
modulecmd_LDFLAGS= @TCL_LIB_SPEC@ @TCLX_LIB_SPEC@ @X_LIBS@ @X_EXTRA_LIBS@ @LIBS@
26+
modulecmd_LDFLAGS=-L$(srcdir)/lib @TCL_LIB_SPEC@ @TCLX_LIB_SPEC@ @X_LIBS@ @X_EXTRA_LIBS@
2527
modulecmd_SOURCES = \
2628
ModuleCmd_Avail.c ModuleCmd_Bootstrap.c \
2729
ModuleCmd_Clear.c ModuleCmd_Display.c ModuleCmd_Help.c \
@@ -48,7 +50,7 @@ check-local: modulecmd
4850
MODULEVERSION=@VERSION@; export MODULEVERSION; TESTSUITEDIR=$(srcdir)/testsuite; export TESTSUITEDIR; $(RUNTEST) --srcdir $$TESTSUITEDIR $(RUNTESTFLAGS) --tool=modules
4951

5052
cxref:
51-
cxref $(SRCS)
53+
cxref $(modulecmd_SOURCES)
5254
@echo "==============================="
5355
@echo "You may need to run this twice!"
5456
@echo "==============================="

Makefile.in

Lines changed: 81 additions & 62 deletions
Large diffs are not rendered by default.

ModuleCmd_Avail.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
** **
3535
** ************************************************************************ **/
3636

37-
static char Id[] = "@(#)$Id: ModuleCmd_Avail.c,v 1.5 2002/06/17 05:58:43 rkowen Exp $";
37+
static char Id[] = "@(#)$Id: ModuleCmd_Avail.c,v 1.6 2002/08/02 22:11:23 rkowen Exp $";
3838
static void *UseId[] = { &UseId, Id };
3939

4040
/** ************************************************************************ **/
@@ -180,7 +180,7 @@ static char **create_cache_list( FILE*, int*, char* );
180180
** Result: int TCL_OK Successfull operation **
181181
** TCL_ERROR Any failure **
182182
** **
183-
** Attached Globals: specified_module The module name from the **
183+
** Attached Globals: g_specified_module The module name from the **
184184
** command line. **
185185
** **
186186
** ************************************************************************ **
@@ -226,7 +226,7 @@ int ModuleCmd_Avail( Tcl_Interp *interp,
226226
** Set the name of the module specified on the command line
227227
**/
228228

229-
specified_module = *argv;
229+
g_specified_module = *argv;
230230

231231
if( !check_dir( *argv))
232232
if( OK != ErrorLogger( ERR_PARAM, LOC, NULL)) {
@@ -259,7 +259,7 @@ int ModuleCmd_Avail( Tcl_Interp *interp,
259259
** Set the name of the module specified on the command line
260260
**/
261261

262-
specified_module = *argv;
262+
g_specified_module = *argv;
263263

264264
dirname = modpath;
265265
while( dirname && *dirname) {

ModuleCmd_Display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
** **
2828
** ************************************************************************ **/
2929

30-
static char Id[] = "@(#)$Id: ModuleCmd_Display.c,v 1.2 2001/06/09 09:48:46 rkowen Exp $";
30+
static char Id[] = "@(#)$Id: ModuleCmd_Display.c,v 1.3 2002/08/02 22:11:23 rkowen Exp $";
3131
static void *UseId[] = { &UseId, Id };
3232

3333
/** ************************************************************************ **/
@@ -89,7 +89,7 @@ static char _proc_ModuleCmd_Display[] = "ModuleCmd_Display";
8989
** Result: int TCL_ERROR Failure **
9090
** TCL_OK Successfull operation **
9191
** **
92-
** Attached Globals: specified_module The module name from the **
92+
** Attached Globals: g_specified_module The module name from the **
9393
** command line. **
9494
** g_flags These are set up accordingly before **
9595
** this function is called in order to **
@@ -133,7 +133,7 @@ int ModuleCmd_Display( Tcl_Interp *interp,
133133
** Set the name of the module specified on the command line
134134
**/
135135

136-
specified_module = argv[i];
136+
g_specified_module = argv[i];
137137

138138
disp_interp = Tcl_CreateInterp();
139139
if( TCL_OK != (result = InitializeModuleCommands( disp_interp))) {

ModuleCmd_Init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
** **
2929
** ************************************************************************ **/
3030

31-
static char Id[] = "@(#)$Id: ModuleCmd_Init.c,v 1.3 2002/04/29 21:16:48 rkowen Exp $";
31+
static char Id[] = "@(#)$Id: ModuleCmd_Init.c,v 1.4 2002/08/02 22:11:23 rkowen Exp $";
3232
static void *UseId[] = { &UseId, Id };
3333

3434
/** ************************************************************************ **/
@@ -287,7 +287,7 @@ int ModuleCmd_Init( Tcl_Interp *interp,
287287
*endp = '\0';
288288
}
289289

290-
if((char **) NULL==(modlist=SplitIntoList(interp,startp,&nummods)))
290+
if((char **) NULL==(modlist=SplitIntoList(startp,&nummods)))
291291
continue;
292292
/* restore the list end character */
293293
if(endp)

ModuleCmd_Load.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
** **
2929
** ************************************************************************ **/
3030

31-
static char Id[] = "@(#)$Id: ModuleCmd_Load.c,v 1.6 2002/04/29 21:16:48 rkowen Exp $";
31+
static char Id[] = "@(#)$Id: ModuleCmd_Load.c,v 1.7 2002/08/02 22:11:23 rkowen Exp $";
3232
static void *UseId[] = { &UseId, Id };
3333

3434
/** ************************************************************************ **/
@@ -92,7 +92,7 @@ static char _proc_ModuleCmd_Load[] = "ModuleCmd_Load";
9292
** 1 At least one module has been **
9393
** read **
9494
** **
95-
** Attached Globals: specified_module The module name from the **
95+
** Attached Globals: g_specified_module The module name from the **
9696
** command line **
9797
** g_flags These are set up accordingly before **
9898
** this function is called in order to **
@@ -139,7 +139,7 @@ int ModuleCmd_Load( Tcl_Interp *interp,
139139
** Set the name of the module specified on the command line
140140
**/
141141

142-
specified_module = argv[i];
142+
g_specified_module = argv[i];
143143

144144
/**
145145
** Create a Tcl interpreter and initialize it with the module commands

ModuleCmd_Switch.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
** **
2828
** ************************************************************************ **/
2929

30-
static char Id[] = "@(#)$Id: ModuleCmd_Switch.c,v 1.5 2002/06/12 19:54:39 rkowen Exp $";
30+
static char Id[] = "@(#)$Id: ModuleCmd_Switch.c,v 1.6 2002/08/02 22:11:23 rkowen Exp $";
3131
static void *UseId[] = { &UseId, Id };
3232

3333
/** ************************************************************************ **/
@@ -85,7 +85,7 @@ static char module_name[] = "ModuleCmd_Switch.c"; /** File name of this module *
8585
** **
8686
** Attached Globals: g_flags Controlling the callback **
8787
** functions. **
88-
** specified_module The module name from the **
88+
** g_specified_module The module name from the **
8989
** command line. **
9090
** g_current_module The module which is handled **
9191
** by the current command **
@@ -162,7 +162,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
162162
** Set the name of the module specified on the command line
163163
**/
164164

165-
specified_module = oldmodule;
165+
g_specified_module = oldmodule;
166166

167167
/**
168168
** First try to find a match for the modulefile out of the LOADEDMODULES.
@@ -204,7 +204,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
204204
** Set the name of the module specified on the command line
205205
**/
206206

207-
specified_module = newmodule;
207+
g_specified_module = newmodule;
208208

209209
/**
210210
** Now try to find the new file to swap with.
@@ -226,7 +226,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
226226

227227
g_flags |= (M_REMOVE | M_SWSTATE1);
228228

229-
specified_module = oldmodule;
229+
g_specified_module = oldmodule;
230230
g_current_module = oldname;
231231
if( Read_Modulefile( interp, oldfile) == 0)
232232
Update_LoadedList( interp, oldname, oldfile);
@@ -244,7 +244,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
244244

245245
g_flags |= M_SWSTATE2;
246246

247-
specified_module = newmodule;
247+
g_specified_module = newmodule;
248248
g_current_module = newname;
249249
if( Read_Modulefile( interp, newfile) == 0)
250250
Update_LoadedList( interp, newname, newfile);
@@ -262,7 +262,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
262262

263263
g_flags |= (M_REMOVE | M_SWSTATE3);
264264

265-
specified_module = oldmodule;
265+
g_specified_module = oldmodule;
266266
g_current_module = oldname;
267267
if( Read_Modulefile( interp, oldfile) == 0)
268268
Update_LoadedList( interp, newname, newfile);
@@ -283,7 +283,7 @@ int ModuleCmd_Switch( Tcl_Interp *interp,
283283
/**
284284
** free space
285285
** assume don't need what's pointed to by g_current_module
286-
** and specified_module
286+
** and g_specified_module
287287
**/
288288
null_free((void *) &newname);
289289
null_free((void *) &oldname);

aclocal.m4

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# aclocal.m4 generated automatically by aclocal 1.6 -*- Autoconf -*-
1+
# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*-
22

33
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
44
# Free Software Foundation, Inc.
@@ -800,9 +800,9 @@ _AM_IF_OPTION([no-define],,
800800
# Some tools Automake needs.
801801
AC_REQUIRE([AM_SANITY_CHECK])dnl
802802
AC_REQUIRE([AC_ARG_PROGRAM])dnl
803-
AM_MISSING_PROG(ACLOCAL, "aclocal-${am__api_version}")
803+
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
804804
AM_MISSING_PROG(AUTOCONF, autoconf)
805-
AM_MISSING_PROG(AUTOMAKE, "automake-${am__api_version}")
805+
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
806806
AM_MISSING_PROG(AUTOHEADER, autoheader)
807807
AM_MISSING_PROG(MAKEINFO, makeinfo)
808808
AM_MISSING_PROG(AMTAR, tar)
@@ -852,7 +852,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
852852
# Call AM_AUTOMAKE_VERSION so it can be traced.
853853
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
854854
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
855-
[AM_AUTOMAKE_VERSION([1.6])])
855+
[AM_AUTOMAKE_VERSION([1.6.2])])
856856

857857
# Helper functions for option handling. -*- Autoconf -*-
858858

@@ -1184,7 +1184,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
11841184
11851185
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
11861186
[$1], CXX, [depcc="$CXX" am_compiler_list=],
1187-
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
1187+
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11881188
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
11891189
[depcc="$$1" am_compiler_list=])
11901190
@@ -1309,7 +1309,13 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
13091309
[for mf in $CONFIG_FILES; do
13101310
# Strip MF so we end up with the name of the file.
13111311
mf=`echo "$mf" | sed -e 's/:.*$//'`
1312-
if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
1312+
# Check whether this is an Automake generated Makefile or not.
1313+
# We used to match only the files named `Makefile.in', but
1314+
# some people rename them; so instead we look at the file content.
1315+
# Grep'ing the first line is not enough: some people post-process
1316+
# each Makefile.in and add a new line on top of each file to say so.
1317+
# So let's grep whole file.
1318+
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
13131319
dirpart=`AS_DIRNAME("$mf")`
13141320
else
13151321
continue

cmdConflict.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
** **
2828
** ************************************************************************ **/
2929

30-
static char Id[] = "@(#)$Id: cmdConflict.c,v 1.3 2002/04/29 21:16:48 rkowen Exp $";
30+
static char Id[] = "@(#)$Id: cmdConflict.c,v 1.4 2002/08/02 22:11:23 rkowen Exp $";
3131
static void *UseId[] = { &UseId, Id };
3232

3333
/** ************************************************************************ **/
@@ -146,7 +146,7 @@ static int checkConflict( Tcl_Interp *interp,
146146

147147
if( S_ISDIR( stat_info.st_mode)) {
148148

149-
if( NULL == (new_modulelist = SortedDirList( interp, path,
149+
if( NULL == (new_modulelist = SortedDirList( path,
150150
modulelist[k], &new_nummodules)))
151151
continue;
152152

@@ -270,7 +270,7 @@ int cmdConflict( ClientData client_data,
270270
if( OK != ErrorLogger( ERR_MODULE_PATH, LOC, NULL))
271271
goto unwind0;
272272

273-
if((char **) NULL==(pathlist=SplitIntoList(interp, modulepath, &numpaths)))
273+
if((char **) NULL==(pathlist=SplitIntoList(modulepath, &numpaths)))
274274
goto success1;
275275

276276
/**
@@ -293,7 +293,7 @@ int cmdConflict( ClientData client_data,
293293
for( j = 0; j < numpaths; j++) {
294294

295295
if((char **)NULL == (modulelist
296-
= SortedDirList( interp, pathlist[j], argv[i], &nummodules)))
296+
= SortedDirList( pathlist[j], argv[i], &nummodules)))
297297
continue; /** not browseable **/
298298

299299
/**
@@ -421,7 +421,7 @@ int cmdPrereq( ClientData client_data,
421421
ErrorLogger( NO_ERR_DEBUG, LOC, "Got modulepath: '", modulepath, "'", NULL);
422422
#endif
423423

424-
if((char **) NULL==(pathlist=SplitIntoList(interp, modulepath, &numpaths)))
424+
if((char **) NULL==(pathlist=SplitIntoList(modulepath, &numpaths)))
425425
goto success1;
426426

427427
/**
@@ -447,7 +447,7 @@ int cmdPrereq( ClientData client_data,
447447
for( i=1; i<argc && argv[i] && notloaded_flag; i++) {
448448
for( j = 0; j < numpaths && notloaded_flag; j++) {
449449

450-
if((char **) NULL == (modulelist = SortedDirList(interp,pathlist[j],
450+
if((char **) NULL == (modulelist = SortedDirList(pathlist[j],
451451
argv[i], &nummodules)))
452452
continue;
453453

cmdInfo.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
** **
2929
** ************************************************************************ **/
3030

31-
static char Id[] = "@(#)$Id: cmdInfo.c,v 1.2 2001/06/09 09:48:46 rkowen Exp $";
31+
static char Id[] = "@(#)$Id: cmdInfo.c,v 1.3 2002/08/02 22:11:23 rkowen Exp $";
3232
static void *UseId[] = { &UseId, Id };
3333

3434
/** ************************************************************************ **/
@@ -92,7 +92,7 @@ static char _proc_cmdModuleInfo[] = "cmdModuleInfo";
9292
** before this function is **
9393
** called in order to control **
9494
** everything. **
95-
** specified_module The module name from the **
95+
** g_specified_module The module name from the **
9696
** command line. **
9797
** g_current_module The module which is handled **
9898
** by the current command **
@@ -327,7 +327,7 @@ int cmdModuleInfo( ClientData client_data,
327327
return( TCL_ERROR); /** -------- EXIT (FAILURE) -------> **/
328328
}
329329

330-
if( AliasLookup( argv[2], &s, &t)) {
330+
if( s = AliasLookup( argv[2])) {
331331
/* sprintf( buf, "%s/%s", s, t); */
332332
strcpy( buf, s);
333333
strcat( buf, "/");
@@ -380,9 +380,9 @@ int cmdModuleInfo( ClientData client_data,
380380
**/
381381

382382
} else if( !strcmp(argv[1], "specified")) {
383-
if( specified_module) {
383+
if( g_specified_module) {
384384
/* TCL_STATIC because it comes from the command line */
385-
Tcl_SetResult( interp, specified_module, TCL_STATIC);
385+
Tcl_SetResult( interp, g_specified_module, TCL_STATIC);
386386
} else {
387387
Tcl_SetResult( interp, "*undef*", TCL_STATIC);
388388
}

0 commit comments

Comments
 (0)