dslinux/user/bitchx/dll Make-windll.sh Makefile.in dllinit.c

stsp stsp at user.in-berlin.de
Sun Jul 2 15:18:32 CEST 2006


Update of /cvsroot/dslinux/dslinux/user/bitchx/dll
In directory antilope:/tmp/cvs-serv9280/dll

Added Files:
	Make-windll.sh Makefile.in dllinit.c 
Log Message:
Adding pristine copy of BitchX so I can branch from it.


--- NEW FILE: Makefile.in ---
# dll/Makefile.in
#
# This Makefile is used to create dll/dynamic link libs for BitchX

SHELL = @SHELL@

srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
topdir = @topdir@
prefix = @prefix@
exec_prefix = @exec_prefix@

bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = @oldincludedir@

local_dir = $(HOME)

# Where the BitchX binary will be installed.
# "make install" will compile and install the program.
INSTALL_IRC = @INSTALL_IRC@

# Where the BitchX library will be. Generally this is the place that
# you put the scripts, help pages and translation tables. It is
# very important that you set this correctly.
IRCLIB = @IRCLIB@

CC = @CC@
DEFS = @INCLUDES@
LIBS = @LIBS@

# Tcl library.
TCL_LIBS = @TCL_LIBS@

# These are for Tcl support.
TCL_OBJS = @TCL_OBJS@
# You don't have the following, so you'll want to leave this blank.
TCL_SRCS = @TCL_SRCS@

# Set this to -g if you want to be able to debug the client, otherwise
# use -O to have the compiler do some optimization instead.
CFLAGS = @CFLAGS@

# Set this to -s if you want the binary to be stripped.
LDFLAGS = @LDFLAGS@

# These are for the cd device player.
CD_SRCS = @CD_SRCS@
CD_OBJS = @CD_OBJS@

# This is the executable suffix for the target operating system.
EXEEXT = @EXEEXT@

# Extra files.
DEFAULT_CTOOLZ_DIR = @DEFAULT_CTOOLZ_DIR@
DEFAULT_MSGLOGFILE = @DEFAULT_MSGLOGFILE@
DEFAULT_BITCHX_HELP_FILE = @DEFAULT_BITCHX_HELP_FILE@
DEFAULT_SCRIPT_HELP_FILE = @DEFAULT_SCRIPT_HELP_FILE@
DEFAULT_BITCHX_KICK_FILE = @DEFAULT_BITCHX_KICK_FILE@
DEFAULT_BITCHX_QUIT_FILE = @DEFAULT_BITCHX_QUIT_FILE@
DEFAULT_BITCHX_IRCNAME_FILE = @DEFAULT_BITCHX_IRCNAME_FILE@

# Full path of the directory for BitchX help files.
HELPDIR = @HELPDIR@

# Full path of the directory for the BitchX scripts.
INSTALL_SCRIPT = @INSTALL_SCRIPT@

# Default setting for IRCPATH where BitchX will look for
# its script files if the environment variable is undefined.
# Usually, this should contain the same path as used for INSTALL_SCRIPT in
# the Makefile, but it can contain multiple path elements
# separated by colons. The path MUST lead to an existing directory,
# because the 'global' script is expected to be found there.
IRCPATH = @IRCPATH@

# Path for TRANSLATION variable.
TRANSLATION_PATH = @TRANSLATION_PATH@

# This command will be used to install the BitchX help files. If you don't
# want to install them, replace with the following:
# INSTALL_HELP_CMD = @echo The help files have not been installed.
INSTALL_HELP_CMD = @INSTALL_HELP_CMD@

# This is where the optional plugins will be copied to.
PLUGINDIR = @PLUGINDIR@

# Plugin flags.
SHLIB_LD = @SHLIB_LD@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@

# This command will be used to install the BitchX files on Win32/OS2EMX
# systems.
WINNT_INSTALL = @WINNT_INSTALL@

# This program allows you to use screen/xterm's to put new BitchX windows
# on new screen/xterm windows.
INSTALL_WSERV = @INSTALL_WSERV@

# This program allows you to screen BitchX and reattach to it later.
INSTALL_SCRBX = @INSTALL_SCRBX@

# Set gzip and bzip2 options.
GZIP_ENV = @GZIP_ENV@
BZIP2 = @BZIP2@

# Standard programs.
RM = @RM@
LN = @LN_S@
CP = @CP@
MV = @MV@

INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

VERSION = @VERSION@
_VERSION_ = @_VERSION_@

