Revert previous. If C++ code has been linked with c++(1) into a library,

it should be possible to link that library to C code with cc(1).
This commit is contained in:
naddy 2019-01-22 19:23:40 +00:00
parent 478db942ff
commit 4843e351e0
3 changed files with 15 additions and 48 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.43 2019/01/22 19:03:08 naddy Exp $
# $OpenBSD: Makefile,v 1.44 2019/01/22 19:23:40 naddy Exp $
COMMENT= SDL C++ GUI widget library
DISTNAME= GUIlib-1.2.1
PKGNAME= ${DISTNAME:L}
REVISION= 4
REVISION= 3
SHARED_LIBS += GUI 2.0 # .0.1
@ -18,7 +18,7 @@ PERMIT_PACKAGE_CDROM= Yes
WANTLIB += SDL iconv m pthread sndio ${COMPILER_LIBCXX} usbhid
COMPILER = base-clang ports-gcc base-gcc
COMPILER = base-clang ports-gcc base-gcc
LIB_DEPENDS= converters/libiconv \
devel/sdl
@ -27,14 +27,6 @@ SEPARATE_BUILD= Yes
CONFIGURE_STYLE= gnu
CONFIGURE_ENV+= LDFLAGS="-L${X11BASE}/lib"
AUTOCONF_VERSION= 2.59
AUTOMAKE_VERSION= 1.9
BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS}
# needs libtoolize
BUILD_DEPENDS+= devel/libtool
do-gen:
cd ${WRKSRC} && ${AUTOCONF_ENV} autoreconf -i
MAKE_FLAGS+= libGUI_la_LIBADD=-lsupc++
.include <bsd.port.mk>

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-Makefile_am,v 1.4 2019/01/22 19:03:08 naddy Exp $
Add dummy C++ sources that don't need to exist. This forces the
C++ linker to be chosen, which is required when linking C code
against a C++ library.
Index: Makefile.am
--- Makefile.am.orig
+++ Makefile.am
@@ -1,5 +1,7 @@
# Makefile.am for the SDL sample image loading library and viewer
+AUTOMAKE_OPTIONS = foreign
+
lib_LTLIBRARIES = libGUI.la
libGUIincludedir = $(includedir)/GUI
@@ -53,7 +55,6 @@ EXTRA_DIST = \
scroll_up.bmp
libGUI_la_LDFLAGS = \
-no-undefined \
- -release $(LT_RELEASE) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
@@ -63,8 +64,10 @@ genimage_SOURCES = genimage.c
hello_SOURCES = hello.cpp
hello_LDADD = libGUI.la
hello_C_SOURCES = hello_C.c
+nodist_EXTRA_hello_C_SOURCES = dummy.cpp
hello_C_LDADD = libGUI.la
keyboard_SOURCES = keyboard.cpp
keyboard_LDADD = libGUI.la
okay_SOURCES = okay.c
+nodist_EXTRA_okay_SOURCES = dummy.cpp
okay_LDADD = libGUI.la

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-Makefile_in,v 1.6 2019/01/22 19:23:40 naddy Exp $
--- Makefile.in.orig Mon Jan 3 20:54:10 2011
+++ Makefile.in Mon Jan 3 20:54:34 2011
@@ -290,7 +290,6 @@ EXTRA_DIST = \
libGUI_la_LDFLAGS = \
-no-undefined \
- -release $(LT_RELEASE) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
genimage_SOURCES = genimage.c