1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Cleanups.

committer: mfx <mfx> 1074623253 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2004-01-20 18:27:33 +00:00
parent f4022af48a
commit 19564ed27e
6 changed files with 75 additions and 90 deletions

View File

@ -88,11 +88,25 @@ endif
# /***********************************************************************
# // compression library
# // compression libraries
# ************************************************************************/
ifeq ($(WITH_ZLIB),1)
DOS_LDLIBS += zlib.lib
ZLIBDIR:=$(strip $(subst \,/,$(ZLIBDIR)))
ifneq ($(strip $(wildcard $(ZLIBDIR))),)
ifneq ($(strip $(wildcard $(ZLIBDIR)/include/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)/include
else
ifneq ($(strip $(wildcard $(ZLIBDIR)/src/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)/src
else
ifneq ($(strip $(wildcard $(ZLIBDIR)/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)
endif
endif
endif
endif
endif
UCLDIR:=$(strip $(subst \,/,$(UCLDIR)))
@ -132,7 +146,7 @@ endif
###
### linux
### linux - gcc
###
ifeq ($(target),linux)
@ -144,7 +158,6 @@ endif
DEFS += -D_FILE_OFFSET_BITS=64
LDLIBS += -lmcheck
##CFLAGS_WERROR = -Werror
ifeq ($(DEBUG),1)
else
##LDFLAGS += -static
@ -154,7 +167,6 @@ else
endif
endif
CHMOD_EXE = chmod 755 $@
endif # linux
@ -197,7 +209,6 @@ LINK_EXE_OUTPUT = -o $@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
CFLAGS = $(CFLAGS_WERROR)
ifeq ($(DEBUG),1)
CFLAGS += -g -O0
@ -205,7 +216,6 @@ else
CFLAGS += -O2
endif
LDFLAGS += -Wl,-Map,$T.map
endif
@ -223,7 +233,6 @@ LINK_EXE_OUTPUT = -o $@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
##CFLAGS += -Minform=info
CXXFLAGS = $(CFLAGS) -tused
ifeq ($(DEBUG),1)
@ -390,18 +399,11 @@ CFLAGS_OUTPUT = -o$@
LDFLAGS = -ls
LINK_EXE_OUTPUT = -e$@
LDLIBS = $(DOS_LDLIBS)
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq ($(DEBUG),1)
CFLAGS += -Od -d
else
CFLAGS += -O2 -d
endif
endif # win32-bc
@ -420,18 +422,11 @@ CFLAGS_OUTPUT = -o$@
LDFLAGS = -L/map
LINK_EXE_OUTPUT = -o$@
LDLIBS = $(DOS_LDLIBS)
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq ($(DEBUG),1)
CFLAGS += -o- -g -s
else
CFLAGS += -o
endif
endif # win32-dm
@ -450,12 +445,6 @@ LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq (1,2)
# statically link libc.lib
CC += -ML
@ -473,10 +462,32 @@ else
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win32-ic
###
### win32 - Metrowerks C++
###
ifeq ($(target),win32-mwerks)
o = .obj
a = .lib
e = .exe
CC = mwcc -runtime ss -gccinc
CFLAGS = -w on
CXXFLAGS = $(CFLAGS)
CFLAGS_OUTPUT = -o $@
LDFLAGS = -map $T.map
LINK_EXE_OUTPUT = -o $@
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -opt full
else
CFLAGS +=
endif
endif # win32-mwerks
###
### win32 - Symantec C++
###
@ -492,18 +503,11 @@ CFLAGS_OUTPUT = -o$@
LDFLAGS = -L/map
LINK_EXE_OUTPUT = -o$@
LDLIBS = $(DOS_LDLIBS)
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq ($(DEBUG),1)
CFLAGS += -o- -g -s
else
CFLAGS += -o
endif
endif # win32-sc
@ -522,12 +526,6 @@ LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq (1,1)
# statically link libc.lib
CC += -ML
@ -546,7 +544,6 @@ else
##LINK_EXE_LDFLAGS += /opt:nowin98
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win32-vc
@ -566,7 +563,6 @@ CFLAGS_OUTPUT = -fo=$@
LDFLAGS = -k0x100000 -fm
LINK_EXE_OUTPUT = -fe=$@
LDLIBS = $(DOS_LDLIBS)
CC_SRC = $(subst /,\\,$<)
CXX_SRC = $(subst /,\\,$<)
INCLUDES := $(strip $(subst /,\\,$(INCLUDES)))
@ -575,24 +571,17 @@ ifeq (1,2)
export WCL386
INCLUDES :=
endif
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq ($(DEBUG),1)
CFLAGS +=
else
# note: it seems that the optimizer is generating bad code with `-ox'
CFLAGS += -olr
endif
endif # win32-wc
###
### win64 - Intel C++ [IA64]
### win64 - Intel C++ [Itanium]
###
ifeq ($(target),win64-ic)
@ -606,12 +595,6 @@ LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq (1,2)
# statically link libc.lib
CC += -ML
@ -629,12 +612,11 @@ else
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win64-ic
###
### win64 - Visual C++ [AMD64 & IA64]
### win64 - Visual C++ [AMD64 or Itanium]
###
ifeq ($(target),win64-vc)
@ -648,12 +630,6 @@ LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
endif
export LIB
ifeq (1,1)
# statically link libc.lib
CC += -ML
@ -671,12 +647,11 @@ else
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win64-vc
# /***********************************************************************
# // malloc debuggers and memory checkers - somewhat obsolete, use valgrind
# // malloc debuggers and memory checkers - obsolete, use valgrind
# ************************************************************************/
ifeq (1,2)

View File

@ -37,6 +37,9 @@
**************************************************************************/
#include "acc/acc.h"
#if (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
# undef HAVE_UTIME_H /* this pulls in <windows.h> */
#endif
#include "acc/acc_incd.h"
#include "acc/acc_ince.h"
#include "acc/acc_lib.h"

View File

@ -21,22 +21,25 @@
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef EOF
#include <stdio.h>
#include <string.h>
#endif
#undef progname
#undef PROGNAME
#if 1
#define progname(x) (x)
#define PROGNAME(x) (x)
#else
#include "conf.h"
static const char *my_progname(const char *argv0)
{
UNUSED(argv0);
return progname ? progname : argv0;
}
#define progname my_progname
#define PROGNAME(x) my_progname(x)
#endif
/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
long-named option. Because this is not POSIX.2 compliant, it is
being phased out. */
@ -425,7 +428,7 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
{
if (opterr)
fprintf (stderr, "%s: unrecognized option `%s'\n",
progname(argv[0]), argv[optind]);
PROGNAME(argv[0]), argv[optind]);
nextchar += strlen (nextchar);
optind++;
return BAD_OPTION;
@ -434,7 +437,7 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
{
if (opterr)
fprintf (stderr, "%s: option `%s' is ambiguous\n",
progname(argv[0]), argv[optind]);
PROGNAME(argv[0]), argv[optind]);
nextchar += strlen (nextchar);
optind++;
return BAD_OPTION;
@ -461,12 +464,12 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
/* --option */
fprintf (stderr,
"%s: option `--%s' doesn't allow an argument\n",
progname(argv[0]), pfound->name);
PROGNAME(argv[0]), pfound->name);
else
/* +option or -option */
fprintf (stderr,
"%s: option `%c%s' doesn't allow an argument\n",
progname(argv[0]), argv[optind - 1][0], pfound->name);
PROGNAME(argv[0]), argv[optind - 1][0], pfound->name);
}
nextchar += strlen (nextchar);
return BAD_OPTION;
@ -484,7 +487,7 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
{
if (opterr)
fprintf (stderr, "%s: option `--%s%s' requires an argument\n",
progname(argv[0]), pfound->name,
PROGNAME(argv[0]), pfound->name,
(pfound->has_arg & 0x20) ? "=" : "");
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : BAD_OPTION;
@ -515,11 +518,11 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, "%s: unrecognized option `--%s'\n",
progname(argv[0]), nextchar);
PROGNAME(argv[0]), nextchar);
else
/* +option or -option */
fprintf (stderr, "%s: unrecognized option `%c%s'\n",
progname(argv[0]), argv[optind][0], nextchar);
PROGNAME(argv[0]), argv[optind][0], nextchar);
}
nextchar = empty_string;
optind++;
@ -545,12 +548,12 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
#if 0
if (c < 040 || c >= 0177)
fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
progname(argv[0]), c);
PROGNAME(argv[0]), c);
else
fprintf (stderr, "%s: unrecognized option `-%c'\n", progname(argv[0]), c);
fprintf (stderr, "%s: unrecognized option `-%c'\n", PROGNAME(argv[0]), c);
#else
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: illegal option -- %c\n", progname(argv[0]), c);
fprintf (stderr, "%s: illegal option -- %c\n", PROGNAME(argv[0]), c);
#endif
}
optopt = c;
@ -586,11 +589,11 @@ static int _getopt_internal (int argc, char **argv, const char *optstring,
{
#if 0
fprintf (stderr, "%s: option `-%c' requires an argument\n",
progname(argv[0]), c);
PROGNAME(argv[0]), c);
#else
/* 1003.2 specifies the format of this message. */
fprintf (stderr, "%s: option requires an argument -- %c\n",
progname(argv[0]), c);
PROGNAME(argv[0]), c);
#endif
}
optopt = c;
@ -697,6 +700,7 @@ main (argc, argv)
#endif /* TEST */
/*
vi:ts=4:et:nowrap
*/

View File

@ -19,7 +19,7 @@
#define __MFX_GETOPT_H 1
#ifdef __cplusplus
//extern "C" {
/* extern "C" { */
#endif
/* For communication from `getopt' to the caller.
@ -96,7 +96,7 @@ int mfx_getopt_long(int argc, char **argv, const char *shortopts,
const struct mfx_option *longopts, int *longind);
#ifdef __cplusplus
//}
/* } */
#endif
#endif /* _GETOPT_H */
#endif /* __MFX_GETOPT_H */

View File

@ -34,7 +34,7 @@
#include "acc/acc_cxx.h"
#define NOTHROW ACC_CXX_NOTHROW
#define DISABLE_NEW_DELETE ACC_CXX_DISABLE_NEW_DELETE_STRICT
#define DISABLE_NEW_DELETE ACC_CXX_DISABLE_NEW_DELETE
/*************************************************************************

View File

@ -35,13 +35,16 @@
#define ALWAYS_CHMOD 1
#if defined(__DJGPP__)
# define USE_FTIME
# define USE_FTIME 1
# undef ALWAYS_CHMOD
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
# include <utime.h>
# define USE_UTIME 1
#elif ((ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_CC_INTELC || ACC_CC_MSC))
# define USE__FUTIME
# define USE__FUTIME 1
# undef ALWAYS_CHMOD
#elif defined(HAVE_UTIME)
# define USE_UTIME
# define USE_UTIME 1
#endif
#if !defined(SH_DENYRW)