Re: [AD] Allegro on OpenBSD

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



* When linking allegro programs with the default allegro-config I got
errors about _oss_ioctl not being found. I added -lossaudio to
allegro-config which fixed this.

I think there were some problems with OSS in Solaris too, but I don't
remember if they were solved? As far as I can remember, it mostly had to do
with the ability to detect the precense of OSS.
The compilation errors in uossmidi.c were due to missing define's in soundcard.h. OpenBSD's soundcard.h is very different from Linux's soundcard.h. Attached is OpenBSD's soundcard.h for reference. I am looking through the OpenBSD OSS API, http://www.opensound.com/pguide/index.html, but this is really not my forte and Im not so sure I will be able to solve the midi problem in OpenBSD.

* When starting *any* Allegro program I get the following output from
ps:
~/archives/scratch/c++/star kazzmir $ ./star
ps: unknown option -- f
usage: ps [-][aCcehjklmrSTuvwx] [-M core] [-N system] [-O fmt] [-o fmt]
[-p pid]
         [-t tty] [-U username] [-W swap]
      ps [-L]
ps: unknown option -- f

Hmm... this is a problem in get_executable_name (_unix_get_executable_name
in src/unix/). One of the things it tries is using ps to find the name of
the current process - which obviously fails (which, by the way, implies
that get_executable_name() doesn't work). A quick test suggests that the -f
option is not nescessary, so can you try to remove the -f option and
recompile and check if it still works?
Alternatively, do you know a better way to get the name of the executable
under OpenBSD? You may also want to check out current CVS, which has some
fixes for Solaris issues with the same function. I don't think that'll help
on a BSD system, but you never know.
I'm definitely interested in resolving this.

I removed the -f flag from the ps call in src/unix/usystem.c and get_executable_name works fine now but I have another suggestion. Maybe Im missing something but if the point of the function is to return the current executable name why cant Allegro just combine getcwd() with argv[0]? Allegro on Unix can already manipulate argv/argc via src/unix/umain.c so why not steal argv[0] and stuff that into some Allegro global variable?

On a side note get_executable_name doesnt seem like it should change so it seems like allegro_init() should call it once and cache that somewhere, too.

Just for completness I have attached the patch that removes the -f flag, although its very trivial and you can do it yourself Im sure.

BTW, the split_modex_screen symbol is still missing in CVS.

Attachment: soundcard.h.gz
Description: application/gzip

Index: usystem.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unix/usystem.c,v
retrieving revision 1.35
diff -u -r1.35 usystem.c
--- usystem.c	12 Jun 2005 08:03:23 -0000	1.35
+++ usystem.c	19 Jun 2005 04:47:18 -0000
@@ -398,7 +398,7 @@
    
    /* Last resort: try using the output of the ps command to at least find */
    /* the name of the file if not the full path */
-   uszprintf (linkname, sizeof(linkname), "ps -f -p %d", pid);
+   uszprintf (linkname, sizeof(linkname), "ps -p %d", pid);
    do_uconvert (linkname, U_CURRENT, filename, U_ASCII, size);
    pipe = popen(filename, "r");
    if (pipe) {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/