MAKE_BIN = @MAKE@
MAKE = $(MAKE_BIN) $(MFLAGS)
MFLAGS = \
	'local_dir=$(HOME)'			\
	'INSTALL_IRC=$(INSTALL_IRC)'		\
	'IRCLIB=$(IRCLIB)'			\
	'CC=$(CC)'				\
	'CFLAGS=$(CFLAGS)'			\
	'HELPDIR=$(HELPDIR)'			\
        'INSTALL_WSERV=$(INSTALL_WSERV)'	\
	'IRCPATH=$(IRCPATH)'			\
	'TRANSLATION_PATH=$(TRANSLATION_PATH)'	\
	'LDFLAGS=$(LDFLAGS)'			\
	'LIBS=$(LIBS)'				\
	'LN=$(LN)'				\
	'RM=$(RM)'				\
	'TCL_SRCS=$(TCL_SRCS)'			\
	'TCL_OBJS=$(TCL_OBJS)'			\
	'CD_PLAY=$(CD_PLAY)'			\
	'CD_SRCS=$(CD_SRCS)'			\
	'CD_OBJS=$(CD_OBJS)'			\
	'TCL_LIBS=$(TCL_LIBS)'			\
	'PLUGINDIR=$(PLUGINDIR)'		\
	'_VERSION_=$(_VERSION_)'		\
	'VERSION=$(VERSION)'			\
	'INSTALL_DATA=$(INSTALL_DATA)'		\
	'INSTALL_SCRIPT=$(INSTALL_SCRIPT)'	\
	'EXEEXT=$(EXEEXT)'			\
	'SHLIB_CFLAGS=$(SHLIB_CFLAGS)'		\
	'SHLIB_SUFFIX=$(SHLIB_SUFFIX)'

## Makefile starts here.

ALL_PLUGINS = abot acro aim amp arcfour autocycle blowfish cavlink cdrom encrypt europa fserv hint identd nap nicklist pkga possum qbx qmail scan wavplay xmms

#PLUGINS = abot acro aim arcfour autocycle blowfish cavlink encrypt europa fserv hint identd nap pkga possum qbx qmail scan wavplay
PLUGINS = @PLUGINS@

.c.o:
	$(CC) $(DEFS) $(CFLAGS) -c $<

$(SHLIB_SUFFIX).o:
	$(SHLIB_LD) $(SHLIB_CFLAGS) $< -o $@$(SHLIB_SUFFIX)

all: Makefile dllinit.o
	@( \
		makeflags=$$2; \
		target="$@"; \
		list="$(PLUGINS)"; \
		for subdir in $$list; do \
			(cd $$subdir && $(MAKE) $$target) \
			|| case "$$makeflags" in *=*) exit 1;; *k*) ;; *) exit 1;; esac; \
		done; \
	)

Makefile: $(srcdir)/Makefile.in
	cd $(topdir) \
	  && $(SHELL) ./config.status

dummy:

dllinit.o:
	@( \
		if test x"$(PLUGINS)" != x""; then \
			$(CC) $(DEFS) $(CFLAGS) -c $(srcdir)/dllinit.c; \
		fi; \
	)

install: all
	$(INSTALL) -d $(PLUGINDIR)
	@( \
		makeflags=$$2; \
		target="$@"; \
		list="$(PLUGINS)"; \
		for subdir in $$list; do \
			(cd $$subdir && $(MAKE) $$target) \
			|| case "$$makeflags" in *=*) exit 1;; *k*) ;; *) exit 1;; esac; \
		done; \
	)
	@( \
		if test x"$(PLUGINS)" != x""; then \
			strip --strip-unneeded $(PLUGINDIR)/*$(SHLIB_SUFFIX) || :; \
			echo Your plugins [$(PLUGINS)] are now located in $(PLUGINDIR);\
		fi; \
	)

install_local: all
	$(INSTALL) -d $(local_dir)/.BitchX/plugins
	@( \
		makeflags=$$2; \
		target="$@"; \
		list="$(PLUGINS)"; \
		for subdir in $$list; do \
			(cd $$subdir && $(MAKE) 'PLUGINDIR=$(local_dir)/.BitchX' $$target) \
			|| case "$$makeflags" in *=*) exit 1;; *k*) ;; *) exit 1;; esac; \
		done; \
	)
	@( \
		if test x"$(PLUGINS)" != x""; then \
			echo Your plugins [$(PLUGINS)] are now located in $(PLUGINDIR) ;\
		fi; \
	)

clean: dummy
	@( \
		makeflags=$$2; \
		target="$@"; \
		list="$(PLUGINS)"; \
		for subdir in $$list; do \
			(cd $$subdir && $(MAKE) $$target) \
			|| case "$$makeflags" in *=*) exit 1;; *k*) ;; *) exit 1;; esac; \
		done; \
	)
	-$(RM) *~ *.o *$(SHLIB_SUFFIX)

distclean: clean
	@( \
		makeflags=$$2; \
		target="$@"; \
		list="$(ALL_PLUGINS)"; \
		for subdir in $$list; do \
			(cd $$subdir && $(MAKE) $$target) \
			|| case "$$makeflags" in *=*) exit 1;; *k*) ;; *) exit 1;; esac; \
		done; \
	)
	-$(RM) Makefile

--- NEW FILE: dllinit.c ---
#ifdef WINNT
/* dllinit.c -- Portable DLL initialization.
   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
   Contributed by Mumit Khan (khan at xraylith.wisc.edu).

   I've used DllMain as the DLL "main" since that's the most common
   usage. MSVC and Mingw32 both default to DllMain as the standard
   callback from the linker entry point. Cygwin, as of b20.1, also
   uses DllMain as the default callback from the entry point.

   The real entry point is typically always defined by the runtime
   library, and usually never overridden by (casual) user. What you can
   override however is the callback routine that the entry point calls,
   and this file provides such a callback function, DllMain.

   Mingw32: The default entry point for mingw32 is DllMainCRTStartup
   which is defined in libmingw32.a This in turn calls DllMain which is
   defined here. If not defined, there is a stub in libmingw32.a which
   does nothing.

   Cygwin: The default entry point for Cygwin b20.1 or newer is
   __cygwin_dll_entry which is defined in libcygwin.a. This in turn
   calls the routine DllMain. If not defined, there is a stub in
   libcygwin.a which does nothing.

   MSVC: MSVC runtime calls DllMain, just like Mingw32.

   Summary: If you need to do anything special in DllMain, just add it
   here. Otherwise, the default setup should be just fine for 99%+ of
   the time. I strongly suggest that you *not* change the entry point,
   but rather change DllMain as appropriate.

 */


#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <stdio.h>

BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,
                       LPVOID reserved /* Not used. */ );

