Skip to content
Tcl Source Code Artifact [7236c91c07]
Login

Artifact [7236c91c07]

Artifact 7236c91c07d4f7d40eea67398524ce7601b426a3:

Ticket change [7236c91c07] - New ticket [bc16203b0e1d11d0|bc16203b0e] <i>Allow programmatically adjustable optimization and debug flags</i>. by erikleunissen on 2015-04-06 17:54:50.
D 2015-04-06T17:54:50.541
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Allow\sprogrammatically\sadjustable\soptimization\sand\sdebug\sflags\r\n==============================================================\r\n\r\nThe\sbuild\sprocess\sbased\son\sautotools\sallows\sadjustment\sof\sthe\sbuild\sconfiguration\sby\sproviding\scustom\svalues\sfor\ssome\svariables.\sWell-known\sexamples\sare\snames\sfor\sprograms\slike\sCC,\sLD,\sAR,\sRANLIB,\sDLLTOOL,\sNM\sand\sRC,\sand\sprogram\sflags\slike:\sCPPFLAGS,\sCFLAGS,\sLDFLAGS.\sRegular\smethods\sto\smake\ssuch\scustomizations\sprogrammatically,\sare\sthe\susage\sof\sa\sconfig.site\sscript,\sor\spassing\ssettings\son\sthe\scommand-line\sfor\s./configure.\r\n\r\nWhat\scurrently\sdoesn't\swork\susing\sthese\smethods,\sis\sadjusting\sdebug\sand\soptimization\sflags\s(to\sthe\scompiler\sand\slinker).\sAlso,\sthese\sadjustment\scannot\sbe\scleanly\sdone\sthrough\sthe\sCFLAGS\sand\sLDFLAGS\svariables\sbecause\sMakefile.in\shandles\sthese\svariables\sin\sappend\smode,\sresulting\sin\smultiple\sdebugging\sor\soptimization\ssettings\swithin\sa\ssingle\scompiler\scommand\sline.\r\n\r\nThe\sattached\spatches\senable\sthe\sfunctionality\sfor\sTcl\sand\sTk.\sThey\smodify\sjust\sthe\sfiles\stcl.m4\sin\sthe\sunix\sand\swin\ssubdirectories.\sMacosx\sbuilds\sinherit\sthe\sfunctionality\sfrom\sthe\spatched\sunix\sdirectory.\r\n\r\nBecause\stcl.m4\sis\smodified,\sthe\sconfigure\sscripts\sneed\sto\sbe\sregenerated.\sA\snewly\sgenerated\s./configure\spicks\sup\scustom\ssettings\sfor\sCFLAGS_OPTIMIZE\sand\sCFLAGS_DEBUG,\seither\sfrom\sa\sconfig.site\sscript\sor\sdirectly\sfrom\sthe\scommand\sline.\sExample\sinvocations\sare\sprovided\sbelow\sfor\swin,\sunix\sand\smacosx\sbuilds.\sIn\sany\scase,\sthe\sresulting\sMakefile\stakes\scare\sof\sinvoking\sthe\scompiler\sand\slinker,\susing\sthe\scustom\soptimization\sand\sdebug\sflags\sas\sintended\s(tested).\r\n\r\nPart\sof\sthis\spatch\sremoves\ssome\sclutter\sand\sdirt\srelated\sto\sthe\spertinent\svariables:\r\na.\sremove\sredundant\sexplicit\ssubstitution\sof\sprecious\svariables\r\nb.\sfor\snon-gcc\swin\sbuilds:\sassign\spreprocessor\sdirectives\spreviously\scluttering\sCFLAGS_OPTIMIZE\sand\sCFLAGS_DEBUG,\sto\sDEFS\sinstead\r\n\r\nThe\smotivation\sfor\sthis\spatch\sis\sa\spersonal\sneed\sfor\sprogrammatical\sadjustment\sof\s(just)\sthe\soptimization\sflags\sto\sthe\scompiler.\sThough\sI\sdon't\sneed\sit\smyself,\sI\sexpect\sarguments\sfor\sadjusting\sdebug\sflags\sto\sbe\ssimilar\sto\sthose\sfor\soptimization\sflags.\sThe\smain\sreason\sto\sapply\sthis\sfunctionality\salso\sto\sthe\slinker\sflags,\sis\sthe\sentirely\sanaloguous\shandling\sof\scompiler\sand\slinker\sflags\sthroughout\sthe\sbuild\sconfiguration.\sHence\sthe\sscope.\r\n\r\nThe\sattached\spatches\sare\sbased\soff\sthe\sfossil\strunk:\r\nTcl:\s[6f8d422627],\s2015-04-04\s11:47\r\nTk:\s\s[22256943eb],\s2015-03-24\s19:13\r\n\r\n\r\nSincerely,\r\n\r\nErik\sLeunissen\r\n--\r\n\r\nCommand\sline\sexamples\sfor\scustomized\sbuild\sflags\r\n================================================\r\n\r\n[1]\susing\sa\sconfig.site\sscript\s(unix\sand\swin\sbuilds):\r\n\r\n>\scat\s/wherever/you/stored/it/config.site\r\nCFLAGS_DEBUG=-ggdb3\r\nCFLAGS_OPTIMIZE=-O3\r\n\r\n>\sCONFIG_SITE=/wherever/you/stored/it/config.site\s./configure\s--disable-symbols\r\n\r\n\s\s\s\s\s(or\suse\s--enable-symbols\sinstead,\sto\sselect\sthe\scustom\sdebug\ssettings)\r\n\r\n\r\n[2]\susing\scommand\sline\sarguments\s(unix\sand\swin\sbuilds):\r\n\r\n>\s./configure\s--enable-symbols\sCFLAGS_DEBUG=-ggdb3\r\n\r\nor:\r\n\r\n>\s./configure\s--disable-symbols\sCFLAGS_OPTIMIZE=-O3\r\n\r\n\r\n[3]\smacosx\svariant:\r\n\r\nThe\spresented\scustomization\smethod\salso\sworks\swith\smacosx\sbuilds,\swhich\suse\sthe\sunix\s./configure\sscript\sfor\stheir\spurpose\s(and\sthe\sunix\spatch\sapplies\sin\sthis\scase).\sHowever,\sa\smacosx\sbuild\sdoesn't\scall\s../unix/configure\sdirectly.\sIt\suses\smake\sas\sa\swrapper\scommand.\sTherefore,\sthe\smacosx\scommand\slines\sare\sdifferent\sfrom\sthose\sfor\sthe\swin\sand\sunix\sbuilds.\sTo\sproduce\scustomized\sdebug\sand\soptimized\sbuilds\sfor\smacosx\s(macosx\ssupports\sbuilding\sboth\sin\sone\sgo),\sone\scan\sdo:\r\n\r\n>\smake\sEXTRA_CONFIGURE_FLAGS="CONFIG_SITE=/wherever/you/stored/it/config.site"\r\n\r\nor:\r\n\r\n>\smake\sEXTRA_CONFIGURE_FLAGS="CFLAGS_DEBUG=-ggdb3\sCFLAGS_OPTIMIZE=-O3"\r\n\r\n--\send\s--
J foundin all
J is_private 0
J login erikleunissen
J priority 5\sMedium
J private_contact 609f4c7ecf7dbb7a46acdc7eb164753d196088a6
J resolution None
J severity Minor
J status Open
J submitter erikleunissen
J subsystem 53.\sConfigure\sand\sBuild\sTools
J title Allow\sprogrammatically\sadjustable\soptimization\sand\sdebug\sflags
J type Patch
K bc16203b0e1d11d0d6cee35d41a8218bd97364c1
U erikleunissen
Z 87e3086d5ff46323fbc01695387d5de8