diff --git a/src/xspice/icm/Makefile b/src/xspice/icm/Makefile index f65563f48..2879c12bf 100644 --- a/src/xspice/icm/Makefile +++ b/src/xspice/icm/Makefile @@ -65,7 +65,7 @@ dlmain.o: cmextrn.h cminfo.h udnextrn.h udninfo.h @for x in `cat udnpath.lst` ; do \ echo $$x/udnfunc.o \\ >> .deps/cm.P ; done @echo "" >> .deps/cm.P - $(COMPILE) $(LDFLAGS) -o $@ `awk '{ print $$1 }' objects.inc` dlmain.o + $(CC) $(LDFLAGS) -o $@ `awk '{ print $$1 }' objects.inc` dlmain.o %-mods: modpath.lst udnpath.lst @for x in `cat modpath.lst` ; do \ diff --git a/src/xspice/icm/makedefs.in b/src/xspice/icm/makedefs.in index b08cf329b..e1b0fa914 100644 --- a/src/xspice/icm/makedefs.in +++ b/src/xspice/icm/makedefs.in @@ -16,22 +16,35 @@ CC = @CC@ # Spice header include path INCLUDES = -I$(TOPDIR)$(top_srcdir)/src/include -I$(TOPDIR)$(top_builddir) -ISMINGW = $(shell uname | grep -c "MINGW32") # CFLAGS to use here +CFLAGS = @CFLAGS@ -fPIC -DCM_LINUX +ISMINGW = $(shell uname | grep -c "MINGW32") ifeq ($(ISMINGW), 1) - CFLAGS = @CFLAGS@ -DCM_WINDOWS -else - CFLAGS = @CFLAGS@ -fPIC -DCM_LINUX + CFLAGS = @CFLAGS@ -DCM_WINDOWS +endif +ISCYGWIN = $(shell uname | grep -c "CYGWIN") +ifeq ($(ISCYGWIN), 1) + CFLAGS = @CFLAGS@ -DCM_WINDOWS +endif +ISSUNCC = $(shell uname | grep -c "SunOS") +ifeq ($(ISSUNCC), 1) + ifneq "$(CC)" "gcc" + CFLAGS = @CFLAGS@ -KPIC -DCM_LINUX + endif endif # Path to the cmpp utility CMPP = $(TOPDIR)$(top_builddir)/src/xspice/cmpp/cmpp # Flags to use when linking shared library -ifeq "$(strip $(uname))" "Darwin" -LDFLAGS = -bundle -flat_namespace -undefined suppress -else LDFLAGS = -shared +ifeq "$(strip $(uname))" "Darwin" + LDFLAGS = -bundle -flat_namespace -undefined suppress +endif +ifeq "$(strip $(uname))" "SunOS" + ifneq "$(CC)" "gcc" + LDFLAGS = -G + endif endif # The codemodels to make