Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Alternative Civs > Freeciv > Possibly the ugliest code in freeciv
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
04.Sep: `FC` 2.0.5 COMPLETED AND RELEASED
27.Jul: `FC` 2.0.4 COMPLETED AND RELEASED
16.Jul: `FC` 2.0.3 COMPLETED AND RELEASED

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Thue is offline Thue
Freeciv Developer
Copenhagen, Denmark
Jan 1970
time: 06:14
  Old Post 30-05-2001 01:22 Visit Thue's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Possibly the ugliest code in freeciv Tired of ads?

code:
dnl FC_CHECK_X_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, dnl ACTION-IF-NOT-FOUND]]) dnl dnl This macro is intended to search for X11-related libraries. It takes the dnl following variables for input: dnl X_LIBS -- prefixed to all linker lines dnl X_EXTRA_LIBS -- suffixed to all linker lines dnl LIBS -- suffixed to all linker lines (after X_EXTRA_LIBS) dnl Thus, the trial linker line will be "$X_LIBS -l$1 $X_EXTRA_LIBS $LIBS". dnl dnl The following variables are output: dnl X_EXTRA_LIBS -- contains "-l$1 $X_EXTRA_LIBS" if the link succeeds dnl dnl Thus, the intended usage of this macro is something like this: dnl AC_PATH_XTRA dnl X_LIBS="$X_LIBS $X_PRE_LIBS" dnl dnl Is it just me or is AC_PATH_XTRA broken? dnl FC_CHECK_X_LIB(X11, XOpenDisplay, , AC_MSG_ERROR("Need X11")) dnl FC_CHECK_X_LIB(Xext, XShapeCombineMask) dnl [etc.] dnl LIBS="$X_LIBS $X_EXTRA_LIBS $LIBS" dnl AC_DEFUN(FC_CHECK_X_LIB, [AC_MSG_CHECKING([for $2 in X library -l$1]) dnl Use a cache variable name containing both the library and function name, dnl because the test really is for library $1 defining function $2, not dnl just for library $1. Separate tests with the same $1 and different $2s dnl may have different results. ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="$X_LIBS -l$1 $X_EXTRA_LIBS $LIBS" AC_TRY_LINK(dnl ifelse([$2], [main], , dnl Avoid conflicting decl of main. [/* Override any gcc2 internal prototype to avoid an error. */ ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus extern "C" #endif ])dnl [/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $2(); ]), [$2()], eval "ac_cv_lib_$ac_lib_var=yes", eval "ac_cv_lib_$ac_lib_var=no") LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) X_EXTRA_LIBS="-l$1 $X_EXTRA_LIBS" ], [$3]) else AC_MSG_RESULT(no) ifelse([$4], , , [$4 ])dnl fi ])


While looking into why autoconf 2.50 wouldn't work with freeciv I came across the following. Is that ugly or what . I am not sure how it works...

Except that it doesn't cause autoconf 2.50 won't eat it. It is possible that the bug is in autoconf, but I doubt it!

MattHiggs is offline MattHiggs
King

Apr 2000
time: 05:14
  Old Post 01-06-2001 04:28 Visit MattHiggs's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Remove this text

As a lowly PASCAL coder I've not a clue what this code is on about, it's not even structured Ewww

I am doing Computer Science next year, so maybe then I can help you out Thue with coding and stuff as I will be studying Linux and C++ and also Java.

Thue is offline Thue
Freeciv Developer
Copenhagen, Denmark
Jan 1970
time: 06:14
  Old Post 01-06-2001 04:36 Visit Thue's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Call to Power 2

I know what it is supposed to do because I have read the comment.
Worst of all, I think it may be totally redundant

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0276 seconds (88.68% PHP - 11.32% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net