Comments (9)
Which system is this on? I'd guess this is Solaris 9 or worse because that's the only system that I know which is broken enough not to have getopt_long.
See http://en.znc.in/wiki/Portability
from znc.
hehe, irix actually
from znc.
Added Irix to the "broken" list in the wiki. getopt_long is a GNU extension, so... yeah. But I really like long options. :-(
I googled a getopt_long implementation and the file has 540 lines. That's a lot.
So plan B:
Grab a text editor and edit main.cpp. Remove the "g_LongOpts" array in lines 13 to 27. In line 117/119, change the calls to getopt_long(argc, argv, , g_LongOpts, &iOptIndex) into getopt(arc, argv, ).
If you got any problems with that, tell me which version of znc you are looking at and I'll patch main.cpp for you. (And yes, this will remove support for long options like --foreground and --debug from znc and make only the short forms like -f and -D work).
from znc.
fantastic!!
will give it a try right away!
and i couldn't care less about long options anyway :-)
i'll try 0.096 first but wouldn't mind any other version either
from znc.
okay, that worked like a charm but one more issue came up:
Csocket.cpp: In function 'void __Perror(const CString&, const char*, unsigned int)':
Csocket.cpp:495: error: 'strerror_r' was not declared in this scope
from znc.
http://predef.sourceforge.net/preos.html says that irix can be identified via #ifdef sgi
, so could you change line 489 in Csocket.cpp from
#if defined(sun) || defined(_WIN32) || (defined(__NetBSD_Version) && NetBSD_Version < 4000000000)
into
#if defined(sgi) || defined(sun) || defined(_WIN32) || (defined(__NetBSD_Version) && NetBSD_Version < 4000000000)
from znc.
that worked just as well as the solution before!
had to replace install.sh with a real one and all was fine. now i'm the proud owner of a nice and current znc package for irix :-)
i have to say this was the best support i got in years. normally it's like that: "what? not linux? don't care." :-P
and for what it's worth the patch:
--- main.cpp_O Thu Mar 24 17:15:38 2011
+++ main.cpp Thu Mar 24 14:02:17 2011
@@ -10,21 +10,6 @@
#include <getopt.h>
#include <sys/wait.h>
-static const struct option g_LongOpts[] = {
-
{ "help", no_argument, 0, 'h' },
-
{ "version", no_argument, 0, 'v' },
-
{ "debug", no_argument, 0, 'D' },
-
{ "foreground", no_argument, 0, 'f' },
-
{ "no-color", no_argument, 0, 'n' },
-
{ "allow-root", no_argument, 0, 'r' },
-
{ "makeconf", no_argument, 0, 'c' },
-
{ "makepass", no_argument, 0, 's' },
-#ifdef HAVE_LIBSSL
-
{ "makepem", no_argument, 0, 'p' },
-#endif /* HAVE_LIBSSL */
-
{ "datadir", required_argument, 0, 'd' },
-
{ 0, 0, 0, 0 }
-};
static void GenerateHelp(const char *appname) {
CUtils::PrintMessage("USAGE: " + CString(appname) + " [options]");
@@ -114,9 +99,9 @@
#ifdef HAVE_LIBSSL
bool bMakePem = false; -
while ((iArg = getopt_long(argc, argv, "hvnrcspd:Df", g_LongOpts, &iOptIndex)) != -1) {
-
while ((iArg = getopt(argc, argv, "hvnrcspd:Df")) != -1) {
#else
-
while ((iArg = getopt_long(argc, argv, "hvnrcsd:Df", g_LongOpts, &iOptIndex)) != -1) {
-
while ((iArg = getopt(argc, argv, "hvnrcsd:Df")) != -1) {
#endif /* HAVE_LIBSSL */
switch (iArg) {
case 'h':
--- Csocket.cpp_O Thu Mar 24 17:15:38 2011
+++ Csocket.cpp Thu Mar 24 17:00:39 2011
@@ -487,7 +487,7 @@
void *Perror( const CS_STRING & s, const char pszFile, unsigned int iLineNo )
{
-#if defined(__sun) || defined(_WIN32) || (defined(__NetBSD_Version) && NetBSD_Version < 4000000000)
+#if defined(sgi) || defined(sun) || defined(_WIN32) || (defined(__NetBSD_Version) && NetBSD_Version < 4000000000)
std::cerr << s << "(" << pszFile << ":" << iLineNo << "): " << strerror( GetSockError() ) << endl;
#else
char buff[512];
from znc.
So you do know that irix is dead since almost 5 years? Good. :-)
For the getopt_long problem I did a proper patch which has the same effect as the one you got, but with the difference that we still use getopt_long() if it is available:
http://git.znc.in/?p=psychon/znc.git;a=commitdiff;h=2afe2a77629012b24d8d270437e94e98d1657ffc
I'll forward the change to Csocket.cpp the right person.
from znc.
hehe, i do, still love it tho (and the resp. machines).
thanks for all !!
from znc.
Related Issues (20)
- Problem with znc HOT 3
- Problem with rejoin after kick
- znc+fish won't encrypt own messages
- Add OpenID Connect support HOT 3
- Add some way to bypass channel mode cache (or just remove it) HOT 6
- Feature request: ability to disable the "The channel could not be joined, disabling it" behavior HOT 1
- Client connecton stalled after CAP ACK HOT 3
- Portainer Add Template > ZNC - no login
- Add Security Headers to webadmin HOT 5
- Cannot load python modules via webadmin w/ Debian 12/Python 3.11.x/znc-1.9.x HOT 2
- can't remove some channels from chansaver HOT 5
- Reconnecting too fast HOT 6
- Missing `RPL_TOPICWHOTIME` from server results in incorrect `RPL_TOPICWHOTIME` sent to client
- Update the Copyright notice
- Perform /timer unknown command HOT 3
- Watch module ZNC HOT 7
- Missing : in PASS command
- Likely race condition in build system related to `generated.tar.gz` HOT 3
- identd and identfile doeset works HOT 10
- Cannot add/edit networks through Webui "The requested module does not acknowledge web requests" HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from znc.