/*
 *----------------------------------------------------------------------
 *
 * DllMain --
 *
 *	This routine is called by the Mingw32, Cygwin32 or VC++ C run
 *	time library init code, or the Borland DllEntryPoint routine. It
 *	is responsible for initializing various dynamically loaded
 *	libraries.
 *
 * Results:
 *      TRUE on sucess, FALSE on failure.
 *
 * Side effects:
 *
 *----------------------------------------------------------------------
 */
BOOL APIENTRY
DllMain (
	 HINSTANCE hInst /* Library instance handle. */ ,
	 DWORD reason /* Reason this function is being called. */ ,
	 LPVOID reserved /* Not used. */ )
{

  switch (reason)
    {
    case DLL_PROCESS_ATTACH:
      break;

    case DLL_PROCESS_DETACH:
      break;

    case DLL_THREAD_ATTACH:
      break;

    case DLL_THREAD_DETACH:
      break;
    }
  return TRUE;
}
#endif

--- NEW FILE: Make-windll.sh ---
#!/bin/sh
# Make .def file:

export LIBPATH=/usr/local/cygwin-new/i586-pc-cygwin/lib
export LD=/usr/local/cygwin-new/bin/i586-pc-cygwin-ld
export NM=/usr/local/cygwin-new/bin/i586-pc-cygwin-nm
export DLLTOOL=/usr/local/cygwin-new/bin/i586-pc-cygwin-dlltool
export AS=/usr/local/cygwin-new/bin/i586-pc-cygwin-as
export GCC=/usr/local/cygwin-new/bin/i586-pc-cygwin-gcc
RM=rm
CP=cp

$GCC -c init.cc 
$GCC -c fixup.cc
$GCC -I../include -c pkga.c 
$GCC -I../include -c scan.c 

echo EXPORTS > pkga.def
$NM pkga.o init.o fixup.o | grep '^........ [T] _' | sed 's/[^_]*_//' >> pkga.def

# Link DLL.
$LD --base-file pkga.base --dll -o pkga.dll pkga.o init.o fixup.o\
 $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12
$DLLTOOL --as=$AS --dllname pkga.dll --def pkga.def --base-file\
 pkga.base --output-exp pkga.exp
$LD --base-file pkga.base pkga.exp --dll -o pkga.dll pkga.o\
 init.o fixup.o $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12
$DLLTOOL --as=$AS --dllname pkga.dll --def pkga.def --base-file\
 pkga.base --output-exp pkga.exp
$LD pkga.exp --dll -o pkga.dll pkga.o init.o fixup.o\
 $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12

# Build the pkgaB.a lib to link to:
$DLLTOOL --as=$AS --dllname pkga.dll --def pkga.def --output-lib pkga.a

echo EXPORTS > scan.def
$NM scan.o init.o fixup.o | grep '^........ [T] _' | sed 's/[^_]*_//' >> scan.def

# Link DLL.
$LD --base-file scan.base --dll -o scan.dll scan.o init.o fixup.o\
 $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12
$DLLTOOL --as=$AS --dllname scan.dll --def scan.def --base-file\
 scan.base --output-exp scan.exp
$LD --base-file scan.base scan.exp --dll -o scan.dll scan.o\
 init.o fixup.o $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12
$DLLTOOL --as=$AS --dllname scan.dll --def scan.def --base-file\
 scan.base --output-exp scan.exp
$LD scan.exp --dll -o scan.dll scan.o init.o fixup.o\
 $LIBPATH/libcygwin.a $LIBPATH/libkernel32.a -e _dll_entry at 12

# Build the scanB.a lib to link to:
$DLLTOOL --as=$AS --dllname scan.dll --def scan.def --output-lib scan.a

$RM *.base *.def *.exp
(cd abot; sh ./abot.sh)
(cd acro; sh ./acro.sh)
(cd blowfish; sh ./blowfish.sh)
(cd possum; sh ./possum.sh)
(cd hint; sh ./hint.sh)
(cd cavlink; sh ./cavlink.sh)
(cd identd; sh ./identd.sh)
(cd encrypt; sh ./encrypt.sh)
(cd fserv; sh ./fserv.sh)
(cd nap; sh ./nap.sh)





More information about the dslinux-commit mailing list