Fix LibVer support.

This commit is contained in:
agibert
2003-01-17 08:06:57 +00:00
parent 9bb2b42716
commit a0addad286
5 changed files with 85 additions and 65 deletions

View File

@@ -1,17 +1,20 @@
ifdef _LIBVER_SUPPORT
DEP_VER_STATIC = ../../libver/ver.h ../../libver/libver.a
DEP_VER_DYNAMIC = ../../libver/ver.h ../../libver/libver.so
LIB_VER_STATIC = -I ../../libver ../../libver/libver.a
LIB_VER_DYNAMIC = -I ../../libver -L ../../libver -lver
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so
INCLUDE += -I ../../libver
LIBDIR += -L ../../libver
LIB_STATIC += ../../libver/libver.a
LIB_DYNAMIC += -lver
FLAG_VER = -D_LIBVER_SUPPORT
endif
all: ndbench ndbench-static
ndbench-static: ndbench.c $(DEP_VER_STATIC) ../lib/node.h ../lib/libnode.a Makefile
gcc -g -o ndbench-static -I ../lib ndbench.c -ldl $(LIB_VER_STATIC) ../lib/libnode.a
ndbench-static: ndbench.c $(DEP_STATIC) ../lib/node.h ../lib/libnode.a Makefile
gcc -g -o ndbench-static $(FLAG_VER) $(INCLUDE) -I ../lib ndbench.c -ldl $(LIB_STATIC) ../lib/libnode.a
ndbench: ndbench.c $(DEP_VER_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile
gcc -g -o ndbench -ldl $(LIB_VER_DYNAMIC) -I ../lib -L ../lib -lnode ndbench.c
ndbench: ndbench.c $(DEP_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile
gcc -g -o ndbench -ldl $(FLAG_VER) $(INCLUDE) -I ../lib $(LIBDIR) -L ../lib $(LIB_DYNAMIC) -lnode ndbench.c
clean:
rm -f ndbench ndbench-static

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/
/* $RCSfile: ndbench.c,v $ */
/*---------------------------------------------------------------------------------*/
/* $Revision: 2.4 $ */
/* $Revision: 2.5 $ */
/* $Name: $ */
/* $Date: 2002/07/29 14:55:57 $ */
/* $Date: 2003/01/17 08:11:11 $ */
/* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/
@@ -64,8 +64,12 @@
/* Defines */
/*---------------------------------------------------------------------------------*/
#ifdef _LIBVER
VER_INFO_EXPORT( ndbench, "$Revision: 2.4 $", "$Name: $", __FILE__, "$Author: agibert $")
#ifdef _LIBVER_SUPPORT
VER_INFO_EXPORT( ndbench, "$Revision: 2.5 $", "$Name: $", __FILE__, "$Author: agibert $")
# define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#else
# define USAGE "Usage : %s [ --help | --batch_run <batch_file_name>]\n"
#endif
#define ND_MODE 1
@@ -73,8 +77,6 @@ VER_INFO_EXPORT( ndbench, "$Revision: 2.4 $", "$Name: $", __FILE__, "$Author: a
#define USAGE "Usage : %s [ --help | --version [-v] | --batch_run <batch_file_name>]\n"
#define QUIT 0
#define DS_OPEN 1
#define DS_CLOSE 2
@@ -262,7 +264,7 @@ NDT_Status Module_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT_Nod
Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.4 $ $Name: $ $Date: 2002/07/29 14:55:57 $ $Author: agibert $";
*Version_Name_Ptr = "$Revision: 2.5 $ $Name: $ $Date: 2003/01/17 08:11:11 $ $Author: agibert $";
return( NDS_OK);
}
@@ -1409,21 +1411,19 @@ int main( int argc, char ** argv)
fprintf( stderr, USAGE, argv[0]);
return( 1);
}
#ifdef _LIBVER_SUPPORT
else if( !strcmp( argv[1], "--version"))
{
if( argc >= 3 && !strcmp( argv[2], "-v"))
{
#ifdef _LIBVER_SUPPORT
return( VER_Object_Print( stdout, VERD_VERBOSE));
#endif
}
else
{
#ifdef _LIBVER_SUPPORT
return( VER_Object_Print( stdout, VERD_MINIMAL));
#endif
return( VER_Object_Print( stdout, VERD_MINIMAL));
}
}
#endif
else if( !strcmp( argv[1], "--batch_run"))
{
/* Batch Mode */