Skip to content

Commit

Permalink
"make install-binaries" now generates and installs a pkgIndex.tcl file.
Browse files Browse the repository at this point in the history
  • Loading branch information
wart committed Aug 18, 1999
1 parent f88978d commit e9c62b6
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 15 deletions.
62 changes: 50 additions & 12 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# library that we are building.
#========================================================================

BINARIES = $(TCLSHA_LIB_FILE)
lib_BINARIES=$(TCLSHA_LIB_FILE)
BINARIES=$(lib_BINARIES)

#========================================================================
# Enumerate the names of the source files included in this package.
Expand Down Expand Up @@ -151,6 +152,7 @@ TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@
TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@
TK_LIB_FILE = @TK_LIB_FILE@
TK_SRC_DIR = @TK_SRC_DIR@
TCLSH_PROG = @TCLSH_PROG@

AUTOCONF = autoconf

Expand All @@ -164,7 +166,7 @@ DEFS = @DEFS@ $(EXTRA_CFLAGS)

ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_FILES = mkIndex.tcl

CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
Expand Down Expand Up @@ -201,24 +203,58 @@ doc:

install: all install-binaries install-libraries install-doc

install-binaries: binaries
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(BINARIES)'; for p in $$list; do \
install-binaries: binaries install-lib-binaries install-bin-binaries

#========================================================================
# Install binary object libraries. On Windows this includes both .dll and
# .lib files. Because the .lib files are not explicitly listed anywhere,
# we need to deduce their existence from the .dll file of the same name.
# Additionally, the .dll files go into the bin directory, but the .lib
# files go into the lib directory. On Unix platforms, all library files
# go into the lib directory.
#========================================================================

install-lib-binaries: installdirs
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
ext=`echo $$p|sed -e "s/.*\.//"`; \
if test "x$$ext" = "xdll"; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
if test -f $$lib; then \
echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \
$(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \
fi; \
else \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
fi; \
else :; fi; \
done
@$(POST_INSTALL)
@list='$(BINARIES)'; for p in $$list; do \
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(RANLIB) $(DESTDIR)$(bindir)/$$p"; \
$(RANLIB) $(DESTDIR)$(bindir)/$$p; \
else :; fi; \
done
$(TCLSH_PROG) mkIndex.tcl

#========================================================================
# Install binary executables (e.g. .exe files)
#========================================================================

install-bin-binaries: installdirs
@list='$(bin_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
$(RANLIB) $(DESTDIR)$(libdir)/$$p; \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
else :; fi; \
done

install-libraries: libraries
$(mkinstalldirs) $(includedir)
$(mkinstalldirs) $(pkglibdir)
echo "Installing header files in $(includedir)"
@for i in $(GENERIC_HDRS) ; do \
echo "Installing $$i" ; \
Expand Down Expand Up @@ -302,6 +338,8 @@ uninstall-binaries:

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)

.PHONY: all binaries clean depend distclean doc install installdirs \
libraries test
Expand Down
3 changes: 3 additions & 0 deletions README.cygwin
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ Fourth step: Run vcvars32.bat. You must do this every time you wish to
run vcvars32.bat all the time. If you look in the vcvars32.bat
file you will see what system environment variables need to be
set in order to make this work.

Fifth step: Set your environment variable "MAKE_MODE" to have the value "UNIX"
This will set up the "make" program to operate in a more sane manner.
39 changes: 37 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1787,12 +1787,12 @@ AC_DEFUN(SC_MAKE_LIB, [
*win32* | *WIN32* | *CYGWIN_NT*)
if test "${CC-cc}" = "cl"; then
MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$]@_OBJECTS) "
MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$]@_OBJECTS) "
MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$]@_OBJECTS) "
fi
;;
*)
MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$]@_OBJECTS)"
MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$]@_OBJECTS) ${SHLIB_LD_LIBS}"
MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$]@_OBJECTS) \${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS}"
;;
esac
Expand All @@ -1807,3 +1807,38 @@ AC_DEFUN(SC_MAKE_LIB, [
AC_SUBST(MAKE_STATIC_LIB)
])

#------------------------------------------------------------------------
# SC_LIB_NAME --
#
# Compute the name of an existing object library located in libdir
# from the given base name.
#
# Arguments:
# basename The base name of the library without version
# numbers, extensions, or "lib" prefixes.
#
# Requires:
#
# Results:
#
# Defines the following vars:
# ${basename}_LIB_NAME The computed library name.
#------------------------------------------------------------------------
AC_DEFUN(SC_LIB_NAME, [
AC_MSG_CHECKING(for $1 library file)
eval "sc_lib_name_dir=${libdir}"
for i in \
`ls -dr ${sc_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
`ls -dr ${sc_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` ; do
if test -f "$i" ; then
$1_LIB_NAME=`basename $i`
break
fi
done
if test "x$1_LIB_NAME" = x ; then
AC_MSG_ERROR(not found)
else
AC_MSG_RESULT($1_LIB_NAME)
fi
])

23 changes: 22 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,29 @@ esac
AC_SUBST(TCLSHA_LIB_FILE)
AC_SUBST(SHLIB_LD_LIBS)

#--------------------------------------------------------------------
# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
# file during the install process. Don't run the TCLSH_PROG through
# ${CYGPATH} because it's being used directly by make.
#--------------------------------------------------------------------

AC_PATH_PROGS(TCLSH_PROG, tclsh8.2${EXEEXT} tclsh82${EXEEXT} tclsh${EXEEXT}, :, ${exec_prefix}:${PATH})

if test "x${TCLSH_PROG}" = "x:" ; then
AC_MSG_WARN(No tclsh executable found. You will have to build the pkgIndex.tcl file manually.)
fi
AC_SUBST(TCLSH_PROG)

#--------------------------------------------------------------------
# Some of our tool routines need native paths for these
#--------------------------------------------------------------------

exec_prefix_NATIVE=`${CYGPATH} ${exec_prefix}`
AC_SUBST(exec_prefix_NATIVE)

#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------

AC_OUTPUT([Makefile])
AC_OUTPUT([Makefile \
mkIndex.tcl])
7 changes: 7 additions & 0 deletions tcl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,9 @@ AC_DEFUN(SC_MAKE_LIB, [
# Defines the following vars:
# ${basename}_LIB_NAME The computed library name.
#------------------------------------------------------------------------

AC_DEFUN(SC_LIB_NAME, [
AC_MSG_CHECKING(for $1 library file)
eval "sc_lib_name_dir=${libdir}"
for i in \
`ls -dr ${sc_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
Expand All @@ -1822,4 +1824,9 @@ AC_DEFUN(SC_LIB_NAME, [
break
fi
done
if test "x$1_LIB_NAME" = x ; then
AC_MSG_ERROR(not found)
else
AC_MSG_RESULT($1_LIB_NAME)
fi
])

0 comments on commit e9c62b6

Please sign in to comment.