1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

Half-assed fix to make autoconf bend

- this should make platform detection automagic
- also fixes debian builds that broke in the meantime
- fix osdep_darwin.c
This commit is contained in:
Tamas TEVESZ
2010-03-23 20:27:53 +01:00
committed by Carlos R. Mafra
parent 67a8a82670
commit 55959b4f7e
8 changed files with 61 additions and 63 deletions

View File

@@ -37,6 +37,41 @@ dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
dnl Platform-specific Makefile setup
dnl ================================
case "${host}" in
*-*-linux*)
WM_OSDEP="linux"
;;
*-*-freebsd*)
WM_OSDEP="bsd"
CFLAGS="$CFLAGS -DFREEBSD"
;;
*-*-netbsd*)
WM_OSDEP="bsd"
CFLAGS="$CFLAGS -DNETBSD"
;;
*-*-openbsd*)
WM_OSDEP="bsd"
CFLAGS="$CFLAGS -DOPENBSD"
;;
*-*-dragonfly*)
WM_OSDEP="bsd"
CFLAGS="$CFLAGS -DDRAGONFLYBSD"
;;
*-apple-darwin*)
WM_OSDEP="darwin"
;;
*-*-solaris*)
WM_OSDEP="stub" # solaris.c when done
;;
*)
WM_OSDEP="stub"
;;
esac
AC_SUBST(WM_OSDEP)
dnl the prefix
dnl ==========

View File

@@ -45,7 +45,7 @@ wmaker_SOURCES = \
menu.c \
menu.h \
misc.c \
osdep/linux.c \
osdep_@WM_OSDEP@.c \
monitor.c \
motif.c \
motif.h \

View File

@@ -1,11 +0,0 @@
#include <WINGs/WUtil.h>
#include "../wconfig.h"
Bool GetCommandForPid(int pid, char ***argv, int *argc)
{
*argv = NULL;
*argc = 0;
return False;
}

View File

@@ -1,49 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <WINGs/WUtil.h>
/*
* gcc -D{$os} -I ../../WINGs ${includes...} -Wall -Wextra -g -ggdb3 -c -o ${plat}.o ${plat}.c
* gcc -I ../../WINGs ${includes...} -g -ggdb3 -c -o test.o test.c
* gcc -g -ggdb3 -o test ${plat}.o ../../WINGs/.libs/libWUtil.a test.o
*
* $ ./test 1 2 'foo bar' "`date`" `date`
* arg[0] = [./test]
* arg[1] = [1]
* arg[2] = [2]
* arg[3] = [foo bar]
* arg[4] = [Sat Mar 20 18:36:22 CET 2010]
* arg[5] = [Sat]
* arg[6] = [Mar]
* arg[7] = [20]
* arg[8] = [18:36:22]
* arg[9] = [CET]
* arg[10] = [2010]
* $
*/
Bool GetCommandForPid(int pid, char ***argv, int *argc);
extern char *__progname;
int main(int argc, char **argv) {
char **nargv;
int i, nargc;
if (argc < 2) {
printf("Usage: %s arg arg arg ...\n", __progname);
return 0;
}
if (GetCommandForPid(getpid(), &nargv, &nargc) == False) {
printf("GetCommandForPid() failed\n");
} else {
printf("nargv = %d\n", nargc);
for(i = 0; i < nargc; i++)
printf("arg[%d] = [%s]\n", i, nargv[i]);
}
return 0;
}

View File

@@ -24,7 +24,7 @@
#include <WINGs/WUtil.h>
#include "../wconfig.h"
#include "wconfig.h"
/*
* copy argc and argv for an existing process identified by `pid'

View File

@@ -6,6 +6,10 @@
#include <stdlib.h>
#include <string.h>
#include <WINGs/WUtil.h>
#include "wconfig.h"
/*
* copy argc and argv for an existing process identified by `pid'
* into suitable storage given in ***argv and *argc.

View File

@@ -11,7 +11,7 @@
#include <WINGs/WUtil.h>
#include "../wconfig.h"
#include "wconfig.h"
/*
* copy argc and argv for an existing process identified by `pid'

19
src/osdep_stub.c Normal file
View File

@@ -0,0 +1,19 @@
#include <WINGs/WUtil.h>
#include "wconfig.h"
Bool GetCommandForPid(int pid, char ***argv, int *argc)
{
*argv = NULL;
*argc = 0;
static int notified = 0;
if (!notified) {
wwarning(_("%s is not implemented on this platform; "
"notify wmaker-dev@lists.windowmaker.info"), __FUNCTION__);
notified = 1;
}
return False;
}