Wednesday, July 6, 2011

Open LDAP compilation (litchi)

First, install the sasl lib (not gsasl).
Second, configure options for Open LDAP:

LD_LIBRARY_PATH="/usr/local/lib/sasl2:/usr/local/BerkeleyDB.4.4/lib" LDFLAGS="-L/usr/local/lib/sasl2 -L/usr/local/BerkeleyDB.4.4/lib" CPPFLAGS="-I/usr/local/include/sasl -I/usr/local/BerkeleyDB.4.4/include " ./configure --enable-bdb --enable-ldbm --enable-ldap --enable-meta --enable-crypt --with-cyrus-sasl

Then, compile

make depend
make

Linux: Replace a dynamic library for a test

  • Re-compile the exe using the .so while removing the -rpath dir option.
  • export LD_LIBARY_PATH
  • Check with ldd on the exe that your library is taken into account.

Compile libapi.so sample

/u/engineering/locals/solaris9/softs/proglang/gcc-3.2/bin/gcc -m64 -fPIC -DULTICOM_IN_HOUSE_COMPILE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS   -DULTICOM_IN_HOUSE_COMPILE -I/vob/common/src -I/vob/signalware/../common/src   -I. -I.. -I/vob/common/3rdparty/licensemanager/include -I/vob/signalware//Master/Ft/inc -I/vob/signalware//Master/Ft/inc -I/vob/signalware//Master/cust_inc -I/vob/signalware//Master/cust_inc -I/vob/signalware//Master/priv_inc -I/vob/signalware//Master/priv_inc  -I/usr/X/include     -g -Wall -std=gnu99 -O  -I/vob/common/src -c ~/tmp/cpptrial/api_main.c -o api_main.o
/u/engineering/locals/solaris9/softs/proglang/gcc-3.2/bin/gcc -R /usr/lib/sparcv9/omni -L/vob/signalware/Master/library -L/vob/signalware/Master/library -m64 -R/usr/lib/sparcv9/omni  -o api_main  api_main.o -L/vob/common/lib/ -lulcmtoolsc  -lapi -ldf -lFt -lsocket -lnsl -lgen -lpthread -ldgms -lrt

man swmake

crtool man make

pm.c:7355: warning: int format, different type arg (arg 8)

This warning in 9V4 (but not in 9S50) is due to the fact that in Ft Proto.h, we have:

#ifdef GNUC
int FtFormatInternationalMsg (nl_catd catd, int set_number,
                              int message_number, _TCHAR defaultString,
                              _TCHAR destMsgBuf, int sizeDestMsgBuf, ...)
    attribute((format(printf, 4, 7)));

Explanation:

attribute format

This attribute allows assigning printf-like or scanf-like characteristics to the declared function, and this enables the compiler to check the format string against the parameters provided throughout the code. This is exceptionally helpful in tracking down hard-to-find bugs.

There are two flavors:

  • attribute((format(printf,m,n)))
  • attribute((format(scanf,m,n)))

but in practice we use the first one much more often.

The (m) is the number of the “format string” parameter, and (n) is the number of the first variadic parameter. To see some examples:

/* like printf() but to standard error only */
 extern void eprintf(const char *format, ...)
     __attribute__((format(printf, 1, 2)));  /* 1=format 2=params */

 /* printf only if debugging is at the desired level */
 extern void dprintf(int dlevel, const char *format, ...)
     __attribute__((format(printf, 2, 3)));  /* 2=format 3=params */

With the functions so declared, the compiler will examine the argument lists

