[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ddd configure bugs (I think so!)
From: |
Andreas Zeller |
Subject: |
Re: ddd configure bugs (I think so!) |
Date: |
06 Dec 2000 18:32:54 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
Hi!
"Jong B. Lee" <jbdoll@kepri.re.kr> writes:
> What I found is that the link order of the X libraries is NOT correct, and
> some odd things. [...]
> According to LessTif FAQ (http://www.lesstif.org/FAQ.html#TOPIC5), the link
> order should be
> -lX11 -lSM -lICE.
>
> And, $LIBXAW $LIBXPM , NOT $LIBXPM $LIBXAW in Makefile.am and Makefile.in.
> With the order of $LIBXPM $LIBXAW, cygwin complains some variables are
> undefined (unresolved symbols error).
> [...]
> [In the configure file], without -lXpm , -lXaw is not included.
>
> And, sigName.C
> strsignal is declared const char *, not char * in cygwin's
> /usr/include/string.h:70
>
> Last, ddd.C ( mkstemp )
> < template > causes parse error on cygwin c++ (I don't know why. gcc works
> well.)
> Probably because 'template' is a c++ keyword.
Thanks! The enclosed patch should fix all these problems. (Hope it
won't generate new ones on other machines!)
--
Andreas Zeller Universitaet Passau
http://www.fmi.uni-passau.de/st/staff/zeller/
Index: ddd/Agent.C
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/Agent.C,v
retrieving revision 1.24
diff -c -2 -r1.24 Agent.C
*** ddd/Agent.C 1999/08/19 11:27:01 1.24
--- ddd/Agent.C 2000/12/06 17:28:39
***************
*** 540,544 ****
{
// Call "Died" message handlers
! callHandlers(Died, statusName(_lastStatus));
_lastStatus = -1;
}
--- 540,544 ----
{
// Call "Died" message handlers
! callHandlers(Died, (char *)statusName(_lastStatus));
_lastStatus = -1;
}
Index: ddd/Makefile.am
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/Makefile.am,v
retrieving revision 1.35
diff -c -2 -r1.35 Makefile.am
*** ddd/Makefile.am 2000/11/27 08:28:36 1.35
--- ddd/Makefile.am 2000/12/06 17:28:39
***************
*** 644,652 ****
LIBXT = @XT_LIBS@
! # X library. (-lSM -lICE -lX11 -lnsl -lsocket)
LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@
# All libraries shown above
! ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXP) $(LIBXPM) $(LIBXAW) $(LIBXEXT) \
$(LIBXT) $(LIBX11) $(LIBGEN)
--- 644,652 ----
LIBXT = @XT_LIBS@
! # X library. (-lX11 -lSM -lICE -lnsl -lsocket)
LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@
# All libraries shown above
! ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXP) $(LIBXAW) $(LIBXPM) $(LIBXEXT) \
$(LIBXT) $(LIBX11) $(LIBGEN)
Index: ddd/configure.in
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/configure.in,v
retrieving revision 1.219
diff -c -2 -r1.219 configure.in
*** ddd/configure.in 2000/11/30 14:31:08 1.219
--- ddd/configure.in 2000/12/06 17:28:40
***************
*** 439,442 ****
--- 439,457 ----
AC_PATH_XTRA
dnl
+ dnl Autoconf bug fix: Cygwin and others want -lSM -lICE in X_EXTRA_LIBS
instead
+ dnl of X_PRE_LIBS (that is, linking order should be `-lX11 -lSM -lICE')
+ loop=true
+ while $loop; do
+ case "$X_PRE_LIBS" in
+ *-lICE*) X_EXTRA_LIBS="-lICE $X_EXTRA_LIBS";
+ X_PRE_LIBS=`echo $X_PRE_LIBS | $SED 's,-lICE,,g'`
+ ;;
+ *-lSM*) X_EXTRA_LIBS="-lSM $X_EXTRA_LIBS";
+ X_PRE_LIBS=`echo $X_PRE_LIBS | $SED 's,-lSM,,g'`
+ ;;
+ *) loop=false;;
+ esac
+ done
+ dnl
dnl Autoconf bug fix: GCC 2.95 and later want -isystem for including X files
X_CFLAGS=`echo $X_CFLAGS | $SED "s,-I,$ISYSTEM,g"`
***************
*** 465,469 ****
dnl
X11_LIBS=""
! AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X is fatal. Let the user fix this.
--- 480,484 ----
dnl
X11_LIBS=""
! AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS}
${X_EXTRA_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X is fatal. Let the user fix this.
***************
*** 485,489 ****
dnl
AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",,
! ${X_PRE_LIBS} ${X11_LIBS})
dnl
dnl
--- 500,504 ----
dnl
AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",,
! ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
dnl
***************
*** 491,495 ****
dnl
AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",,
! ${X_PRE_LIBS} ${X11_LIBS})
dnl
dnl
--- 506,510 ----
dnl
AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",,
! ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
dnl
***************
*** 498,502 ****
XT_LIBS=""
AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",,
! ${X_PRE_LIBS} ${X11_LIBS})
if test "$XT_LIBS" = ""; then
dnl Not having Xt is fatal. Let the user fix this.
--- 513,517 ----
XT_LIBS=""
AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",,
! ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
if test "$XT_LIBS" = ""; then
dnl Not having Xt is fatal. Let the user fix this.
***************
*** 515,523 ****
XEXT_LIBS=""
AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",,
! ${X_PRE_LIBS} ${X11_LIBS})
AC_SUBST(XEXT_LIBS)
dnl
dnl
dnl
dnl Check for Athena widget libraries
dnl
--- 530,553 ----
XEXT_LIBS=""
AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",,
! ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
AC_SUBST(XEXT_LIBS)
dnl
dnl
dnl
+ dnl Check for Xpm library and headers
+ dnl
+ XPM_LIBS=""
+ if test "$xpm_includes" != "no" && test "$xpm_libraries" != "no"
+ then
+ AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage,
+ XPM_LIBS="-lXpm"
+ AC_DEFINE(HAVE_XPM),,${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
+ if test "$XPM_LIBS" != ""; then
+ AC_CHECK_HEADERS(X11/xpm.h xpm.h)
+ fi
+ fi
+ AC_SUBST(XPM_LIBS)
+ dnl
+ dnl
dnl Check for Athena widget libraries
dnl
***************
*** 528,536 ****
AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation,
XAW_LIBS="-lXmu ${XAW_LIBS}",,
! ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS})
AC_CHECK_LIB(Xaw, XawTextSetInsertionPoint,
XAW_LIBS="-lXaw ${XAW_LIBS}"
AC_DEFINE(HAVE_ATHENA),,
! ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS})
if test "$XAW_LIBS" = ""; then
dnl A warning suffices here -- DDD also works without Athena.
--- 558,566 ----
AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation,
XAW_LIBS="-lXmu ${XAW_LIBS}",,
! ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XPM_LIBS} ${XEXT_LIBS}
${X11_LIBS} ${X_EXTRA_LIBS})
AC_CHECK_LIB(Xaw, XawTextSetInsertionPoint,
XAW_LIBS="-lXaw ${XAW_LIBS}"
AC_DEFINE(HAVE_ATHENA),,
! ${X_PRE_LIBS} ${XAW_LIBS} ${XT_LIBS} ${XPM_LIBS} ${XEXT_LIBS}
${X11_LIBS} ${X_EXTRA_LIBS})
if test "$XAW_LIBS" = ""; then
dnl A warning suffices here -- DDD also works without Athena.
***************
*** 552,570 ****
dnl
dnl
- dnl Check for Xpm library and headers
- dnl
- XPM_LIBS=""
- if test "$xpm_includes" != "no" && test "$xpm_libraries" != "no"
- then
- AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage,
- XPM_LIBS="-lXpm"
- AC_DEFINE(HAVE_XPM),,${X_PRE_LIBS} ${X11_LIBS})
- if test "$XPM_LIBS" != ""; then
- AC_CHECK_HEADERS(X11/xpm.h xpm.h)
- fi
- fi
- AC_SUBST(XPM_LIBS)
- dnl
- dnl
dnl Check for Motif widget libraries
dnl
--- 582,585 ----
***************
*** 578,599 ****
XP_LIBS="-lXp"
AC_DEFINE(HAVE_XP),,
! ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS}
${X11_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, XmCreateOptionMenu,
XM_LIBS="-lXm"
AC_DEFINE(HAVE_MOTIF),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, xmUseVersion,
AC_DEFINE(HAVE_XMUSEVERSION),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, XmInstallImage,
AC_DEFINE(HAVE_XMINSTALLIMAGE),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, Xm21InstallImage,
AC_DEFINE(HAVE_XM21INSTALLIMAGE),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${LIBGEN})
fi
if test "$XM_LIBS" = ""; then
--- 593,614 ----
XP_LIBS="-lXp"
AC_DEFINE(HAVE_XP),,
! ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS}
${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, XmCreateOptionMenu,
XM_LIBS="-lXm"
AC_DEFINE(HAVE_MOTIF),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, xmUseVersion,
AC_DEFINE(HAVE_XMUSEVERSION),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, XmInstallImage,
AC_DEFINE(HAVE_XMINSTALLIMAGE),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN})
dnl
AC_CHECK_LIB(Xm, Xm21InstallImage,
AC_DEFINE(HAVE_XM21INSTALLIMAGE),,
! ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS}
${XEXT_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN})
fi
if test "$XM_LIBS" = ""; then
***************
*** 612,616 ****
dnl
dnl Check for Motif properties
! LIBS="$LIBS ${XM_LIBS} ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS}
${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN}"
ICE_MOTIF_DIALOGS_OWN_SELECTION_LIST
dnl
--- 627,631 ----
dnl
dnl Check for Motif properties
! LIBS="$LIBS ${XM_LIBS} ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS}
${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}"
ICE_MOTIF_DIALOGS_OWN_SELECTION_LIST
dnl
Index: ddd/ddd.C
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/ddd.C,v
retrieving revision 1.604
diff -c -2 -r1.604 ddd.C
*** ddd/ddd.C 2000/11/30 14:31:08 1.604
--- ddd/ddd.C 2000/12/06 17:28:41
***************
*** 3075,3079 ****
#if HAVE_MKSTEMP && !HAVE_MKSTEMP_DECL
! extern "C" int mkstemp(char *template);
#endif
--- 3075,3079 ----
#if HAVE_MKSTEMP && !HAVE_MKSTEMP_DECL
! extern "C" int mkstemp(char *templ);
#endif
Index: ddd/exit.C
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/exit.C,v
retrieving revision 1.88
diff -c -2 -r1.88 exit.C
*** ddd/exit.C 2000/05/29 13:43:32 1.88
--- ddd/exit.C 2000/12/06 17:28:41
***************
*** 411,415 ****
// Issue fatal message on stderr
! static void print_fatal_msg(char *title, char *cause, char *cls)
{
static const char *msg =
--- 411,416 ----
// Issue fatal message on stderr
! static void print_fatal_msg(const char *title, const char *cause,
! const char *cls)
{
static const char *msg =
***************
*** 492,496 ****
if (sig != SIGINT)
{
! char *title = sigName(sig);
char cause[BUFSIZ];
sprintf(cause, "`%s' signal", title);
--- 493,497 ----
if (sig != SIGINT)
{
! const char *title = sigName(sig);
char cause[BUFSIZ];
sprintf(cause, "`%s' signal", title);
Index: ddd/sigName.C
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/sigName.C,v
retrieving revision 1.13
diff -c -2 -r1.13 sigName.C
*** ddd/sigName.C 2000/01/12 15:55:13 1.13
--- ddd/sigName.C 2000/12/06 17:28:41
***************
*** 44,57 ****
#include "sigName.h"
! extern "C" char *strsignal(int signo);
// Convert signal number into name
! char *sigName(int signo)
{
return strsignal(signo);
}
// Convert wait() status into name
! char *statusName(int state)
{
if (WIFEXITED(((state))))
--- 44,66 ----
#include "sigName.h"
! #if HAVE_STRSIGNAL && !HAVE_STRSIGNAL_DECL
! extern "C" const char *strsignal(int signo);
! #endif
// Convert signal number into name
! const char *sigName(int signo)
{
+ #if HAVE_STRSIGNAL
return strsignal(signo);
+ #else
+ static char buffer[256];
+
+ sprintf(buffer, "Signal %d", signo);
+ return buffer;
+ #endif
}
// Convert wait() status into name
! const char *statusName(int state)
{
if (WIFEXITED(((state))))
***************
*** 67,70 ****
return sigName(WSTOPSIG(((state))));
! return (char *)"Unknown state change";
}
--- 76,79 ----
return sigName(WSTOPSIG(((state))));
! return "Unknown state change";
}
Index: ddd/sigName.h
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/sigName.h,v
retrieving revision 1.9
diff -c -2 -r1.9 sigName.h
*** ddd/sigName.h 1999/08/19 11:28:55 1.9
--- ddd/sigName.h 2000/12/06 17:28:41
***************
*** 30,35 ****
#define _DDD_sigName_h
! extern char *sigName(int number);
! extern char *statusName(int number);
#endif
--- 30,35 ----
#define _DDD_sigName_h
! extern const char *sigName(int number);
! extern const char *statusName(int number);
#endif