You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
compat: New directory for compatibility functions
Move all implementations that are meant for older systems to their own directory in order to be able to reuse the objects without copying *.c files around.
This commit is contained in:
+7
-2
@@ -7,7 +7,9 @@
|
||||
.c.o:
|
||||
${CC} -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED ${CFLAGS} ${CPPFLAGS} ${SHLIB_CFLAGS} $< -o $@
|
||||
|
||||
all:: ${SHLIB_NAME} pkgIndex.tcl
|
||||
PKGINDEX ?= pkgIndex.tcl
|
||||
|
||||
all:: ${SHLIB_NAME} ${PKGINDEX}
|
||||
|
||||
$(SHLIB_NAME): ${OBJS}
|
||||
${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS}
|
||||
@@ -20,7 +22,10 @@ clean::
|
||||
|
||||
distclean:: clean
|
||||
|
||||
install:: all
|
||||
INSTALLTARGET ?= install-real
|
||||
|
||||
install:: $(INSTALLTARGET)
|
||||
$(INSTALLTARGET):: all
|
||||
$(INSTALL) -d -o "${DSTUSR}" -g "${DSTGRP}" -m "${DSTMODE}" "${INSTALLDIR}"
|
||||
$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 ${SHLIB_NAME} "${INSTALLDIR}"
|
||||
$(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 pkgIndex.tcl "${INSTALLDIR}"
|
||||
|
||||
@@ -9294,7 +9294,7 @@ $as_echo "yes" >&6; }
|
||||
|
||||
|
||||
# Output
|
||||
ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/Makefile doc/base.mtree doc/macosx.mtree doc/macports.conf doc/prefix.mtree doc/pubkeys.conf portmgr/dmg/postflight setupenv.bash src/Makefile src/cregistry/Makefile src/darwintracelib1.0/Makefile src/machista1.0/Makefile src/macports1.0/Makefile src/macports1.0/macports_autoconf.tcl src/macports1.0/macports_test_autoconf.tcl src/mpcommon1.0/Makefile src/package1.0/Makefile src/package1.0/package_test_autoconf.tcl src/pextlib1.0/Makefile src/port/Makefile src/port1.0/Makefile src/port1.0/port_autoconf.tcl src/port1.0/port_test_autoconf.tcl src/programs/Makefile src/registry2.0/Makefile src/registry2.0/registry_autoconf.tcl tests/Makefile tests/test.tcl tests/test/library.tcl tests/test/trace/test.tcl vendor/Makefile"
|
||||
ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/Makefile doc/base.mtree doc/macosx.mtree doc/macports.conf doc/prefix.mtree doc/pubkeys.conf portmgr/dmg/postflight setupenv.bash src/Makefile src/cregistry/Makefile src/compat/Makefile src/darwintracelib1.0/Makefile src/machista1.0/Makefile src/macports1.0/Makefile src/macports1.0/macports_autoconf.tcl src/macports1.0/macports_test_autoconf.tcl src/mpcommon1.0/Makefile src/package1.0/Makefile src/package1.0/package_test_autoconf.tcl src/pextlib1.0/Makefile src/port/Makefile src/port1.0/Makefile src/port1.0/port_autoconf.tcl src/port1.0/port_test_autoconf.tcl src/programs/Makefile src/registry2.0/Makefile src/registry2.0/registry_autoconf.tcl tests/Makefile tests/test.tcl tests/test/library.tcl tests/test/trace/test.tcl vendor/Makefile"
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files vendor/tclsh"
|
||||
@@ -10013,6 +10013,7 @@ do
|
||||
"setupenv.bash") CONFIG_FILES="$CONFIG_FILES setupenv.bash" ;;
|
||||
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||
"src/cregistry/Makefile") CONFIG_FILES="$CONFIG_FILES src/cregistry/Makefile" ;;
|
||||
"src/compat/Makefile") CONFIG_FILES="$CONFIG_FILES src/compat/Makefile" ;;
|
||||
"src/darwintracelib1.0/Makefile") CONFIG_FILES="$CONFIG_FILES src/darwintracelib1.0/Makefile" ;;
|
||||
"src/machista1.0/Makefile") CONFIG_FILES="$CONFIG_FILES src/machista1.0/Makefile" ;;
|
||||
"src/macports1.0/Makefile") CONFIG_FILES="$CONFIG_FILES src/macports1.0/Makefile" ;;
|
||||
|
||||
@@ -413,6 +413,7 @@ AC_CONFIG_FILES([
|
||||
setupenv.bash
|
||||
src/Makefile
|
||||
src/cregistry/Makefile
|
||||
src/compat/Makefile
|
||||
src/darwintracelib1.0/Makefile
|
||||
src/machista1.0/Makefile
|
||||
src/macports1.0/Makefile
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ TCLPKG= cregistry \
|
||||
pextlib1.0 \
|
||||
machista1.0 \
|
||||
mpcommon1.0
|
||||
SUBDIR= ${TCLPKG} port programs
|
||||
SUBDIR= compat ${TCLPKG} port programs
|
||||
|
||||
ifeq (@TRACEMODE_SUPPORT@,1)
|
||||
TCLPKG+= darwintracelib1.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include ../../Mk/macports.autoconf.mk
|
||||
|
||||
ifneq ($(HAVE_GETDELIM),yes)
|
||||
OBJS+= strlcat.o
|
||||
endif
|
||||
ifneq ($(HAVE_GETLINE),yes)
|
||||
OBJS+= getline.o
|
||||
endif
|
||||
ifneq ($(HAVE_STRLCAT),yes)
|
||||
OBJS+= strlcat.o
|
||||
endif
|
||||
|
||||
# disable pkgIndex.tcl and install
|
||||
PKGINDEX=
|
||||
INSTALLTARGET=
|
||||
|
||||
include $(srcdir)/../../Mk/macports.tea.mk
|
||||
|
||||
distclean::
|
||||
rm -f Makefile
|
||||
@@ -33,6 +33,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_GETDELIM
|
||||
|
||||
#include "getdelim.h"
|
||||
@@ -32,6 +32,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_GETLINE
|
||||
|
||||
#if !HAVE_GETDELIM
|
||||
@@ -13,15 +13,15 @@
|
||||
** of space remaining.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
size_t strlcat(char *dst, const char *src, size_t size)
|
||||
{
|
||||
size_t used, length, copy;
|
||||
@@ -1,5 +1,10 @@
|
||||
#ifdef HAVE_STRLCAT
|
||||
#ifndef _STRLCAT_H
|
||||
#define _STRLCAT_H
|
||||
|
||||
#include <string.h>
|
||||
#else
|
||||
|
||||
#if !HAVE_STRLCAT
|
||||
size_t strlcat(char *dst, const char *src, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* _STRLCAT_H */
|
||||
@@ -24,9 +24,12 @@ SRCS = \
|
||||
OBJS = $(SRCS:%.c=%.o)
|
||||
|
||||
ifneq ($(HAVE_STRLCAT),yes)
|
||||
OBJS+= ../pextlib1.0/strlcat.o
|
||||
COMPAT_OBJS+= $(srcdir)/../compat/strlcat.o
|
||||
endif
|
||||
|
||||
CPPFLAGS+= -I../compat
|
||||
LIBS+= $(COMPAT_OBJS)
|
||||
|
||||
SHLIB_NAME = darwintrace$(SHLIB_SUFFIX)
|
||||
INSTALLDIR = $(DESTDIR)$(TCL_PACKAGE_PATH)/darwintrace1.0
|
||||
|
||||
|
||||
@@ -32,15 +32,18 @@ OBJS+=sip_copy_proc.o
|
||||
endif
|
||||
|
||||
ifneq ($(HAVE_GETDELIM),yes)
|
||||
OBJS+= strlcat.o
|
||||
COMPAT_OBJS+= ../compat/strlcat.o
|
||||
endif
|
||||
ifneq ($(HAVE_GETLINE),yes)
|
||||
OBJS+= getline.o
|
||||
COMPAT_OBJS+= ../compat/getline.o
|
||||
endif
|
||||
ifneq ($(HAVE_STRLCAT),yes)
|
||||
OBJS+= strlcat.o
|
||||
COMPAT_OBJS+= ../compat/strlcat.o
|
||||
endif
|
||||
|
||||
CPPFLAGS+= -I../compat
|
||||
LIBS+= $(COMPAT_OBJS)
|
||||
|
||||
SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
|
||||
INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/pextlib1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user