diff --git a/configure/os/CONFIG.aix-ppc-gnu.aix-ppc-gnu b/configure/os/CONFIG.aix-ppc-gnu.aix-ppc-gnu new file mode 100644 index 000000000..a4622c6db --- /dev/null +++ b/configure/os/CONFIG.aix-ppc-gnu.aix-ppc-gnu @@ -0,0 +1,22 @@ +# CONFIG.aix-ppc.aix-ppc +# +# +# Definitions for aix-ppc host - aix-ppc target builds +# Sites may override these definitions in CONFIG_SITE.aix-ppc.aix-ppc +#------------------------------------------------------- + +# Include common gnu compiler definitions +include $(CONFIG)/CONFIG.gnuCommon + +GNU_DIR = /usr/common/usg/gcc/3.2.1 + +CC = $(GNU_BIN)/gcc +CCC = $(GNU_BIN)/g++ + +AR = ar +ARFLAGS = rcv +RANLIB = ranlib -t + +SHRLIB_LDFLAGS = -shared +LOADABLE_SHRLIB_LDFLAGS = -shared + diff --git a/configure/os/CONFIG_SITE.darwin-ppc.Common b/configure/os/CONFIG_SITE.darwin-ppc.Common new file mode 100644 index 000000000..40c2ebb20 --- /dev/null +++ b/configure/os/CONFIG_SITE.darwin-ppc.Common @@ -0,0 +1,11 @@ +# CONFIG_SITE.darwin-ppc.Common +# +# $Id$ +# This file is maintained by the build community. +# +# Site override definitions for darwin-ppc host builds +#------------------------------------------------------- + +# JBA test override values +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 diff --git a/src/libCom/macLib/macEnv.c b/src/libCom/macLib/macEnv.c new file mode 100644 index 000000000..6a096b753 --- /dev/null +++ b/src/libCom/macLib/macEnv.c @@ -0,0 +1,45 @@ +/*************************************************************************\ +* Copyright (c) 2003 The University of Chicago, as Operator of Argonne +* National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* $Id$ + * + * Macro expansion of environment variables + */ + +#include +#include +#include + +#define epicsExportSharedSymbols +#include +#include +#include "macLib.h" + +char * epicsShareAPI +macEnvExpand(char *str) +{ + MAC_HANDLE *handle; + static char *pairs[] = { "", "environ", NULL, NULL }; + int destCapacity = 200; + char *dest = NULL; + int n; + char *ret; + + assert(macCreateHandle(&handle, pairs) == 0); + do { + destCapacity *= 2; + assert((dest = realloc(dest, destCapacity)) != 0); + n = macExpandString(handle, str, dest, destCapacity); + } while (n >= (destCapacity - 1)); + if (n < 0) + ret = NULL; + else + ret = epicsStrDup(dest); + free(dest); + assert(macDeleteHandle(handle) == 0); + return ret; +} diff --git a/src/libCom/test/macEnvExpandTest.c b/src/libCom/test/macEnvExpandTest.c new file mode 100644 index 000000000..badb4e742 --- /dev/null +++ b/src/libCom/test/macEnvExpandTest.c @@ -0,0 +1,58 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* + * $Id$ + */ + +#include +#include +#include +#include + +#include "macLib.h" +#include "envDefs.h" + +int +check(char *str, char *expect) +{ + char *got = macEnvExpand(str); + if(expect && !got) { + printf("Expand \"%s'\". Got NULL, expected \"%s\".\n", str, expect); + return 1; + } + if (!expect && got) { + printf("Expand \"%s'\". Got \"%s\", expected NULL.\n", str, got); + return 1; + } + if(expect && got && strcmp(got, expect)) { + printf("Expand \"%s'\". Got \"%s\", expected \"%s\".\n", str, got, expect); + return 1; + } + return 0; +} + +int macEnvExpandTest(void) +{ + int bad = 0; + + epicsEnvSet("FOO","BLETCH"); + epicsEnvSet("BAR","GLEEP"); + bad |= check ("${FOO}", "BLETCH"); + bad |= check ("${FOO}/${BAR}", "BLETCH/GLEEP"); + bad |= check ("${FOOBAR}", NULL); + epicsEnvSet("FOO","${BAR}"); + epicsEnvSet("BAR","${STR1}"); + epicsEnvSet("STR1","VAL1"); + epicsEnvSet("STR2","VAL2"); + bad |= check ("${FOO}", "VAL1"); + epicsEnvSet("BAR","${STR2}"); + bad |= check ("${FOO}", "VAL2"); + return bad; +} diff --git a/src/libCom/test/macEnvExpandTestMain.cpp b/src/libCom/test/macEnvExpandTestMain.cpp new file mode 100644 index 000000000..c321fce2b --- /dev/null +++ b/src/libCom/test/macEnvExpandTestMain.cpp @@ -0,0 +1,20 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* $Id$ + */ + +extern "C" { +int macEnvExpandTest ( void ); +} + +int main ( int , char *[] ) +{ + return macEnvExpandTest (); +} diff --git a/src/makeBaseExt/top/configure/RULES_PYTHON b/src/makeBaseExt/top/configure/RULES_PYTHON new file mode 100644 index 000000000..29b981f90 --- /dev/null +++ b/src/makeBaseExt/top/configure/RULES_PYTHON @@ -0,0 +1,48 @@ +ifdef T_A +ifeq ($(findstring Host,$(VALID_BUILDS)),Host) + +SWIG ?= swig + +vpath %.py $(USR_VPATH) $(ALL_SRC_DIRS) + +# The optional PYTHON_INSTALL_LOCATION environment variable +# should be set to /site-packages +PYTHON_INSTALL_LOCATION ?= $(INSTALL_LOCATION)/lang/python + +INSTALL_PYTHON = $(PYTHON_INSTALL_LOCATION)/$(PYTHON_PACKAGE) + +PYTHON_PACKAGE_PTH = $(addsuffix .pth,$(PYTHON_PACKAGE)) +INSTALL_PYTHON_PACKAGE_PTH = $(addprefix $(PYTHON_INSTALL_LOCATION)/,$(PYTHON_PACKAGE_PTH)) + +PYTHON_SCRIPTS = $(filter-out $(LOADABLE_LIBRARY),$(PYTHON_MODULES)) +PYTHON_LIBRARY = $(filter $(LOADABLE_LIBRARY),$(PYTHON_MODULES)) +PYTHON_SHRLIBNAME = $(PYTHON_LIBRARY:%=$(LOADABLE_SHRLIB_PREFIX)%$(LOADABLE_SHRLIB_SUFFIX)) + +INSTALL_PYTHONS = $(addprefix $(INSTALL_PYTHON)/,$(PYTHON_SCRIPTS)) +INSTALL_PYTHONS += $(addprefix $(INSTALL_PYTHON)/,$(PYTHON_SHRLIBNAME)) + +buildInstall: $(INSTALL_PYTHONS) $(INSTALL_PYTHON_PACKAGE_PTH) + +$(INSTALL_PYTHON)/%: % + @echo "Installing python modules $@" + @$(INSTALL) -d -m 644 $< $(INSTALL_PYTHON) + +$(INSTALL_PYTHON)/%: ../% + @echo "Installing python modules $@" + @$(INSTALL) -d -m 644 $< $(INSTALL_PYTHON) + +$(PYTHON_INSTALL_LOCATION)/%: % + @echo "Installing python pth file $@" + @$(INSTALL) -d -m 644 $< $(PYTHON_INSTALL_LOCATION) + +$(PYTHON_PACKAGE_PTH): + @echo $(PYTHON_PACKAGE) > $@ + +%_wrap.c: ../%.i + $(SWIG) -python -o $@ $< + +clean:: + @$(RM) *.py *.so *.pth + +endif +endif