File: LSB-BUILD-LESSTIF

package info (click to toggle)
xastir 2.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,284 kB
  • sloc: ansic: 119,926; perl: 7,810; sh: 1,309; makefile: 392; sql: 102
file content (94 lines) | stat: -rwxr-xr-x 3,076 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh

# Copyright (C) 2000-2023 The Xastir Group
# <http://www.lesstif.org/>

# Compile lesstif-0.95.0 under Linux Standard Base 3.0.  Install
# into /opt/lsb-tmp/ directory structure.

# NOTE:
# "Free Standards Group, FSG, Linux Standard Base, LSB, Free
# Standards Certified, LSB Certified and the Free Standards
# Certified logo are trademarks, service marks and certification
# marks, as appropriate, of Free Standards Group in the United
# States and in other countries."
#
# We are in no way representing that Xastir has been certified by
# the FSG.  To do so costs real money.  We do intend some Xastir
# binaries to install and run properly on LSB-3.0 compliant x86
# Linux systems though...
#

# In order to build Lesstif on LSB we need a static version of the
# LSB libXt.so library, called libXt.a.  To get this, we must
# compile the "lsb/appbat" portion of LSB-CVS and snag the library
# out of there.  We can then copy it or symlink it into /opt/lsb/lib
# and change permissions on /opt/lsb/lib/libXt.so so that it's
# unreadable.  We'll get the static version of libXt compiled in to
# our app that way.  Put the .so back and disable the .a when we're
# done compiling Lesstif and Xastir so that the LSB runtime is
# intact.
#
# Actual method used:
#
#   cd /opt/lsb
#   cp -R lib lib.lesstif
#   mv lib lib.orig
#   ln -s lib.lesstif lib
#   cd lib
#   rm libXt.so          (or just "chmod 000 libXt.so")
#   ln -s PATH/libXt.a   (from LSB "appbat")
#
# This makes it easy to switch back to the default library setup by
# changing the /opt/lsb/lib symlink.
#


export PATH=${PATH}:/opt/lsb/bin
export LSBCC_WARN=1

# A colon-separated list of "extra" shared libraries to link with
# the application.  Each shared lib must be LSB-compliant and must
# be distributed along with the application.
#export LSBCC_SHAREDLIBS=


# Patches to the Lesstif source code:
#
# Edit lib/Xm/ImageCache.c: Change "_XInitImageFuncPtrs" to
# "XInitImage" in two places, then comment out the first instance:
sed -i -e 's/_XInitImageFuncPtrs/XInitImage/g' lib/Xm-2.1/ImageCache.c
sed -i -e 's/^extern void XInitImage/\/\/extern void XInitImage/g' lib/Xm-2.1/ImageCache.c
#
# Comment out the sighandler_t line in lib/Xm/DebugUtil.c:
sed -i -e 's/^typedef void ..sighandler_t/\/\/typedef void (*sighandler_t/' lib/Xm-2.1/DebugUtil.c


CC=lsbcc CXX=lsbc++ ./configure \
    --prefix=/opt/lsb-tmp \
    --enable-static \
    --x-libraries=/opt/lsb/lib \
    --x-includes=/opt/lsb/include \
    --with-motif-includes=/opt/lsb/include \
    --with-motif-libraries=/opt/lsb/lib \
    --disable-shared

make clean

find . -type f -name Makefile -print | while read i
  do
    sed -i 's@/usr/include@opt/lsb/include@g' $i
    sed -i 's@/usr/local/include@opt/lsb/include@g' $i
    sed -i 's@/usr/X11R6/include@opt/lsb/include@g' $i
    sed -i 's@/usr/lib@opt/lsb/lib@g' $i
    sed -i 's@/usr/local/lib@opt/lsb/lib@g' $i
    sed -i 's@/usr/X11R6/lib@opt/lsb/lib@g' $i
    sed -i 's@/usr/X11/lib@opt/lsb/lib@g' $i
  done

(make 2>&1) | tee make.log

#make -n install
sudo make install