summaryrefslogtreecommitdiff
path: root/soltools/cpp
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-21 15:14:37 +0200
committerobo <obo@openoffice.org>2010-06-21 15:14:37 +0200
commit86909c184b8ba2cf96e468e1e7f81c8b9ec7d1bc (patch)
tree79e2168a2e1d835ed11bacf15f7a811c2df2b377 /soltools/cpp
parent0d85448c7b1471ca0dd0a0db3fa866a989b5903b (diff)
parente1c983602eb7e448f6154024da6bbd5a3398d319 (diff)
CWS-TOOLING: integrate CWS systemlibc
Diffstat (limited to 'soltools/cpp')
-rw-r--r--soltools/cpp/_nlist.c3
-rw-r--r--soltools/cpp/_unix.c12
-rw-r--r--soltools/cpp/makefile.mk10
3 files changed, 20 insertions, 5 deletions
diff --git a/soltools/cpp/_nlist.c b/soltools/cpp/_nlist.c
index 9144f2b7e15e..a71085bfbbf9 100644
--- a/soltools/cpp/_nlist.c
+++ b/soltools/cpp/_nlist.c
@@ -3,9 +3,6 @@
#include <string.h>
#include "cpp.h"
-extern int stgetopt(int, char *const *, const char *);
-extern char *optarg;
-extern int optind;
extern int Cplusplus;
Nlist *kwdefined;
char wd[128];
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 5574bb3ecef7..5352f6f1f5f9 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -12,9 +12,15 @@
#include "cpp.h"
+#if defined MACOSX || !defined HAVE_GETOPT
extern int stgetopt(int, char *const *, const char *);
-extern char *optarg, rcsid[];
+extern char *optarg;
extern int optind;
+#else
+#include <getopt.h>
+#endif
+
+extern char rcsid[];
int Pflag = 0; /* print no line information */
int Iflag = 0; /* print includes */
@@ -36,7 +42,11 @@ void
Tokenrow tr;
setup_kwtab();
+#if defined MACOSX || !defined HAVE_GETOPT
while ((c = stgetopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1)
+#else
+ while ((c = getopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1)
+#endif
switch (c)
{
case 'N':
diff --git a/soltools/cpp/makefile.mk b/soltools/cpp/makefile.mk
index 818c27028345..11f04b0a3630 100644
--- a/soltools/cpp/makefile.mk
+++ b/soltools/cpp/makefile.mk
@@ -45,7 +45,6 @@ LIBSALCPPRT=$(0)
OBJFILES= \
$(OBJ)$/_cpp.obj \
$(OBJ)$/_eval.obj \
- $(OBJ)$/_getopt.obj \
$(OBJ)$/_include.obj \
$(OBJ)$/_lex.obj \
$(OBJ)$/_macro.obj \
@@ -54,6 +53,15 @@ OBJFILES= \
$(OBJ)$/_tokens.obj \
$(OBJ)$/_unix.obj
+# nonstandard cpp options needed for Mac (-isysroot),
+# needs the custom stgetopt defined here :/
+.IF "$(OS)" == "MACOSX" || "$(HAVE_GETOPT)" == "NO"
+OBJFILES += $(OBJ)$/_getopt.obj
+.ENDIF
+.IF "$(HAVE_GETOPT)" == "YES"
+CDEFS += -DHAVE_GETOPT
+.ENDIF
+
APP1TARGET = $(TARGET)
.IF "$(GUI)" != "OS2"
APP1STACK = 1000000