tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Make lang/tinyscheme compile under both Linux and NetBSD



Hello all.

Recently, I discovered that lang/tinyscheme compiles fine under NetBSD,
but not under Linux.  This is because patch-aa removes the necessary
-ldl flag to link against dl library on Linux.  If I insert this, it
breaks on NetBSD (because NetBSD doesn't have it out of libc, right?).
So, as a workaround, I used NetBSD make preprocessor capabilities to
check system name and take decisions on that.

Please, see the attached patch.

Use the system name to take decisions is not a very good approach, I
know.  Is there a more intelligent way to check whether or not dl
exists?  It would prevent some having to to add checks for other OSes as
errors spring up on non-tested platforms.

Also, is it correct to use bmake extensions in a package Makefile, if
this Makefile is portable?

Thank you very much.

-- 
Silas Silva
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/tinyscheme/distinfo,v
retrieving revision 1.10
diff -u -r1.10 distinfo
--- distinfo    12 Aug 2010 10:22:40 -0000      1.10
+++ distinfo    19 Feb 2011 11:53:21 -0000
@@ -3,4 +3,4 @@
 SHA1 (tinyscheme1.39.zip) = d759bff93683399ee7abbfd1a822d000adb22a0c
 RMD160 (tinyscheme1.39.zip) = d8d365ccceb9482ffd457fd6d4f97c1651e131e9
 Size (tinyscheme1.39.zip) = 58751 bytes
-SHA1 (patch-aa) = 94cac80297b4e89e2fe2ff8a575c616354aa122d
+SHA1 (patch-aa) = d39fdc9e7d3ea77eef04689353b8910b1023a4d2
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/lang/tinyscheme/patches/patch-aa,v
retrieving revision 1.7
diff -u -r1.7 patch-aa
--- patches/patch-aa    12 Aug 2010 10:22:41 -0000      1.7
+++ patches/patch-aa    19 Feb 2011 11:53:21 -0000
@@ -1,17 +1,21 @@
-$NetBSD: patch-aa,v 1.7 2010/08/12 10:22:41 asau Exp $
+$NetBSD$
 
---- makefile.orig      2006-12-07 13:29:24.000000000 +0300
-+++ makefile   2010-08-12 14:14:07.000000000 +0400
-@@ -18,7 +18,7 @@
+--- makefile.orig      2006-12-07 13:29:24.000000000 -0200
++++ makefile   2011-02-19 09:52:08.000000000 -0200
+@@ -17,8 +17,11 @@
+ #RM= -del
  #AR= echo
  
++SYSTEM != uname
++
++
  # Unix, generally 
 -CC = gcc -fpic 
 +#CC = gcc -fpic 
  DEBUG=-g -Wall -Wno-char-subscripts -O 
  Osuf=o 
  SOsuf=so 
-@@ -28,16 +28,17 @@
+@@ -28,16 +31,23 @@
  OUT = -o $@ 
  RM= -rm -f
  AR= ar crs
@@ -25,22 +29,28 @@
 +#SYS_LIBS= -ldl
  PLATFORM_FEATURES= -DSUN_DL=1
  
++.if ${SYSTEM} == "NetBSD"
++SYS_LIBS=
++.else
++SYS_LIBS= -ldl
++.endif
++
  # Cygwin
 -PLATFORM_FEATURES = -DUSE_STRLWR=0
 +#PLATFORM_FEATURES = -DUSE_STRLWR=0
  
   
  # Solaris 
-@@ -57,19 +58,23 @@
+@@ -57,19 +67,23 @@
  LIBTARGET = $(LIBPREFIX)tinyscheme.$(SOsuf) 
  STATICLIBTARGET = $(LIBPREFIX)tinyscheme.$(LIBsuf)
  
 -all: $(LIBTARGET) $(STATICLIBTARGET) scheme$(EXE_EXT)
-+all: $(STATICLIBTARGET) scheme$(EXE_EXT)
- 
+-
 -%.$(Osuf): %.c 
 -      $(CC) -I. -c $(DEBUG) $(FEATURES) $(DL_FLAGS) $< 
--
++all: $(STATICLIBTARGET) scheme$(EXE_EXT)
+ 
 -$(LIBTARGET): $(OBJS) 
 -      $(LD) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS) 
 +.c.$(Osuf):


Home | Main Index | Thread Index | Old Index