Nexuiz on OpenSolaris

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

Re: Nexuiz on OpenSolaris

Postby sartek » Tue Apr 22, 2008 10:01 pm

$ echo "1"
1
$ echo ">> `echo 2` <<"
>> 2 <<
$ echo ">> `echo "3 4"` <<"
>> 3 4
$ echo ">> `echo "3 4"` <<"
>> 3 4 <<
$ echo ">> $(echo "3 4") <<"
>> $(echo 3 4) <<
$

edit:
what do you think about set "SHELL=/usr/bin/env bash" ?

divVerent wrote:Damn, this does not help much.

Can you try the following commands on the OpenSolaris /bin/sh shell (run /bin/sh from the ocmmand prompt to make sure it is used):

echo "1"
echo ">> `echo 2` <<"
echo ">> `echo "3 4"` <<"
echo ">> `echo "3 4"` <<"
echo ">> $(echo "3 4") <<"
sartek
Newbie
 
Posts: 6
Joined: Tue Apr 22, 2008 4:28 pm

Postby divVerent » Wed Apr 23, 2008 2:33 pm

Now try:

make bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`"

And no, you can't reliably use "env" in SHELL.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby sartek » Wed Apr 23, 2008 2:38 pm

works
divVerent wrote:Now try:

make bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`"

And no, you can't reliably use "env" in SHELL.
sartek
Newbie
 
Posts: 6
Joined: Tue Apr 22, 2008 4:28 pm

Postby divVerent » Wed Apr 23, 2008 3:59 pm

Then you aren't in /bin/sh, or you wouldn't have gotten the make error above.

Seriously, your login shell apparently isn't /bin/sh, but some better shell. Please repeat this test using /bin/sh.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby sartek » Wed Apr 23, 2008 4:25 pm

sorry i got lost in terminals :D

Code: Select all
bash-3.2$ make bin-release \
> DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
> EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`"
make: Fatal error in reader: makefile, line 3: Unexpected end of line seen
bash-3.2$ /bin/sh
$ cd /data2/game/asd/Nexuiz/sources/darkplaces/
$ make bin-release \                       
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`"> >
syntax error: `end of file' unexpected
$


divVerent wrote:Then you aren't in /bin/sh, or you wouldn't have gotten the make error above.

Seriously, your login shell apparently isn't /bin/sh, but some better shell. Please repeat this test using /bin/sh.
sartek
Newbie
 
Posts: 6
Joined: Tue Apr 22, 2008 4:28 pm

Postby divVerent » Wed Apr 23, 2008 10:04 pm

Finally, the syntax error.

Try the following command in /bin/sh:

echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`"

(this should be a syntax error)



echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm"

(this should work)



echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo normal`"

does this still work?



echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo "quoted"`"

and this?



echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo 'singlequoted'`"

and this?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby sartek » Wed Apr 23, 2008 10:11 pm

$ echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "" ]; then echo " /libmodplug.a -lstdc++"; fi`" > >
syntax error: `end of file' unexpected
$ echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm" > >
bin-release DP_MAKE_TARGET=sunos DP_SOUND_API=OSS EXE=nexuiz-glx LDFLAGS_COMMON=-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm
$ echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo normal`" > >
bin-release DP_MAKE_TARGET=sunos DP_SOUND_API=OSS EXE=nexuiz-glx LDFLAGS_COMMON=-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm normal
$ echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo "quoted"`" > >
bin-release DP_MAKE_TARGET=sunos DP_SOUND_API=OSS EXE=nexuiz-glx LDFLAGS_COMMON=-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm quoted
$ echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo 'singlequoted'`" > >
bin-release DP_MAKE_TARGET=sunos DP_SOUND_API=OSS EXE=nexuiz-glx LDFLAGS_COMMON=-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm singlequoted
$
sartek
Newbie
 
Posts: 6
Joined: Tue Apr 22, 2008 4:28 pm

Postby divVerent » Thu Apr 24, 2008 6:04 pm

This must be a weird shell... please try too:

echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if true; then echo 1; fi`"


echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `echo "1" "2"`"


echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `[ -z nothing ]`"



If this fails:

[ -z nothing ]

test -z nothing

If the [ one failed and the test one succeeded, try putting test -z nothing instead of [ -z nothing ], and test -n nothing instead of [ -n nothing ] in the following tests.



If it succeeded. or if you replace [ by test and remove ]:


echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n nothing ]; then echo 1; fi`"


echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "nothing" ]; then echo 1; fi`"


echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm `if [ -n "nothing" ]; then echo "1"; fi`"
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby replaced » Fri Apr 25, 2008 3:32 am

Hi! sartek said you need some SunOS shell-foo.

divVerent wrote:This must be a weird shell...


Yes, it is. :)
POSIX requires the presense of a POSIX conformant shell impementation, but it does not state it should be /bin/sh.
And on SunOS its not a POSIX shell (/usr/xpg4/bin/sh is the POSIX).

Nesting quotes is something should be avoided at all times.
You can't know if a shell will parse it lazy or greedy.

You have made a false assumption, that it will eval from outside
to inside, but SunOS's /bin/sh parsed it left-to-right, so you got something like this:

"... if [ some test ]; then echo "

...which is of course wrong.

Also don't use subshell executions, because they take additional
resources and make the script slower (and ugly as SunOS /bin/sh doesnt know the $() syntax).


if [ -n "" ]; then
MODPLUG_FLAGS="/libmodplug.a -lstdc++"
else
MODPLUG_FLAGS=""
fi

echo bin-release \
DP_MAKE_TARGET=sunos DP_SOUND_API=OSS \
EXE="nexuiz-glx" \
LDFLAGS_COMMON="-lm -ldl -lsocket -lnsl -R/usr/X11R6/lib \
-L/usr/X11R6/lib -lX11 -lXpm -lXext -lXxf86vm $MODPLUG_FLAGS"


PS.: See http://wiki.netbsd.se/The_pkgsrc_portab ... de#Solaris for more shell strangeness.
=> NetBSD.org - pkgsrc.org
replaced
Newbie
 
Posts: 2
Joined: Fri Apr 25, 2008 3:18 am

Postby divVerent » Sat Apr 26, 2008 6:04 am

Sorry, we can't avoid the subshell there, as "portable" makefiles don't allow any other way to do the modplug check at runtime. Same with sdl-config... however, the subshell is no performance problem, as it is only done twice (by the outer "make" for the LDFLAGS, and by the gcc call for the CFLAGS for snd_modplug.c).

I know GNU make has a way for it, but makefile.inc is also used by BSDmakefile. So this may mean that we won't EVER support Solaris, as there simply is no alternative way to do what this check is doing.

Can you still do the checks I mentioned? We MAY get away by using single quotes there instead. Please try that.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

PreviousNext

Return to Nexuiz - Support / Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron