home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / tar-1.11.8-src.tgz / tar.out / fsf / tar / intl / combine-sh < prev    next >
Text File  |  1996-09-28  |  3KB  |  142 lines

  1. #!/bin/sh
  2.  
  3. TMPDIR=/tmp
  4. TMPNAME=/tmp/combine1.$$.sed
  5.  
  6. trap 'rm -fr $TMPNAME combine; exit 1' 1 2 15
  7.  
  8. rm -f $TMPNAME
  9. cat > $TMPNAME <<EOF
  10. /@@ end of prolog @@/,/@@ begin of epilog @@/!d
  11. /@@ end of prolog @@/ {
  12.   =
  13.   d
  14. }
  15. /@@ begin of epilog @@/d
  16. EOF
  17.  
  18.  
  19. rm -fr combine
  20. mkdir combine
  21. cat > combine/libintl.c <<EOF
  22. /* Combined sources of GNU gettext library
  23.    Copyright (C) 1995 Software Foundation, Inc.
  24.  
  25. This program is free software; you can redistribute it and/or modify
  26. it under the terms of the GNU General Public License as published by
  27. the Free Software Foundation; either version 2, or (at your option)
  28. any later version.
  29.  
  30. This program is distributed in the hope that it will be useful,
  31. but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  33. GNU General Public License for more details.
  34.  
  35. You should have received a copy of the GNU General Public License
  36. along with this program; if not, write to the Free Software
  37. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  38.  
  39. #ifdef HAVE_CONFIG_H
  40. # include <config.h>
  41. #endif
  42.  
  43. #define USE_COMBINED_HEADER 1
  44. #include "libintlP.h"
  45.  
  46. #if HAVE_CATGETS
  47.  
  48. #include <stdlib.h>
  49.  
  50. #ifdef HAVE_LOCALE_H
  51. # include <locale.h>
  52. #endif
  53.  
  54. #ifdef HAVE_NL_TYPES_H
  55. # include <nl_types.h>
  56. #endif
  57.  
  58. EOF
  59.  
  60. CATCFILES=cat-compat.c
  61. GETCFILES="bindtextdom.c dcgettext.c dgettext.c finddomain.c gettext.c \
  62. loadmsgcat.c textdomain.c"
  63.  
  64. for file in $CATCFILES; do
  65.   sed -f $TMPNAME < $file \
  66.     | sed -e '1s/.*/#line & "'$file'"/' >> combine/libintl.c
  67. done
  68. cat >> combine/libintl.c <<EOF
  69.  
  70. #else /* !HAVE_CATGETS */
  71.  
  72. #include <alloca.h>
  73. #include <fcntl.h>
  74. #include <stdio.h>
  75. #include <stdlib.h>
  76. #include <string.h>
  77. #include <sys/stat.h>
  78.  
  79. #ifdef HAVE_LOCALE_H
  80. # include <locale.h>
  81. #endif
  82.  
  83. #ifdef HAVE_UNISTD_H
  84. # include <unistd.h>
  85. #endif
  86.  
  87. #ifdef HAVE_MMAP
  88. # include <sys/mman.h>
  89. #endif
  90.  
  91. EOF
  92. for file in $GETCFILES; do
  93.   sed -f $TMPNAME < $file \
  94.     | sed -e '1s/.*/#line & "'$file'"/' >> combine/libintl.c
  95. done
  96. cat >> combine/libintl.c <<EOF
  97. #endif /* HAVE_CATGETS */
  98. EOF
  99.  
  100. cat > combine/libintlP.h <<EOF
  101. /* Combined header files of GNU gettext library
  102.    Copyright (C) 1995 Software Foundation, Inc.
  103.  
  104. This program is free software; you can redistribute it and/or modify
  105. it under the terms of the GNU General Public License as published by
  106. the Free Software Foundation; either version 2, or (at your option)
  107. any later version.
  108.  
  109. This program is distributed in the hope that it will be useful,
  110. but WITHOUT ANY WARRANTY; without even the implied warranty of
  111. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  112. GNU General Public License for more details.
  113.  
  114. You should have received a copy of the GNU General Public License
  115. along with this program; if not, write to the Free Software
  116. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  117.  
  118. EOF
  119.  
  120. PUBHEAD=libgettext.h
  121. PRIVHEAD="gettext.h gettextP.h hash-string.h"
  122.  
  123. for file in $PUBHEAD; do
  124.   sed -f $TMPNAME < $file \
  125.     | sed -e '1s/.*/#line & "'$file'"/' >> combine/libintlP.h
  126. done
  127. cat >> combine/libintlP.h <<EOF
  128.  
  129. #ifdef USE_COMBINED_HEADER
  130. EOF
  131. for file in $PRIVHEAD; do
  132.   sed -f $TMPNAME < $file \
  133.     | sed -e '1s/.*/#line & "'$file'"/' >> combine/libintlP.h
  134. done
  135. cat >> combine/libintlP.h <<EOF
  136. #endif /* USE_COMBINED_HEADER */
  137. EOF
  138.  
  139.  
  140. rm -f $TMPNAME
  141. exit 0
  142.