summaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2004-08-18 18:15:53 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2004-08-18 18:15:53 +0000
commitc55cb70deba4841ebf976c582d81a4b22a77a0f1 (patch)
treeca05a426f1dccaf67bb7aadf483447addc88bf0d /comms
parentFix build with gcc-3.4 (diff)
Fix build with gcc-3.4
PR: ports/70628 Submitted by: Ports Fury
Notes
Notes: svn path=/head/; revision=116616
Diffstat (limited to 'comms')
-rw-r--r--comms/gsmlib/Makefile18
-rw-r--r--comms/gsmlib/files/patch-configure10
-rw-r--r--comms/gsmlib/files/patch-gsmlib::gsm_map_key.h34
-rw-r--r--comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc90
4 files changed, 122 insertions, 30 deletions
diff --git a/comms/gsmlib/Makefile b/comms/gsmlib/Makefile
index 9c7c60b99f3c..e1a3a055960e 100644
--- a/comms/gsmlib/Makefile
+++ b/comms/gsmlib/Makefile
@@ -15,11 +15,11 @@ MASTER_SITES= http://www.pxh.de/fs/gsmlib/download/
MAINTAINER= ports@FreeBSD.org
COMMENT= A library to access GSM mobile phones through GSM modems
+USE_GNOME= gnometarget lthack
USE_GETOPT_LONG= yes
USE_REINPLACE= yes
USE_GMAKE= yes
USE_INC_LIBTOOL_VER= 13
-CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
INSTALLS_SHLIB= yes
@@ -31,22 +31,16 @@ CPPFLAGS= -I${LOCALBASE}/include -DBROKEN_STRFTIME -DHAVE_DECL_GETOPT \
${PTHREAD_CFLAGS}
LDFLAGS= -L${LOCALBASE}/lib ${PTHREAD_LIBS}
-.if !defined(WITHOUT_NLS)
+.if defined(WITHOUT_NLS)
+CONFIGURE_ARGS+= --disable-nls
+PLIST_SUB+= NLS="@comment "
+.else
USE_GETTEXT= yes
PLIST_SUB+= NLS=""
-.else
-CONFIGURE_ARGS+=--disable-nls
-PLIST_SUB+= NLS="@comment "
-.endif
-
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 502126
-BROKEN= "Does not compile with gcc 3.4.2"
.endif
post-patch:
@${GREP} -lR "<malloc.h>" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
's|<malloc\.h>|<stdlib.h>|g'
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/comms/gsmlib/files/patch-configure b/comms/gsmlib/files/patch-configure
deleted file mode 100644
index 54f27ec9e860..000000000000
--- a/comms/gsmlib/files/patch-configure
+++ /dev/null
@@ -1,10 +0,0 @@
---- configure.orig Thu Oct 17 05:23:09 2002
-+++ configure Sat Nov 30 07:16:22 2002
-@@ -7400,6 +7400,7 @@
-
- # This can be used to rebuild libtool when needed
- LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
-
- # Always use our own libtool.
- LIBTOOL='$(SHELL) $(top_builddir)/libtool'
diff --git a/comms/gsmlib/files/patch-gsmlib::gsm_map_key.h b/comms/gsmlib/files/patch-gsmlib::gsm_map_key.h
new file mode 100644
index 000000000000..18ecc5748151
--- /dev/null
+++ b/comms/gsmlib/files/patch-gsmlib::gsm_map_key.h
@@ -0,0 +1,34 @@
+--- gsmlib/gsm_map_key.h.orig Wed May 15 04:38:12 2002
++++ gsmlib/gsm_map_key.h Wed Aug 18 22:19:20 2004
+@@ -25,6 +25,16 @@
+
+ // wrapper for map key, can access Sortedtore to get sortOrder()
+
++ template <class SortedStore> class MapKey;
++
++ // compare two keys
++ template <class SortedStore>
++ extern bool operator<(const MapKey<SortedStore> &x,
++ const MapKey<SortedStore> &y);
++ template <class SortedStore>
++ extern bool operator==(const MapKey<SortedStore> &x,
++ const MapKey<SortedStore> &y);
++
+ template <class SortedStore> class MapKey
+ {
+ SortedStore &_myStore; // my store
+@@ -61,14 +71,6 @@
+ const MapKey<SortedStore> &y);
+ };
+
+- // compare two keys
+- template <class SortedStore>
+- extern bool operator<(const MapKey<SortedStore> &x,
+- const MapKey<SortedStore> &y);
+- template <class SortedStore>
+- extern bool operator==(const MapKey<SortedStore> &x,
+- const MapKey<SortedStore> &y);
+-
+ // MapKey members
+
+ template <class SortedStore>
diff --git a/comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc b/comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc
index cbdc195928bb..4dabea9f4fcb 100644
--- a/comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc
+++ b/comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc
@@ -1,10 +1,84 @@
---- gsmlib/gsm_unix_serial.cc.orig Thu Jul 17 20:44:42 2003
-+++ gsmlib/gsm_unix_serial.cc Thu Jul 17 20:44:54 2003
-@@ -16,6 +16,7 @@
- #include <gsmlib/gsm_nls.h>
- #include <gsmlib/gsm_unix_serial.h>
- #include <gsmlib/gsm_util.h>
-+#include <assert.h>
- #include <termios.h>
+--- gsmlib/gsm_unix_serial.cc.orig Sun Sep 22 20:51:10 2002
++++ gsmlib/gsm_unix_serial.cc Wed Aug 18 01:27:08 2004
+@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <iostream>
+ #include <strstream>
++#include <cassert>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <unistd.h>
+@@ -178,11 +179,15 @@
+
+ // switch off non-blocking mode
+ int fdFlags;
+- if ((fdFlags = fcntl(_fd, F_GETFL)) == -1)
++ if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) {
++ close(_fd);
+ throwModemException(_("getting file status flags failed"));
++ }
+ fdFlags &= ~O_NONBLOCK;
+- if (fcntl(_fd, F_SETFL, fdFlags) == -1)
++ if (fcntl(_fd, F_SETFL, fdFlags) == -1) {
++ close(_fd);
+ throwModemException(_("switching of non-blocking mode failed"));
++ }
+
+ long int saveTimeoutVal = _timeoutVal;
+ _timeoutVal = 3;
+@@ -194,17 +199,22 @@
+
+ // toggle DTR to reset modem
+ int mctl = TIOCM_DTR;
+- if (ioctl(_fd, TIOCMBIC, &mctl) < 0)
++ if (ioctl(_fd, TIOCMBIC, &mctl) < 0) {
++ close(_fd);
+ throwModemException(_("clearing DTR failed"));
++ }
+ // the waiting time for DTR toggling is increased with each loop
+ usleep(holdoff[initTries]);
+- if (ioctl(_fd, TIOCMBIS, &mctl) < 0)
++ if (ioctl(_fd, TIOCMBIS, &mctl) < 0) {
++ close(_fd);
+ throwModemException(_("setting DTR failed"));
+-
++ }
+ // get line modes
+- if (tcgetattr(_fd, &t) < 0)
++ if (tcgetattr(_fd, &t) < 0) {
++ close(_fd);
+ throwModemException(stringPrintf(_("tcgetattr device '%s'"),
+ device.c_str()));
++ }
+
+ // set line speed
+ cfsetispeed(&t, lineSpeed);
+@@ -229,9 +239,11 @@
+ t.c_cc[VSUSP] = 0;
+
+ // write back
+- if(tcsetattr (_fd, TCSANOW, &t) < 0)
++ if(tcsetattr (_fd, TCSANOW, &t) < 0) {
++ close(_fd);
+ throwModemException(stringPrintf(_("tcsetattr device '%s'"),
+ device.c_str()));
++ }
+ // the waiting time for writing to the ME/TA is increased with each loop
+ usleep(holdoff[initTries]);
+
+@@ -279,11 +291,14 @@
+ catch (GsmException &e)
+ {
+ _timeoutVal = saveTimeoutVal;
+- if (initTries == 0)
++ if (initTries == 0) {
++ close(_fd);
+ throw e;
++ }
+ }
+ }
+ // no response after 3 tries
++ close(_fd);
+ throw GsmException(stringPrintf(_("reset modem failed '%s'"),
+ device.c_str()), OtherError);
+ }