$ cat test.c
 1  extern void eprintf(const char *format, ...)
 2               __attribute__((format(printf, 1, 2)));
 3
 4  void foo()
 5  {
 6      eprintf("s=%s\n", 5);             /* error on this line */
 7
 8      eprintf("n=%d,%d,%d\n", 1, 2);    /* error on this line */
 9  }
 $ cc -Wall -c test.c
 test.c: In function `foo':
 test.c:6: warning: format argument is not a pointer (arg 2)
 test.c:8: warning: too few arguments for format

Note that the “standard” library functions – printf and the like – are already understood by the compiler by default.

C7 compilation only

cd c7;swmake "PROT_FLAGS=-DC7_Q"

A7 compilation only

cd a7;swmake "PROT_FLAGS=-DA7_T"

CH7 compilation only

cd ch7;swmake "PROT_FLAGS=-DC7_Q -DCH7_Q"

J7 compilation only

cd j7;swmake "PROT_FLAGS=-DJ7_Q -DJ7G_Q"

Basic Signalware compilation

Compiles what is in ”/ccase/cm/crtool/var/swmake_filters/basic.filter”

swmake -Xfilter=basic

k2632 native sctp compilation

To compile /vob/signalware/Master/sctp/native, you first need to specify you use native SCTP via configurePlarform, then swcommission.

Typical error:

snmp_bindx undefined symbol

libexpat / libcrypto compilation

E.g. libcrypto compilation



> cd /vob/common/3rtparty/openssl
> swmake
Creating /vob/common/3rdparty/openssl/Makefile from /vob/common/3rdparty/openssl/Imakefile
current vob=/vob/common
imake default opts=-DPROD_sun -DUSE64BITS -DUSEGCC -DPROD_sol10 -DUSEGNUSYNTAX -DWINKIN_COMPILE -DREMOTE_SITE -DWINKIN_COMPILE
/vob/common/3rdparty/openssl (Imakefile)
reset imake add opts=-D_CURRENTVOB=/vob/common -I/vob/common/config
"./Imakefile", line 1: Can't find include file omni.cf
"./Imakefile", line 2: Can't find include file c++.cf
imake: Exit code 2. Stop.
Interupted: 256 at /vob/common/src/perl/Ulcm/Nmkmf.pm line 265.
clearmake: Error: Syntax error in file "Makefile", line 28, column 0
syntax error

To fix this shit, proceed as follows:

> nmkmf "-I/vob/signalware/Master/config" 
> swmake

ftxtract looks for ftxtract.cf

> OMNI_HOME=/vob/signalware ftxtract

Compile JMML utests

> cd jmml/utests
> /vob/common/3rdparty/jakarta-ant/jakarta-ant-1.5.4/bin/ant -DCOMMON_CMROOT=/vob/common

Wednesday, June 22, 2011

Change to a british keyboard

> setxkbmap -layout gb

Wednesday, June 8, 2011

Disable / Enable Spotlight

Completely disable Spotlight indexing:
sudo mdutil -a -i off

To enable Spotlight again:
sudo mdutil -a -i on

Tuesday, June 7, 2011

My white titles are printed black

Goto View menu.
Click Grayscale in Color/Grayscale ribbon.
Select one slide that has the problem on the left in order to have it displayed on the main window.
Click in the black title.
Click in the White icon in Change Selected Object ribbon.

This will make the title appear (and print) white.

Sunday, May 15, 2011

Firefox 4 does not install

When dragging the Firefox icon to the Applications folder, I get:

"The operation can’t be completed because you don’t have permission to access some of the items."

Solution:
- Open a terminal
sudo -s
hdiutil mount /Users/jerome/Downloads/Firefox 4.0.1.dmg
cp -r /Volumes/Firefox /tmp
mv /tmp/Firefox.app /Applications


et voila

Install LeoHazard 10.6.2 on AMD Athlon64 3500+

Conf. recap:
Gigabyte K8NF9 ultra
AMD athlon64 3500+
GeForce 240 GT 512Mb GDDR5

Boot on LeoHazard DVD
Partition the disk w/ Disk Utility
Options:
    Mac OSX 10.6.2
    Kernels:
        Legacy_kernel_10.2.0
    Graphics_Drivers:
        NVEnabler
    System_Support:
        SATA_ATA_Fix
        JMicron_ATA_Injector
        UUID
        Fakesmc_V1.0
    AMD
    Additional Fonts
    X11
Eject DVD and reboot
On Chameleon menu, <Enter>, then -v -s <Enter>
On prompt: 
/sbin/fsck -fy
mount -uw /
cd /Volumes/snowleopard
rm Extra/Extensions.mkext
rm S/L/Extensions.mkext
rm -R S/L/E/SleepEnabler.kext
rm -R S/L/E/ApplePS2Controller.kext
rm -R S/L/E/AppleIntelCPUPowerManagement*.kext
rm -R S/L/E/Disabler.kext
rm -R S/L/E/AppleHPET.kext
rm -R S/L/E/AppleSMBios.kext

Reboot (long)
Run Marvin's utility (last option) on /System; When all files patched, appl. stops responding => kill it
Reboot: * Important! * Do not try installing anything before reboot complete or you would face privileges problems
Install Dropbox 
Install kexts from Dropbox: everything into S/L/E except ElliotForceLegacyRTC into E/E
Run Kext Utility 
Update NVEnabler.kext:
    Show Content
    Edit info.plist: Root | IOKitPersonalities | NVEnabler | IOPCIMatch => 0x0ca310de
Change the default partition to boot on Windows by default:
    Edit /E/E/com.apple.Boot.plist
    Add new child: Default Partition => hd(1,1) (NB: this matches the partition for System Reserved, Windows)
Activate sound:
    Goto System Preferences
    Select "Line out" for Sound effects and for Output 
Install iMovie 11 (only iMovie, not the whole iLife suite, which causes a KP on AMD)

Monday, May 2, 2011

See which are the packages you have installed

dpkg -l |grep -e "^ii.*"