summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-03-12 11:39:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-03-12 11:39:57 -0700
commit30e642826f25c07ae13138c0dabee1287f4c52c3 (patch)
tree9052f2c1031cc7015d06cec58cab0ec7c3ebc656
parent4a0ddf7d4f453f677224ba712e775fa3e6e00513 (diff)
downloadsyslinux-30e642826f25c07ae13138c0dabee1287f4c52c3.tar.gz
Add gpllib, gplinclude
Add separate gpllib and gplinclude directories, and have a NOGPL variable in MCONFIG that can be set to exclude these directories.
-rw-r--r--com32/LICENCE4
-rw-r--r--com32/MCONFIG13
-rw-r--r--com32/Makefile2
-rw-r--r--com32/cmenu/Makefile2
-rw-r--r--com32/gplinclude/README1
-rw-r--r--com32/gpllib/Makefile40
-rw-r--r--com32/lib/Makefile5
-rw-r--r--com32/modules/Makefile2
8 files changed, 63 insertions, 6 deletions
diff --git a/com32/LICENCE b/com32/LICENCE
index 4fd64b3c..8934e8fb 100644
--- a/com32/LICENCE
+++ b/com32/LICENCE
@@ -2,7 +2,7 @@ libcom32 and libutil are licensed under the MIT license:
## -----------------------------------------------------------------------
##
-## Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
+## Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
##
## Permission is hereby granted, free of charge, to any person
## obtaining a copy of this software and associated documentation
@@ -27,5 +27,5 @@ libcom32 and libutil are licensed under the MIT license:
##
## -----------------------------------------------------------------------
-The files in the samples and modules directories are mostly under the
+The files in the sample, modules and libgpl directories are mostly under the
GNU GPL (see the file COPYING in the directory above.)
diff --git a/com32/MCONFIG b/com32/MCONFIG
index 2b7e018b..cf5334b3 100644
--- a/com32/MCONFIG
+++ b/com32/MCONFIG
@@ -23,10 +23,18 @@ GCCOPT := $(call gcc_ok,-std=gnu99,) \
com32 = $(topdir)/com32
+ifeq ($(NOGPL),1)
+GPLLIB = $(com32)/libcom32gpl.a
+GPLINCLUDE = -I$(com32)/gplinclude
+else
+GPLLIB =
+GPLINCLUDE =
+endif
+
CFLAGS = $(GCCOPT) -W -Wall -march=i386 \
-fomit-frame-pointer -D__COM32__ \
-nostdinc -iwithprefix include \
- -I$(com32)/libutil/include -I$(com32)/include
+ -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE)
SFLAGS = $(GCCOPT) -D__COM32__ -march=i386
LDFLAGS = -m elf_i386 -T $(com32)/lib/com32.ld
LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
@@ -35,7 +43,8 @@ LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE
LNXSFLAGS = -g
LNXLDFLAGS = -g
-C_LIBS = $(com32)/libutil/libutil_com.a $(com32)/lib/libcom32.a $(LIBGCC)
+C_LIBS = $(com32)/libutil/libutil_com.a $(GPLLIB) \
+ $(com32)/lib/libcom32.a $(LIBGCC)
C_LNXLIBS = $(com32)/libutil/libutil_lnx.a
.SUFFIXES: .lss .c .lo .o .elf .c32 .lnx
diff --git a/com32/Makefile b/com32/Makefile
index 9fbfb67c..56a31882 100644
--- a/com32/Makefile
+++ b/com32/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = lib libutil modules menu samples rosh cmenu hdt
+SUBDIRS = lib gpllib libutil modules menu samples rosh cmenu hdt
all tidy dist clean spotless install:
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index e8627a9f..010fa122 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -14,6 +14,8 @@
## Makefile for the complex menu system
##
+NOGPL := 1
+
# This must be defined before MCONFIG is included
LIBS = libmenu/libmenu.a
diff --git a/com32/gplinclude/README b/com32/gplinclude/README
new file mode 100644
index 00000000..ac1bf6a8
--- /dev/null
+++ b/com32/gplinclude/README
@@ -0,0 +1 @@
+Put header files for LGPL or GPL library functions in this directory.
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
new file mode 100644
index 00000000..dd77d394
--- /dev/null
+++ b/com32/gpllib/Makefile
@@ -0,0 +1,40 @@
+#
+# LGPL/GPL code library
+#
+
+# Include configuration rules
+include ../lib/MCONFIG
+
+LIBOBJS =
+
+BINDIR = /usr/bin
+LIBDIR = /usr/lib
+DATADIR = /usr/share
+AUXDIR = $(DATADIR)/syslinux
+INCDIR = /usr/include
+COM32DIR = $(AUXDIR)/com32
+
+all: libcom32gpl.a
+
+libcom32gpl.a : $(LIBOBJS)
+ rm -f $@
+ $(AR) cq $@ $^
+ $(RANLIB) $@
+
+tidy dist clean:
+ find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
+ xargs -0r rm -f
+
+spotless: clean
+ rm -f *.a
+ rm -f *~ \#* */*~ */\#*
+
+# Mixing in the GPL include files is suboptimal, but I'm not sure
+# there is a better way to do it.
+install: all
+ mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
+ install -m 644 libcom32gpl.a $(INSTALLROOT)$(COM32DIR)
+ mkdir -p $(INSTALLROOT)$(COM32DIR)/include/
+ cp -r ../gplinclude $(INSTALLROOT)$(COM32DIR)/include/
+
+-include .*.d */.*.d */*/.*.d
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 0cb6156e..eb723c67 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -1,4 +1,9 @@
+#
+# ONLY INCLUDE MIT OR 2/3-BSD-LICENSED CODE IN THIS LIBRARY
+#
+
# Include configuration rules
+NOGPL := 1
include MCONFIG
LIBOBJS = \
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 5ab345f5..ec58829d 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -1,6 +1,6 @@
## -----------------------------------------------------------------------
##
-## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
+## Copyright 2001-2009 H. Peter Anvin - All Rights Reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by